/* =========================================================
   Happy6glab — Dental Lab
   Tông màu tươi sáng: mint / teal / xanh dương pastel
   ========================================================= */

:root {
    --teal-50:  #effcfa;
    --teal-100: #d3f6f1;
    --teal-200: #a8ece5;
    --teal-400: #35cfc0;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;

    --sky-100:  #e0f2fe;
    --sky-400:  #38bdf8;
    --sky-500:  #0ea5e9;

    --ink:      #0f2b30;
    --ink-soft: #48646a;
    --muted:    #7d949a;
    --line:     #e3eef0;
    --bg:       #ffffff;
    --bg-soft:  #f5fbfb;

    --amber:    #f59e0b;
    --rose:     #f43f5e;
    --green:    #10b981;

    --radius:   18px;
    --radius-lg: 26px;
    --shadow-sm: 0 2px 10px rgba(15, 118, 110, .06);
    --shadow:    0 12px 34px rgba(15, 118, 110, .10);
    --shadow-lg: 0 26px 60px rgba(15, 118, 110, .16);

    --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--teal-600); text-decoration: none; }
a:hover { color: var(--teal-700); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }

/* ------------------------------------------------------------- buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .85rem 1.7rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--teal-500), var(--sky-500));
    color: #fff;
    box-shadow: 0 10px 24px rgba(14, 165, 233, .28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(14, 165, 233, .34); color: #fff; }
.btn-ghost {
    background: #fff;
    color: var(--teal-700);
    border: 1.5px solid var(--teal-200);
}
.btn-ghost:hover { background: var(--teal-50); transform: translateY(-2px); }
.btn-sm { padding: .5rem 1.05rem; font-size: .88rem; }
.btn-block { width: 100%; }
.btn-danger { background: var(--rose); color: #fff; }
.btn-danger:hover { background: #e11d48; color: #fff; }

/* -------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    min-height: 76px;
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); }
.brand img { height: 46px; width: auto; object-fit: contain; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--teal-400), var(--sky-400));
    color: #fff; font-weight: 800; font-size: 1.15rem;
    box-shadow: var(--shadow-sm);
}
.brand-text strong { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.brand-text span { font-size: .76rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a { color: var(--ink-soft); font-weight: 500; font-size: .96rem; }
.nav a:hover { color: var(--teal-600); }

.nav-toggle { display: none; background: none; border: 0; font-size: 1.6rem; color: var(--ink); cursor: pointer; }

/* ---------------------------------------------------------------- hero */

.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(3.5rem, 8vw, 6rem) 0 clamp(4rem, 9vw, 6.5rem);
    background:
        radial-gradient(1000px 480px at 12% -10%, var(--teal-100), transparent 60%),
        radial-gradient(900px 460px at 92% 0%, var(--sky-100), transparent 62%),
        linear-gradient(180deg, #fbffff, #f2fbfb);
}
.hero::after {
    content: "";
    position: absolute; inset: auto -10% -55% 55%;
    height: 420px;
    background: radial-gradient(circle, rgba(53, 207, 192, .18), transparent 68%);
    pointer-events: none;
}
.hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--teal-200);
    color: var(--teal-700);
    font-size: .82rem; font-weight: 600;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.2rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-500); }
.hero h1 { font-size: clamp(2.1rem, 4.4vw, 3.35rem); margin-bottom: .7rem; }
.hero h1 .grad {
    background: linear-gradient(120deg, var(--teal-600), var(--sky-500));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 46ch; margin: 0 0 1.6rem; }

.hero-badges { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-badges span {
    background: #fff; border: 1px solid var(--line);
    padding: .45rem 1rem; border-radius: 999px;
    font-size: .85rem; color: var(--ink-soft); box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------- warranty card */

.lookup-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: clamp(1.6rem, 3vw, 2.4rem);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--teal-100);
}
.lookup-card h2 { font-size: 1.35rem; margin-bottom: .3rem; }
.lookup-card .hint { color: var(--muted); font-size: .92rem; margin: 0 0 1.3rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; color: var(--ink); }
.input, input[type=text], input[type=password], input[type=date], input[type=number], textarea, select {
    width: 100%;
    padding: .85rem 1.05rem;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus, input:focus, textarea:focus, select:focus {
    outline: 0;
    border-color: var(--teal-400);
    box-shadow: 0 0 0 4px rgba(53, 207, 192, .16);
}
textarea { resize: vertical; min-height: 110px; }

.code-input {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
}
.lookup-card .foot-note { font-size: .82rem; color: var(--muted); margin: 1rem 0 0; text-align: center; }

.alert {
    padding: .85rem 1.1rem;
    border-radius: 14px;
    font-size: .92rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-error   { background: #fff1f3; color: #9f1239; border-color: #fecdd3; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-info    { background: var(--teal-50); color: var(--teal-700); border-color: var(--teal-200); }

/* ------------------------------------------------------------ sections */

.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(2rem, 4vw, 3rem); }
.section-head .eyebrow { margin-bottom: .9rem; }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); }
.section-head p { color: var(--ink-soft); margin: 0; }

/* about */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.8rem, 4vw, 3.4rem);
    align-items: center;
}
.about-media {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, var(--teal-100), var(--sky-100));
    aspect-ratio: 4 / 3;
}
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-body h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
.about-body .excerpt { font-size: 1.06rem; color: var(--ink-soft); }
.about-body .body-text { color: var(--ink-soft); white-space: pre-line; }

.stats { display: flex; flex-wrap: wrap; gap: 2.2rem; margin-top: 1.8rem; }
.stats div strong {
    display: block; font-size: 1.85rem; font-weight: 800;
    background: linear-gradient(120deg, var(--teal-600), var(--sky-500));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stats div span { font-size: .88rem; color: var(--muted); }

.post-list { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 2.5rem; }
.post-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem; box-shadow: var(--shadow-sm);
}
.post-card h3 { font-size: 1.1rem; }
.post-card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.post-card img { border-radius: 14px; margin-bottom: 1rem; aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* ------------------------------------------------------------ products */

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.6rem);
}
.product-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
    display: flex; flex-direction: column;
}
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--teal-200);
}
.product-thumb {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--teal-50), var(--sky-100));
    overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-thumb img { transform: scale(1.06); }
.product-card h3 {
    margin: 0;
    padding: 1.05rem .9rem 1.15rem;
    text-align: center;
    font-size: .98rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink);
}

/* --------------------------------------------------------- result page */

.result-wrap { padding: clamp(2.5rem, 6vw, 4rem) 0; background: var(--bg-soft); min-height: 60vh; }
.result-card {
    max-width: 820px; margin: 0 auto;
    background: #fff; border-radius: var(--radius-lg);
    box-shadow: var(--shadow); border: 1px solid var(--teal-100);
    overflow: hidden;
}
.result-head {
    padding: 1.7rem clamp(1.3rem, 3vw, 2.2rem);
    background: linear-gradient(135deg, var(--teal-500), var(--sky-500));
    color: #fff;
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.result-head h1 { font-size: 1.4rem; margin: 0 0 .2rem; color: #fff; }
.result-head p { margin: 0; opacity: .9; font-size: .92rem; }
.result-head .code { font-size: 1.5rem; font-weight: 800; letter-spacing: .12em; }

.status-pill {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .42rem 1rem; border-radius: 999px;
    font-size: .85rem; font-weight: 700; background: #fff;
}
.status-pill.active  { color: #047857; }
.status-pill.expired { color: #be123c; }
.status-pill.pending { color: #b45309; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
    padding: 1rem clamp(1.3rem, 3vw, 2.2rem);
    text-align: left; border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.info-table th { width: 40%; color: var(--ink-soft); font-weight: 600; font-size: .93rem; background: #fcfefe; }
.info-table td { font-weight: 600; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }

.result-actions { padding: 1.4rem clamp(1.3rem, 3vw, 2.2rem); display: flex; gap: .8rem; flex-wrap: wrap; }

.retry-card {
    max-width: 820px; margin: 1.6rem auto 0;
    background: #fff; border: 1px dashed var(--teal-200); border-radius: var(--radius-lg);
    padding: clamp(1.4rem, 3vw, 2rem);
}
.retry-card h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.retry-card p { color: var(--muted); font-size: .9rem; margin: 0 0 1.1rem; }
.retry-form { display: flex; gap: .7rem; flex-wrap: wrap; }
.retry-form input { flex: 1 1 240px; }

.not-found {
    max-width: 620px; margin: 0 auto; text-align: center;
    background: #fff; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3rem);
    box-shadow: var(--shadow); border: 1px solid var(--line);
}
.not-found .icon { font-size: 3rem; margin-bottom: .6rem; }

/* -------------------------------------------------------------- footer */

.site-footer {
    background: linear-gradient(135deg, #0f2b30, #123f42);
    color: #cfe6e6;
    padding: 2.6rem 0;
    text-align: center;
}
.site-footer .logo-line { font-size: 1.35rem; font-weight: 800; color: #fff; letter-spacing: .02em; }
.site-footer small { display: block; margin-top: .5rem; opacity: .65; font-size: .85rem; }

/* ================================================================ ADMIN */

.admin-body { background: #f4f8f9; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background: radial-gradient(900px 500px at 20% 0%, var(--teal-100), transparent 60%),
                radial-gradient(900px 500px at 90% 100%, var(--sky-100), transparent 60%), #f7fdfd; }
.login-card { width: min(420px, 100%); background: #fff; border-radius: var(--radius-lg);
    padding: 2.4rem; box-shadow: var(--shadow-lg); border: 1px solid var(--teal-100); }
.login-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: .2rem; }
.login-card .sub { text-align: center; color: var(--muted); font-size: .9rem; margin: 0 0 1.6rem; }

.admin-shell { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.sidebar {
    background: #0f2b30; color: #b9d5d5; padding: 1.6rem 1.1rem;
    display: flex; flex-direction: column; gap: 1.4rem;
}
.sidebar .brand { color: #fff; }
.sidebar .brand-text span { color: #6f9ba0; }
.sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar nav a {
    display: flex; align-items: center; gap: .7rem;
    padding: .7rem .9rem; border-radius: 12px;
    color: #b9d5d5; font-size: .95rem; font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: linear-gradient(135deg, var(--teal-500), var(--sky-500)); color: #fff; }
.sidebar .spacer { flex: 1; }
.sidebar .logout { color: #ff9fb0; font-size: .9rem; }

.admin-main { padding: clamp(1.4rem, 3vw, 2.4rem); }
.admin-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-bottom: 1.6rem; }
.admin-head h1 { font-size: 1.6rem; margin: 0; }
.admin-head p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-pad { padding: clamp(1.2rem, 2.5vw, 1.8rem); }
.panel + .panel { margin-top: 1.4rem; }
.panel-title { font-size: 1.05rem; margin-bottom: 1.1rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.3rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.4rem; }
.help { font-size: .82rem; color: var(--muted); margin: .35rem 0 0; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 760px; }
table.data th, table.data td { padding: .85rem 1rem; text-align: left; border-bottom: 1px solid var(--line); }
table.data th { background: #fafdfd; font-weight: 600; color: var(--ink-soft); font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: #fbfeff; }
table.data td.actions { white-space: nowrap; text-align: right; }
.code-chip { font-weight: 700; letter-spacing: .08em; color: var(--teal-700); background: var(--teal-50); padding: .25rem .6rem; border-radius: 8px; }

.badge { display: inline-block; padding: .22rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.active  { background: #ecfdf5; color: #047857; }
.badge.expired { background: #fff1f3; color: #be123c; }
.badge.pending { background: #fffbeb; color: #b45309; }
.badge.off     { background: #f1f5f9; color: #64748b; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm); }
.stat-card span { font-size: .85rem; color: var(--muted); }
.stat-card strong { display: block; font-size: 1.9rem; font-weight: 800; color: var(--teal-600); }

.thumb-preview { width: 110px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.logo-preview { max-height: 70px; width: auto; background: #fff; padding: .5rem 1rem; border: 1px solid var(--line); border-radius: 12px; }

.search-bar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.search-bar input { flex: 1 1 260px; }

.empty { text-align: center; padding: 2.6rem 1rem; color: var(--muted); }

/* --------------------------------------------------------- responsive */

@media (max-width: 980px) {
    .hero-grid, .about-grid { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; gap: .8rem; padding: 1rem; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar .spacer { display: none; }
}

@media (max-width: 720px) {
    .nav { display: none; }
    .nav.open {
        display: flex; flex-direction: column; align-items: flex-start;
        position: absolute; top: 76px; left: 0; right: 0;
        background: #fff; padding: 1.1rem 20px; gap: .9rem;
        border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    }
    .nav-toggle { display: block; }
    .form-grid { grid-template-columns: 1fr; }
    .info-table th { width: 45%; }
}

@media (max-width: 520px) {
    .product-grid { grid-template-columns: 1fr; }
    .info-table th, .info-table td { display: block; width: 100%; padding: .5rem 1.2rem; border: 0; }
    .info-table th { padding-top: 1rem; background: transparent; }
    .info-table td { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
}
