:root {
    --primary: #2454d3;
    --primary-700: #173c9f;
    --primary-50: #eef4ff;
    --ink: #172033;
    --muted: #667085;
    --line: #dfe5ee;
    --surface: #ffffff;
    --canvas: #f5f7fb;
    --success: #137a4d;
    --success-bg: #eafaf1;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --warning: #9a5b00;
    --warning-bg: #fff7e6;
    --info: #175cd3;
    --info-bg: #eff8ff;
    --radius: 16px;
    --shadow: 0 14px 36px rgba(20, 35, 70, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: var(--primary); }
img, svg { max-width: 100%; }

.container { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.page { min-height: calc(100vh - 142px); padding: 34px 0 54px; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(223, 229, 238, .94);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
}
.navbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg, var(--primary), #4775ed); color: #fff; box-shadow: 0 9px 20px rgba(36, 84, 211, .25); }
.brand-mark svg { width: 23px; height: 23px; }
.brand-text { min-width: 0; }
.brand-title { display: block; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 310px; }
.brand-subtitle { display: block; font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.nav-menu { display: flex; align-items: center; gap: 5px; }
.nav-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border-radius: 10px; color: #344054; text-decoration: none; font-size: 14px; font-weight: 700; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--primary-50); color: var(--primary); }
.nav-link.login { margin-left: 4px; background: var(--primary); color: #fff; }
.nav-link.login:hover { background: var(--primary-700); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 7px; padding-left: 12px; border-left: 1px solid var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e9efff; color: var(--primary); font-weight: 800; }
.nav-user-copy { line-height: 1.25; max-width: 140px; }
.nav-user-name { display: block; font-size: 13px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-role { display: block; font-size: 11px; color: var(--muted); text-transform: capitalize; }
.nav-toggle { display: none; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 19px; height: 2px; margin: 4px auto; background: var(--ink); border-radius: 2px; }

.hero { position: relative; overflow: hidden; border: 1px solid #dce5f7; border-radius: 24px; padding: 42px; background: linear-gradient(135deg, #fff 0%, #f0f5ff 52%, #edf9f4 100%); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -95px; border-radius: 50%; background: rgba(36, 84, 211, .08); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 36px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: var(--primary); font-size: 13px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { max-width: 730px; margin: 0; font-size: clamp(31px, 5vw, 50px); line-height: 1.08; letter-spacing: -.035em; }
.hero p { max-width: 700px; margin: 18px 0 0; color: #475467; font-size: 17px; }
.hero-panel { padding: 22px; border: 1px solid rgba(255,255,255,.85); border-radius: 20px; background: rgba(255,255,255,.78); box-shadow: 0 18px 40px rgba(31,55,110,.10); }
.hero-panel-title { margin: 0 0 14px; font-size: 15px; }
.trust-list { display: grid; gap: 12px; }
.trust-item { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start; }
.trust-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-weight: 900; }
.trust-item strong { display: block; font-size: 13px; }
.trust-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

.search-card { position: relative; z-index: 2; margin: -1px auto 0; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.search-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: end; }
.field label { display: block; margin-bottom: 7px; color: #344054; font-size: 13px; font-weight: 800; }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #cfd7e5; border-radius: 11px; background: #fff; color: var(--ink); outline: none; transition: border-color .18s, box-shadow .18s; }
.textarea { min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(36,84,211,.11); }
.input::placeholder { color: #98a2b3; }
.help { margin-top: 6px; color: var(--muted); font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 780; font-size: 14px; cursor: pointer; transition: transform .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-secondary { border-color: #cfd7e5; background: #fff; color: #344054; }
.btn-secondary:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; }
.btn-soft { background: var(--primary-50); color: var(--primary); }
.btn-small { min-height: 36px; padding: 7px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h1, .section-heading h2 { margin: 0; letter-spacing: -.02em; }
.section-heading h1 { font-size: 30px; }
.section-heading h2 { font-size: 24px; }
.section-heading p { margin: 5px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 17px; }
.card-body { padding: 22px; }
.card-footer { padding: 16px 22px; border-top: 1px solid var(--line); background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 16px; }

.stat { padding: 20px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.stat-value { margin-top: 6px; font-size: 28px; line-height: 1.1; font-weight: 850; letter-spacing: -.02em; }
.stat-meta { margin-top: 8px; color: var(--muted); font-size: 12px; }

.alert { margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 11px; font-size: 14px; }
.alert-success { color: var(--success); background: var(--success-bg); border-color: #a8e4c2; }
.alert-danger { color: var(--danger); background: var(--danger-bg); border-color: #f2b8b3; }
.alert-warning { color: var(--warning); background: var(--warning-bg); border-color: #f0d39a; }
.alert-info { color: var(--info); background: var(--info-bg); border-color: #b7d8ff; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.2; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); background: var(--success-bg); }
.badge-danger { color: var(--danger); background: var(--danger-bg); }
.badge-warning { color: var(--warning); background: var(--warning-bg); }
.badge-info { color: var(--info); background: var(--info-bg); }
.badge-neutral { color: #475467; background: #f2f4f7; }

.result-banner { display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 24px; border: 1px solid #a8e4c2; border-radius: 18px; background: linear-gradient(135deg,#effcf5,#fff); box-shadow: var(--shadow); }
.result-banner.invalid { border-color: #f2b8b3; background: linear-gradient(135deg,#fff2f1,#fff); }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--success); font-size: 29px; font-weight: 900; }
.result-banner.invalid .result-icon { background: var(--danger); }
.result-banner h2 { margin: 0; font-size: 23px; }
.result-banner p { margin: 5px 0 0; color: var(--muted); }

.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; }
.detail-item { min-width: 0; padding: 14px 0; border-bottom: 1px solid #edf0f5; }
.detail-item:nth-child(odd) { padding-right: 24px; }
.detail-item:nth-child(even) { padding-left: 24px; border-left: 1px solid #edf0f5; }
.detail-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.detail-value { display: block; word-break: break-word; font-size: 14px; font-weight: 650; }
.code { display: inline-block; max-width: 100%; padding: 4px 7px; border-radius: 6px; background: #f2f4f7; color: #344054; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }

.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 13px 16px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: top; font-size: 13px; }
th { color: #475467; background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .045em; white-space: nowrap; }
tbody tr:hover { background: #fbfcff; }
tbody tr:last-child td { border-bottom: 0; }
.table-title { display: block; color: var(--ink); font-weight: 800; text-decoration: none; }
.table-title:hover { color: var(--primary); }
.table-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.filter-bar { display: grid; grid-template-columns: minmax(220px,1fr) 190px auto; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.page-link { min-width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #344054; text-decoration: none; font-size: 13px; font-weight: 750; }
.page-link.active, .page-link:hover { border-color: var(--primary); background: var(--primary); color: #fff; }

.empty { padding: 44px 22px; text-align: center; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 13px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 24px; }
.empty h3 { margin: 0; }
.empty p { margin: 6px auto 0; max-width: 520px; color: var(--muted); }

.auth-shell { width: min(480px, 100%); margin: 20px auto; }
.auth-card { overflow: hidden; }
.auth-head { padding: 30px 28px 18px; text-align: center; }
.auth-icon { width: 60px; height: 60px; margin: 0 auto 15px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 26px; }
.auth-head h1 { margin: 0; font-size: 27px; }
.auth-head p { margin: 7px 0 0; color: var(--muted); }
.auth-body { padding: 12px 28px 30px; }

.upload-box { position: relative; padding: 30px; border: 2px dashed #b9c5da; border-radius: 15px; background: #fafcff; text-align: center; transition: border-color .2s, background .2s; }
.upload-box.dragover { border-color: var(--primary); background: var(--primary-50); }
.upload-box input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 15px; display: grid; place-items: center; background: #eaf0ff; color: var(--primary); font-size: 22px; }
.upload-box strong { display: block; }
.upload-box span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.file-selected { margin-top: 10px; color: var(--primary); font-size: 13px; font-weight: 750; word-break: break-word; }

.checkbox-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.check-card { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.check-card input { margin-top: 3px; }
.check-card strong { display: block; font-size: 13px; }
.check-card span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.inline-form { display: inline; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }

.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 1000; display: none; place-items: center; padding: 20px; background: rgba(16,24,40,.55); }
.modal-backdrop.open { display: grid; }
.modal { width: min(460px,100%); border-radius: 16px; background: #fff; box-shadow: 0 24px 80px rgba(0,0,0,.22); overflow: hidden; }
.modal-head { padding: 20px 22px 10px; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 8px 22px 18px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fafbfc; }

@media (max-width: 980px) {
    .nav-toggle { display: block; }
    .nav-menu { position: absolute; left: 16px; right: 16px; top: 64px; display: none; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
    .nav-menu.open { display: grid; }
    .nav-link { justify-content: flex-start; }
    .nav-user { margin: 5px 0 0; padding: 11px 8px 3px; border-left: 0; border-top: 1px solid var(--line); }
    .hero-grid { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
    .container { width: min(100% - 22px, 1180px); }
    .page { padding: 22px 0 40px; }
    .brand-title { max-width: 190px; }
    .brand-subtitle { display: none; }
    .hero { padding: 28px 22px; border-radius: 18px; }
    .hero-panel { padding: 17px; }
    .search-form, .filter-bar, .grid-2, .grid-3, .grid-4, .form-grid, .detail-list, .checkbox-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .search-form .btn { width: 100%; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .section-heading h1 { font-size: 25px; }
    .result-banner { grid-template-columns: 52px 1fr; padding: 19px; }
    .result-icon { width: 52px; height: 52px; font-size: 23px; }
    .result-banner .actions { grid-column: 1/-1; }
    .detail-item, .detail-item:nth-child(odd), .detail-item:nth-child(even) { padding: 13px 0; border-left: 0; }
    .card-head, .card-body { padding: 18px; }
    .footer-inner { padding: 15px 0; align-items: flex-start; flex-direction: column; justify-content: center; }
}
