/* =====================================================================
 * atmos.css — Atmos Dental shared stylesheet
 * Used by every page (1000_1.php, 1100_2.php, ...) for a consistent look.
 * Palette taken from the Atmos Dental postcard: navy + gold + sky blue.
 * ===================================================================== */

:root {
    --navy:        #13294b;
    --navy-2:      #1e3a64;
    --gold:        #c9a35d;
    --gold-soft:   #f3e7cf;
    --sky:         #4a8cc7;
    --sky-soft:    #e6f1fb;
    --mint:        #e9f7f4;
    --ink:         #1c2b3a;
    --muted:       #6b7c8f;
    --line:        #dbe5ef;
    --white:       #ffffff;
    --danger:      #c0392b;
    --danger-bg:   #fff1ef;

    --radius-lg:   28px;
    --radius:      14px;
    --shadow:      0 24px 60px -20px rgba(19, 41, 75, 0.28);
    --shadow-sm:   0 8px 24px -10px rgba(19, 41, 75, 0.25);
    --font:        'Montserrat', 'Noto Sans TC', 'Microsoft JhengHei', 'PingFang TC', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: #eef5fc; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background:
        radial-gradient(900px 500px at 8% -10%, var(--sky-soft) 0%, transparent 60%),
        radial-gradient(700px 500px at 100% 110%, var(--gold-soft) 0%, transparent 55%),
        linear-gradient(180deg, #f7fbff 0%, #eef5fc 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

body > .shell { flex: 1 0 auto; width: 100%; }
body > .topbar { width: 100%; }

/* ---------- Top bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
}

.brand img {
    display: block;
    height: 64px;
    width: auto;
}

.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    color: var(--navy);
}

.location-chip svg { width: 16px; height: 16px; fill: var(--gold); }
.location-chip b   { color: var(--gold); font-weight: 700; }

/* ---------- Page shell ---------- */

.shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px 40px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
    align-items: center;
    min-height: calc(100vh - 220px);
}

.eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--sky);
}

.eyebrow::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 12px;
    border-radius: 2px;
    background: var(--gold);
}

.headline {
    margin: 0 0 12px;
    font-size: clamp(34px, 4.6vw, 56px);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--navy);
}

.headline em {
    font-style: italic;
    background: linear-gradient(90deg, var(--sky), #6fb2e6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subline {
    margin: 0 0 28px;
    font-size: 15px;
    color: var(--muted);
}

/* ---------- Card / form ---------- */

.card {
    position: relative;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    animation: rise 0.7s cubic-bezier(.2, .8, .2, 1) both;
}

.form-group { margin-bottom: 18px; }

label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(74, 140, 199, 0.16);
}

.password-row { display: flex; gap: 8px; }
.password-row input { flex: 1; min-width: 0; }

.toggle-btn {
    flex-shrink: 0;
    padding: 0 18px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--sky-soft);
    color: var(--navy);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.toggle-btn:hover { background: #d6e8f8; }

.btn-primary,
.btn-login {
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, var(--sky) 140%);
    color: var(--white);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform .15s, box-shadow .2s;
}

.btn-primary:hover,
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -12px rgba(19, 41, 75, 0.5);
}

.btn-primary:active,
.btn-login:active { transform: translateY(0); }

.error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--danger-bg);
    border: 1px solid #f3c4bd;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    animation: shake .4s;
}

.card-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
    font-size: 12px;
    color: var(--muted);
}

.card-note svg { width: 18px; height: 18px; fill: var(--gold); flex-shrink: 0; }

/* ---------- Smile visual ---------- */

.visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 560px;
    justify-self: center;
    width: 100%;
}

.visual .blob {
    position: absolute;
    inset: 0;
    border-radius: 58% 42% 46% 54% / 48% 56% 44% 52%;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: morph 14s ease-in-out infinite;
}

.visual .blob img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% 40%;
}

.visual .ring {
    position: absolute;
    inset: -18px;
    border: 2px solid var(--gold);
    border-radius: 50% 46% 52% 48% / 46% 54% 46% 54%;
    opacity: .45;
    animation: morph 18s ease-in-out infinite reverse;
    pointer-events: none;
}

.float-badge {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    animation: bob 5s ease-in-out infinite;
}

.float-badge .ico {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--gold-soft);
}

.float-badge .ico svg { width: 20px; height: 20px; fill: var(--gold); }
.float-badge small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }

.badge-a { left: -24px; bottom: 16%; }
.badge-b { right: -10px; top: 10%; animation-delay: -2.5s; }
.badge-b .ico { background: var(--sky-soft); }
.badge-b .ico svg { fill: var(--sky); }

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
    background: var(--navy);
    color: #c9d6e6;
    font-size: 12px;
    position: relative;
    overflow: hidden;
}

.site-footer::after {
    content: "";
    position: absolute;
    right: -60px;
    top: 0;
    width: 280px;
    height: 100%;
    background: linear-gradient(160deg, transparent 45%, var(--gold) 46%, var(--gold) 60%, var(--sky) 61%);
    opacity: .55;
    pointer-events: none;
}

.site-footer .inner {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.site-footer b { color: var(--gold); letter-spacing: .14em; font-weight: 700; }
.site-footer a { color: #ffffff; text-decoration: none; }

/* ---------- Intro (clinic scene + music) ---------- */

.intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #0d1d35;
    overflow: hidden;
    transition: opacity .9s ease, visibility .9s;
}

.intro.is-done { opacity: 0; visibility: hidden; }

.intro .scene {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.intro .scene.is-on { opacity: 1; }

.intro .scene-clinic { animation: kenburns 8s ease-out forwards; }
.intro .scene-smile  { background-position: 60% 35%; }
.intro .scene-smile.is-on { animation: kenburns-in 5s ease-out forwards; }

.intro .veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 29, 53, .15) 0%, rgba(13, 29, 53, .65) 100%);
}

.intro .caption {
    position: absolute;
    left: 0; right: 0;
    bottom: 12%;
    text-align: center;
    color: #fff;
    padding: 0 24px;
}

.intro .caption .line {
    display: block;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .9s ease, transform .9s ease;
}

.intro .caption .line.is-on { opacity: 1; transform: none; }

.intro .caption .big {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.intro .caption .small {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .3em;
    color: var(--gold);
}

.intro .controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.intro .controls button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.intro .controls button:hover { background: rgba(255, 255, 255, .26); }

.intro .progress {
    position: absolute;
    left: 0; bottom: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--gold), var(--sky));
}

/* ---------- Animations ---------- */

@keyframes rise   { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes bob    { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shake  { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes morph  {
    0%, 100% { border-radius: 58% 42% 46% 54% / 48% 56% 44% 52%; }
    50%      { border-radius: 44% 56% 54% 46% / 56% 44% 56% 44%; }
}
@keyframes kenburns    { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1%, -1%); } }
@keyframes kenburns-in { from { transform: scale(1.18); } to { transform: scale(1.04); } }

/* ---------- MIS: app bar + dropdown menus ---------- */

.appbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.appbar .inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.appbar .brand img { height: 52px; }

.menu {
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu > li { position: relative; }

.menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--navy);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}

.menu-btn:hover,
.menu-btn[aria-expanded="true"] { background: var(--sky-soft); }

.menu-btn .caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
}

.menu-btn[aria-expanded="true"] .caret { transform: rotate(-135deg) translateY(-2px); }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s, visibility .18s;
}

.dropdown.is-open { opacity: 1; visibility: visible; transform: none; }

.dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.dropdown a:hover,
.dropdown a:focus-visible { background: var(--sky-soft); color: var(--navy); outline: none; }

.tag-dev {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: #9a7431;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
}

.user-chip {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

.user-chip .avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--sky));
    color: var(--white);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-chip small { color: var(--muted); font-weight: 500; }

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--navy);
    border-radius: 2px;
    position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after { content: ""; position: absolute; left: 0; }
.menu-toggle span::before { top: -6px; }
.menu-toggle span::after  { top: 6px; }

/* ---------- MIS: dashboard ---------- */

.dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 28px;
}

.dash-head .headline { font-size: clamp(28px, 3.6vw, 44px); margin-bottom: 6px; }
.dash-head .subline  { margin: 0; }

.today-chip {
    padding: 10px 16px;
    border-radius: 14px;
    background: var(--white);
    border: 1px solid var(--line);
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
}

.groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.group {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.group h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--navy);
}

.group h2 .ico {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--sky-soft);
}

.group h2 .ico svg { width: 22px; height: 22px; fill: var(--sky); }
.group.g-report h2 .ico { background: var(--gold-soft); }
.group.g-report h2 .ico svg { fill: var(--gold); }
.group.g-create h2 .ico { background: var(--mint); }
.group.g-create h2 .ico svg { fill: #2f9e8a; }

.group ul { list-style: none; margin: 0; padding: 0; }

.group a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 6px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s, transform .15s, box-shadow .2s;
}

.group a:hover {
    border-color: var(--sky);
    transform: translateX(3px);
    box-shadow: 0 6px 16px -10px rgba(19, 41, 75, 0.4);
}

.group a .arrow { color: var(--gold); font-weight: 700; }

/* ---------- Toast (e.g. "System in developing...") ---------- */

.toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100% - 32px);
    padding: 14px 20px;
    border-radius: 16px;
    background: var(--navy);
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow);
    transform: translate(-50%, 20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, transform .25s, visibility .25s;
}

.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.toast .ico {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--navy);
    font-weight: 800;
    flex-shrink: 0;
}

/* ---------- MIS: module pages (1100_2.php and later) ---------- */

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 28px 0 20px;
}

.page-head .headline { font-size: clamp(26px, 3.2vw, 38px); margin-bottom: 6px; }
.page-head .subline  { margin: 0; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.back-link:hover { border-color: var(--sky); }

.tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    margin-bottom: 24px;
    border-radius: 999px;
    background: var(--white);
    border: 1px solid var(--line);
}

.tabs a {
    padding: 10px 20px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}

.tabs a:hover  { background: var(--sky-soft); color: var(--navy); }
.tabs a.active { background: var(--navy); color: var(--white); }

.card.static { animation: none; }
.card h2 { margin: 0 0 6px; font-size: 18px; color: var(--navy); }
.card-description { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.message {
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
}

.message.success { background: #eaf8f1; color: #1b7a4b; border: 1px solid #bfe6d1; }
.message.error   { background: var(--danger-bg); color: var(--danger); border: 1px solid #f3c4bd; }

.reminder {
    display: none;
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: #fff8e8;
    color: #8a6100;
    border: 1px solid var(--gold-soft);
    border-left: 4px solid var(--gold);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.dashboard {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}

select,
input[type="date"] {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}

select:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(74, 140, 199, 0.16);
}

input[readonly] {
    background: #f3f7fb;
    color: var(--muted);
    cursor: not-allowed;
}

.datetime { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.note-counter { margin-top: 6px; text-align: right; font-size: 12px; color: var(--muted); }

.status-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--navy); }

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    border-radius: var(--radius);
    background: #eaf8f1;
    border: 1.5px solid #bfe6d1;
    color: #1b7a4b;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .08em;
    transition: opacity .2s;
}

.status.out { background: #fff5e6; border-color: #f4d7a6; color: #b56a00; }

.sign-button {
    width: 100%;
    min-height: 68px;
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #2bb673 0%, #1b8f57 100%);
    color: var(--white);
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: .1em;
    cursor: pointer;
    box-shadow: 0 14px 28px -14px rgba(27, 143, 87, 0.7);
    transition: transform .15s, box-shadow .2s;
}

.sign-button:hover  { transform: translateY(-2px); }
.sign-button:disabled { opacity: .6; cursor: wait; transform: none; }

.count {
    float: right;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--sky-soft);
    color: var(--sky);
    font-size: 13px;
}

.staff-list { list-style: none; margin: 12px 0 0; padding: 0; }

.staff-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--line);
}

.staff-item:last-child { border-bottom: none; }

.staff-check {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #eaf8f1;
    color: #1b8f57;
    font-weight: 700;
    flex-shrink: 0;
}

.staff-name { flex: 1; font-weight: 600; color: var(--navy); }
.staff-time { font-size: 13px; color: var(--muted); }

.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.empty .big-check { font-size: 32px; margin-bottom: 10px; color: var(--gold); }

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 14px;
    align-items: end;
}

.filter-grid .form-group { margin-bottom: 0; }

.filter-button {
    height: 52px;
    padding: 0 26px;
    border: none;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.filter-button:hover { background: var(--navy-2); }

.clear-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: var(--white);
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.clear-button:hover { border-color: var(--sky); }

.result-count { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.result-count b { color: var(--navy); }

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.data-table { width: 100%; min-width: 680px; border-collapse: collapse; }

.data-table th {
    padding: 14px 16px;
    background: var(--navy);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.data-table tbody tr:nth-child(even) { background: #f8fbfe; }
.data-table tbody tr:hover { background: var(--sky-soft); }
.data-table tbody tr:last-child td { border-bottom: none; }

.badge {
    display: inline-block;
    min-width: 56px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.badge-in  { background: #eaf8f1; color: #1b8f57; }
.badge-out { background: #fff5e6; color: #b56a00; }

.note-cell { max-width: 300px; word-break: break-word; color: var(--muted); }

.stack-gap { height: 24px; }

/* ---------- Access denied page ---------- */

.denied-wrap {
    flex: 1 0 auto;
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.denied-box {
    max-width: 460px;
    padding: 40px 36px;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow);
    text-align: center;
}

.denied-box .lock {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--danger-bg);
}

.denied-box .lock svg { width: 30px; height: 30px; fill: var(--danger); }
.denied-box h1 { margin: 0 0 10px; font-size: 22px; color: var(--navy); }
.denied-box p  { margin: 0 0 26px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.denied-box .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.denied-box .btn-primary { width: auto; height: 48px; margin: 0; padding: 0 24px; display: inline-flex; align-items: center; text-decoration: none; font-size: 13px; }

/* Text inputs used with a date picker (flatpickr) */
input.datepicker {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}

input.datepicker:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(74, 140, 199, 0.16);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover { background: var(--navy); border-color: var(--navy); }
.flatpickr-day.today { border-color: var(--gold); }

.filter-grid.cols-3 { grid-template-columns: 1.2fr 1fr 1fr auto; }

.back-button {
    display: inline-flex;
    align-items: center;
    height: 48px;
    margin-top: 18px;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--navy);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.back-button:hover { background: var(--navy-2); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; gap: 32px; min-height: 0; }
    .visual { order: -1; max-width: 360px; }
    .badge-a { left: -8px; }
    .badge-b { right: -8px; }
    .location-chip { display: none; }
}

@media (max-width: 1000px) {
    .groups { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
    .dashboard, .datetime, .filter-grid, .filter-grid.cols-3 { grid-template-columns: 1fr; }
    .appbar .inner { flex-wrap: wrap; gap: 10px; }
    .menu-toggle { display: block; }
    .user-chip { display: none; }
    .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-bottom: 8px;
    }
    .menu.is-open { display: flex; }
    .menu-btn { width: 100%; justify-content: space-between; }
    .dropdown {
        position: static;
        display: none;
        min-width: 0;
        margin: 4px 0 8px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .dropdown.is-open { display: block; }
    .groups { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .brand img { height: 48px; }
    .card { padding: 26px 20px; }
    .float-badge { font-size: 12px; padding: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
 * Record maintenance pages (1300_1.php, 1300_2.php, ...)
 * ===================================================================== */

.dropdown a.is-current { background: var(--sky-soft); color: var(--navy); font-weight: 700; }

.crud-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.search-form { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 360px; }
.search-form input[type="text"] { flex: 1 1 200px; width: auto; }

.btn-primary.btn-inline,
.btn-login.btn-inline {
    width: auto;
    height: 52px;
    margin: 0;
    padding: 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    letter-spacing: .06em;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.field-grid .span-2 { grid-column: 1 / -1; }

textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    resize: vertical;
}

textarea:focus,
input[type="number"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 4px rgba(74, 140, 199, 0.16);
}

input[type="number"],
input[type="time"],
input[type="datetime-local"] {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    font: inherit;
    font-size: 16px;
    color: var(--ink);
}

.key-tag {
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: #9a7431;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    vertical-align: middle;
}

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.form-card { border: 2px solid var(--sky-soft); }

.sort-link { color: inherit; text-decoration: none; white-space: nowrap; }
.sort-link:hover { text-decoration: underline; }

.data-table .col-actions { width: 1%; white-space: nowrap; text-align: right; }

.row-actions { display: inline-flex; gap: 6px; }
.row-actions form { margin: 0; }

.btn-sm {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--white);
    color: var(--navy);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-sm:hover { border-color: var(--sky); background: var(--sky-soft); }

.btn-sm.btn-danger { color: var(--danger); }
.btn-sm.btn-danger:hover { border-color: var(--danger); background: var(--danger-bg); }

.null-cell { color: #b3c0cc; }

.data-table tbody tr.is-editing { background: #fff8e8; box-shadow: inset 4px 0 0 var(--gold); }

@media (max-width: 820px) {
    .field-grid { grid-template-columns: 1fr; }
    .crud-toolbar .btn-inline { width: 100%; }
}

/* Keep the form title visible below the sticky top bar when jumping to it */
.form-card { scroll-margin-top: 96px; }

/* Read-only fields (e.g. primary key while editing) look locked */
input[type][readonly],
textarea[readonly] {
    background: #f3f7fb;
    color: var(--muted);
    cursor: not-allowed;
}

/* Code shown after a linked name, e.g. "Gloves  1" */
.fk-code {
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--sky-soft);
    color: var(--sky);
    font-size: 11px;
    font-weight: 600;
}

/* Table column titles: always white on the dark header, links included */
.data-table th,
.data-table th a,
.data-table th a:link,
.data-table th a:visited,
.data-table th a:hover,
.data-table th a:active {
    color: #ffffff !important;
}

/* =====================================================================
 * Purchasing (1100_4.php)
 * ===================================================================== */

.head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.unit-hint { color: var(--muted); font-weight: 500; }

.total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 18px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--sky-soft);
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
}

.total-bar strong { font-size: 22px; font-weight: 800; }

/* Four filters side by side + Browse button */
.browse-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 0.8fr 0.8fr auto;
    gap: 14px;
    align-items: end;
}

.browse-grid .form-group { margin-bottom: 0; }

/* Scrolling results window; column titles stay visible while scrolling */
.scroll-panel {
    max-height: 56vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
}

.scroll-panel:focus { outline: 2px solid var(--sky); outline-offset: 2px; }

.scroll-panel .data-table { min-width: 860px; }

.scroll-panel .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}

.scroll-panel .data-table tfoot td {
    position: sticky;
    bottom: 0;
    background: var(--gold-soft);
    color: var(--navy);
    font-weight: 700;
    border-top: 2px solid var(--gold);
}

.data-table .num { text-align: right; white-space: nowrap; }

.continue-row { display: flex; justify-content: center; margin-top: 24px; }

@media (max-width: 900px) {
    .browse-grid { grid-template-columns: 1fr 1fr; }
    .browse-grid .filter-button { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
    .browse-grid { grid-template-columns: 1fr; }
}

.error-detail { margin-top: 8px; font-weight: 500; font-size: 13px; line-height: 1.5; word-break: break-word; }
