:root {
    --navy: #112b46;
    --navy-2: #173a5e;
    --emerald: #00a47a;
    --emerald-dark: #008564;
    --ink: #182331;
    --muted: #69798a;
    --line: #dfe6ec;
    --soft: #f4f7f9;
    --white: #ffffff;
    --danger: #c94343;
    --shadow: 0 18px 50px rgba(17, 43, 70, .10);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--soft); font-size: 16px; line-height: 1.5; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.eyebrow { margin: 0 0 .35rem; color: var(--emerald-dark); font-size: .76rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.muted { color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px 4px 16px 4px; color: #fff; background: var(--emerald); font-size: 1.75rem; font-weight: 900; box-shadow: 0 12px 30px rgba(0,164,122,.3); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px 3px 11px 3px; font-size: 1.15rem; }
.login-body { min-height: 100vh; padding: 2rem; display: grid; place-items: center; background: radial-gradient(circle at 85% 15%, rgba(0,164,122,.10), transparent 30%), #eef3f6; }
.login-shell { width: min(1050px, 100%); min-height: 620px; display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden; border-radius: 28px; background: #fff; box-shadow: var(--shadow); }
.login-brand { padding: 4.5rem; color: #fff; background: linear-gradient(145deg, rgba(17,43,70,.96), rgba(14,52,77,.94)), radial-gradient(circle, #00a47a, transparent); display: flex; flex-direction: column; justify-content: center; }
.login-brand .eyebrow { margin-top: 2.5rem; color: #70e6c5; }
.login-brand h1 { max-width: 520px; margin: .25rem 0 1rem; font-size: clamp(2.5rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -.045em; }
.login-brand > p:not(.eyebrow) { max-width: 470px; color: #c9d7e2; font-size: 1.05rem; }
.brand-stat { margin-top: 3rem; display: flex; align-items: center; gap: 1.1rem; }
.brand-stat strong { padding: .65rem .8rem; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; color: #80efd0; }
.brand-stat span { color: #c9d7e2; font-size: .92rem; }
.login-card { padding: 4.5rem 4rem; align-self: center; }
.login-card h2 { margin: .25rem 0 .25rem; font-size: 2rem; letter-spacing: -.03em; }
.login-card > .muted { margin-top: 0; }
.mobile-logo { display: none; }
.form-stack { display: grid; gap: 1.15rem; margin-top: 2rem; }
label { display: grid; gap: .45rem; font-size: .9rem; font-weight: 700; }
input[type="text"], input[type="password"], input[type="search"] { width: 100%; min-height: 48px; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); background: #fff; transition: .2s; }
input:focus { border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(0,164,122,.12); }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 4.5rem; }
.password-toggle { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--emerald-dark); font-size: .82rem; font-weight: 800; cursor: pointer; }
.btn { min-height: 44px; padding: .7rem 1.05rem; border: 0; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 800; cursor: pointer; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #fff; background: var(--emerald); box-shadow: 0 8px 20px rgba(0,164,122,.18); }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-secondary { border: 1px solid var(--line); background: #fff; color: var(--navy); }
.btn-block { width: 100%; }
.btn-small { min-height: 36px; padding: .45rem .75rem; font-size: .78rem; }
.login-note { margin-top: 1.5rem; color: var(--muted); font-size: .82rem; text-align: center; }
code { padding: .1rem .35rem; border-radius: 4px; background: #edf2f4; }
.alert { margin: 1rem 0; padding: .85rem 1rem; border-radius: 10px; font-weight: 650; }
.alert-error { color: #8b2828; border: 1px solid #f1c2c2; background: #fff0f0; }
.alert-success { color: #096149; border: 1px solid #a7e0d0; background: #edfbf6; }
.dashboard-body { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; padding: 1.6rem 1.2rem; color: #fff; background: var(--navy); display: flex; flex-direction: column; z-index: 10; }
.sidebar-brand { display: flex; align-items: center; gap: .85rem; padding: 0 .35rem; font-size: 1.08rem; font-weight: 850; }
.sidebar-brand > span:last-child span { color: #65dfbd; }
.sidebar nav { display: grid; gap: .35rem; margin-top: 3rem; }
.nav-item { padding: .75rem .85rem; border-radius: 9px; display: flex; gap: .8rem; align-items: center; color: #b9c9d8; font-size: .9rem; font-weight: 650; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { box-shadow: inset 3px 0 var(--emerald); }
.sidebar-user { margin-top: auto; padding: 1rem .55rem 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: .7rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); background: #80efd0; font-weight: 900; }
.sidebar-user strong, .sidebar-user small { display: block; }
.sidebar-user strong { font-size: .85rem; }
.sidebar-user small { color: #94aabd; font-size: .7rem; }
.main-content { margin-left: 248px; padding: 2rem 2.25rem 4rem; max-width: 1700px; }
.topbar { margin-bottom: 1.6rem; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -.035em; }
.date-pill, .file-badge, .active-label { padding: .45rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: .78rem; font-weight: 750; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.summary-card { min-height: 130px; padding: 1.25rem; border: 1px solid var(--line); border-radius: 15px; background: #fff; display: flex; align-items: center; gap: 1rem; box-shadow: 0 8px 30px rgba(17,43,70,.04); }
.summary-card.accent { color: #fff; border-color: var(--navy); background: var(--navy); }
.summary-card .card-icon { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; color: var(--emerald-dark); background: #e8f8f3; font-size: 1.25rem; }
.summary-card small, .summary-card strong, .summary-card p { display: block; margin: 0; }
.summary-card small { color: var(--muted); font-size: .76rem; font-weight: 750; }
.summary-card.accent small, .summary-card.accent p { color: #a9becf; }
.summary-card strong { margin-top: .15rem; font-size: 2rem; line-height: 1.05; }
.summary-card p { color: var(--muted); font-size: .75rem; }
.panel { margin-top: 1rem; padding: 1.35rem; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: 0 8px 30px rgba(17,43,70,.04); }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.panel-heading h2 { margin: 0; color: var(--navy); font-size: 1.25rem; letter-spacing: -.02em; }
.panel-heading p:not(.eyebrow) { margin: .25rem 0 0; color: var(--muted); font-size: .84rem; }
.upload-form { margin-top: 1.1rem; display: grid; grid-template-columns: 1fr auto; gap: .8rem; align-items: stretch; }
.dropzone { min-height: 105px; padding: 1rem 1.25rem; border: 1.5px dashed #9cb0c0; border-radius: 12px; display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: .85rem; cursor: pointer; background: #f8fafb; }
.dropzone:hover { border-color: var(--emerald); background: #f3fbf8; }
.dropzone input { display: none; }
.upload-icon { grid-row: 1 / 3; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--emerald); font-size: 1.2rem; }
.dropzone strong { color: var(--navy); font-size: .92rem; }
.dropzone > span:last-of-type { color: var(--muted); font-size: .75rem; font-weight: 500; }
.edit-panel { border-top: 3px solid var(--emerald); }
.edit-grid { margin-top: 1.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.edit-actions { grid-column: 1 / -1; }
.search-input { max-width: 260px; min-height: 40px !important; }
.table-wrap { margin: 1rem -1.35rem 0; overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: .84rem; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid #e9eef2; text-align: left; vertical-align: middle; white-space: nowrap; }
th { position: sticky; top: 0; color: #526477; background: #f7f9fa; font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; }
tbody tr:hover { background: #f8fbfa; }
.actions-cell { display: flex; align-items: center; gap: .4rem; }
.actions-cell form { margin: 0; }
.icon-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; display: grid; place-items: center; cursor: pointer; font-size: 1rem; }
.icon-btn.edit { color: #075a88; background: #e7f5fd; }
.icon-btn.delete { color: var(--danger); background: #ffeded; }
.table-count { margin: .8rem 0 0; color: var(--muted); font-size: .76rem; }
.empty-state { padding: 3.5rem 1rem; text-align: center; color: var(--muted); }
.empty-state > span { width: 56px; height: 56px; margin: 0 auto 1rem; border-radius: 14px; display: grid; place-items: center; color: var(--emerald-dark); background: #e8f8f3; font-size: 1.5rem; }
.empty-state h3 { margin: 0; color: var(--navy); }
.empty-state p { margin: .35rem 0; }
.history-list { margin-top: 1rem; display: grid; gap: .6rem; }
.history-item { padding: .8rem; border: 1px solid var(--line); border-radius: 10px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: .75rem; }
.history-item.current { border-color: #9adbc8; background: #f0fbf7; }
.history-file { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--emerald); font-weight: 900; }
.history-item strong, .history-item small { display: block; }
.history-item strong { font-size: .86rem; }
.history-item small { color: var(--muted); font-size: .73rem; }
.active-label { color: #087056; border-color: #a7dfcf; background: #e7f8f2; }
@media (max-width: 920px) {
    .login-shell { grid-template-columns: 1fr; min-height: auto; }
    .login-brand { display: none; }
    .login-card { padding: 3rem 2rem; }
    .mobile-logo { margin-bottom: 3rem; display: flex; align-items: center; gap: .7rem; color: var(--navy); font-weight: 850; }
    .sidebar { position: static; width: 100%; min-height: auto; flex-direction: row; align-items: center; justify-content: space-between; }
    .sidebar nav { margin: 0; display: flex; }
    .sidebar-user { margin: 0; padding: 0; border: 0; }
    .sidebar-user > div:not(.avatar) { display: none; }
    .main-content { margin-left: 0; padding: 1.5rem; }
    .edit-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 650px) {
    .login-body { padding: 0; }
    .login-shell { min-height: 100vh; border-radius: 0; }
    .login-card { padding: 2rem 1.35rem; }
    .sidebar { padding: .9rem 1rem; }
    .sidebar nav { display: none; }
    .main-content { padding: 1.1rem .85rem 3rem; }
    .date-pill { display: none; }
    .summary-grid { grid-template-columns: 1fr; }
    .summary-card { min-height: 100px; }
    .panel-heading { display: grid; }
    .file-badge { width: max-content; }
    .upload-form { grid-template-columns: 1fr; }
    .edit-grid { grid-template-columns: 1fr; }
    .history-item { grid-template-columns: 38px 1fr; }
    .history-item > form, .history-item > .active-label { grid-column: 2; width: max-content; }
}

