:root {
    --sidebar: #151922;
    --topbar: #202837;
    --ink: #1c2430;
    --muted: #697386;
    --line: #dde3ec;
    --soft: #f4f7fb;
    --panel: #ffffff;
    --green: #2f8f6a;
    --green-dark: #236f52;
    --gold: #d39a36;
    --red: #c94f4f;
    --shadow: 0 18px 50px rgba(24, 31, 42, .09);
    --radius: 8px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: "Roboto", Arial, sans-serif;
    color: var(--ink);
    background: var(--soft);
    letter-spacing: 0;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 252px;
    background: var(--sidebar);
    color: #eaf0f7;
    padding: 18px 14px;
    z-index: 30;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark, .install-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-grid;
    place-items: center;
    background: linear-gradient(135deg, var(--green), #89b66d);
    color: #fff;
    font-weight: 900;
    overflow: hidden;
}
.brand-mark img, .report-logo img { width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font-size: 18px; }
.brand small, .topbar p, .user-chip small, .section-title small { color: #aab5c5; display: block; }
.sidebar nav { display: grid; gap: 6px; margin-top: 18px; }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 8px;
    color: #c8d1de;
}
.sidebar nav a span { width: 24px; text-align: center; font-size: 21px; font-weight: 300; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.shell { margin-left: 252px; min-height: 100vh; padding-bottom: 42px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 74px;
    background: var(--topbar);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 28px;
    box-shadow: 0 8px 30px rgba(10, 14, 22, .12);
}
.topbar h1 { margin: 0; font-size: 23px; line-height: 1.1; }
.topbar p { margin: 5px 0 0; font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.notify-button, .mobile-menu {
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.08);
    color: #fff;
    border-radius: 8px;
    min-width: 44px;
    height: 42px;
    cursor: pointer;
}
.notify-button { position: relative; font-size: 21px; }
.notify-button span {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    border-radius: 99px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px;
    padding: 6px 10px;
}
.user-chip > span {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    background: #fff;
    color: var(--topbar);
    display: grid;
    place-items: center;
    font-weight: 800;
}
.ghost-link { color: #d9e2ee; font-size: 14px; }
.notification-popover {
    display: none;
    position: absolute;
    right: 28px;
    top: 66px;
    width: min(390px, calc(100vw - 30px));
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.notification-popover.open { display: block; }
.notification-item { display: block; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.notification-item strong { display: block; margin-bottom: 4px; }
.notification-item small { color: var(--muted); }
.content { padding: 26px 28px; display: grid; gap: 22px; }
.footer {
    position: fixed;
    left: 252px;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,.93);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    padding: 9px 24px;
    text-align: center;
}
.footer a { color: var(--green-dark); font-weight: 700; }
.flash { padding: 13px 15px; border-radius: 8px; background: #edf7f2; color: var(--green-dark); border: 1px solid #cde8da; }
.flash.danger { background: #fff0f0; color: #9f3333; border-color: #ffd4d4; }
.flash.success { background: #edf7f2; color: var(--green-dark); }
.panel, .instruction-hero, .report-sheet {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}
.instruction-hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef8f4 100%);
    border-color: #cfe7db;
}
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.section-title span { font-size: 18px; font-weight: 800; }
.section-title a { color: var(--green-dark); font-weight: 700; }
.chat-stream { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin-bottom: 14px; }
.chat-line {
    background: rgba(255,255,255,.78);
    border: 1px solid #d9ebe2;
    border-radius: 8px;
    padding: 12px;
}
.chat-line strong { display: block; }
.chat-line small { color: var(--muted); font-size: 12px; }
.chat-line p { margin: 8px 0 0; line-height: 1.45; }
.quick-message { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.metric-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
}
.metric-card span { color: var(--green); font-size: 25px; }
.metric-card small { color: var(--muted); }
.metric-card strong { font-size: 29px; line-height: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.grid-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    align-items: end;
}
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    min-height: 42px;
    padding: 10px 12px;
    outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,143,106,.12); }
.full { grid-column: 1 / -1; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-dark); }
.btn.wide { width: 100%; }
.range-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.range-bar select, .range-bar input { width: auto; min-width: 150px; }
.stack-gap { margin-top: 10px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 650px; background: #fff; }
th, td { padding: 12px 13px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
th { background: #f7f9fc; color: var(--muted); font-weight: 900; }
tr:hover td { background: #fbfdfc; }
.empty { color: var(--muted); padding: 24px; text-align: center; border: 1px dashed var(--line); border-radius: 8px; }
.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.employee-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 18px;
}
.employee-card .avatar {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: #eef8f4;
    display: grid;
    place-items: center;
    color: var(--green-dark);
    font-weight: 900;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.employee-card h3 { margin: 12px 0 2px; font-size: 17px; }
.employee-card small, .employee-card p { color: var(--muted); }
.employee-card a { color: var(--green-dark); font-weight: 800; }
.report-sheet {
    width: min(1120px, 100%);
    margin: 0 auto;
    background: #fff;
}
.report-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 18px;
}
.report-logo {
    width: 74px;
    height: 74px;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 900;
    overflow: hidden;
}
.report-head h2 { margin: 0 0 6px; text-align: right; }
.report-head p { margin: 0; text-align: right; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-body, .install-body {
    min-height: 100vh;
    background: #eef3f7;
    display: grid;
    place-items: center;
}
.login-panel {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.login-form-side { display: grid; place-items: center; padding: 34px; position: relative; background: #fff; }
.login-box { width: min(420px, 100%); }
.login-box h1, .install-card h1 { margin: 18px 0 8px; font-size: 34px; }
.login-box p, .install-card p { color: var(--muted); line-height: 1.55; }
.form-stack { display: grid; gap: 15px; margin-top: 22px; }
.password-field { display: grid; grid-template-columns: 1fr auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.password-field input { border: 0; border-radius: 0; }
.password-field button { border: 0; border-left: 1px solid var(--line); background: #f7f9fc; padding: 0 14px; cursor: pointer; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; min-height: auto; }
.login-image-side {
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 46px;
    color: #fff;
}
.login-image-side::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,22,31,.2), rgba(15,22,31,.78)); }
.login-image-side div { position: relative; max-width: 520px; }
.login-image-side strong { display: block; font-size: 58px; line-height: .95; }
.login-image-side span { display: block; margin-top: 14px; font-size: 18px; line-height: 1.5; }
.login-footer { left: 0; position: absolute; }
.install-card {
    width: min(520px, calc(100vw - 28px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 30px;
}
.install-card small { color: var(--muted); display: block; margin-top: 18px; }
.mobile-menu { display: none; }
@media (max-width: 980px) {
    .sidebar {
        inset: auto 0 0 0;
        width: auto;
        height: 70px;
        padding: 6px;
        display: flex;
        align-items: center;
        overflow-x: auto;
    }
    .brand { display: none; }
    .sidebar nav { display: flex; gap: 4px; margin: 0; width: 100%; justify-content: space-around; }
    .sidebar nav a { min-width: 64px; min-height: 56px; flex-direction: column; gap: 2px; padding: 5px; }
    .sidebar nav a span { font-size: 20px; }
    .sidebar nav a small { font-size: 10px; }
    .shell { margin-left: 0; padding-bottom: 96px; }
    .footer { left: 0; bottom: 70px; }
    .topbar { padding: 0 14px; }
    .user-chip, .ghost-link, .topbar p { display: none; }
    .metric-grid, .two-col, .grid-form, .login-panel { grid-template-columns: 1fr; }
    .quick-message { grid-template-columns: 1fr; }
    .content { padding: 18px 14px; }
    .login-image-side { min-height: 34vh; order: -1; }
}
@media print {
    .sidebar, .topbar, .footer, .panel:not(.report-sheet), .range-bar { display: none !important; }
    .shell, .content { margin: 0; padding: 0; }
    .report-sheet { box-shadow: none; border: 0; width: 100%; }
}
