:root {
    --navy: #102042;
    --navy-soft: #1a3160;
    --gold: #d5aa73;
    --gold-deep: #c49658;
    --ivory: #f6f3ee;
    --card: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #e7e1d6;
    --shadow: 0 24px 60px rgba(16, 32, 66, 0.16);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Manrope, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--ivory);
}

button, input { font: inherit; }

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(213, 170, 115, 0.28), transparent 28%),
        var(--navy);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.auth-panel {
    color: white;
    padding: 64px 72px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-logo {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}

.auth-kicker {
    margin: 22px 0 0;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--gold);
}

.auth-panel h1 {
    margin: 10px 0 0;
    font-size: 48px;
    line-height: 1.05;
    max-width: 520px;
}

.auth-lead, .auth-card-copy {
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.6;
    max-width: 460px;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 28px 0 0;
}

.auth-points li {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
}

.auth-points i { color: var(--gold); }

.auth-card {
    margin: auto 48px auto 0;
    width: min(440px, calc(100% - 48px));
    background: var(--card);
    border-radius: 28px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.auth-card h2 { margin: 0; font-size: 32px; }
.auth-card-copy { color: var(--muted); margin-top: 8px; }

label {
    display: block;
    margin: 18px 0 8px;
    font-weight: 700;
    font-size: 14px;
}

input[type="text"], input[type="password"] {
    width: 100%;
    border: 1px solid var(--line);
    background: #fcfbf9;
    border-radius: 14px;
    padding: 14px 16px;
    outline: none;
}

input:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(213, 170, 115, 0.25); }

.password-field { position: relative; }
.password-field input { padding-right: 48px; }

.eye-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--navy);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
}

.switch {
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    cursor: pointer;
}

.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch-ui {
    width: 46px;
    height: 28px;
    border-radius: 999px;
    background: #ddd6cb;
    position: relative;
    transition: 0.2s ease;
}

.switch-ui::after {
    content: "";
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 32, 66, 0.2);
}

.switch input:checked + .switch-ui { background: var(--navy); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); background: var(--gold); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-gold, .btn-line {
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-gold {
    width: 100%;
    margin-top: 22px;
    background: var(--navy);
    color: var(--gold);
    padding: 14px 18px;
}

.btn-gold:hover { background: var(--navy-soft); }

.app-body { min-height: 100vh; }

.shell { min-height: 100vh; }

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #102042 0%, #0c1833 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 30;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: white;
    text-decoration: none;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    flex: 1;
    overflow: auto;
    padding: 4px 12px 2px;
}

.brand img { width: 48px; height: 48px; border-radius: 50%; background: white; object-fit: cover; }
.brand strong { display: block; letter-spacing: 0.08em; }
.brand small { color: var(--gold); }

.nav-label {
    margin: 12px 12px 4px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    gap: 10px;
    align-items: center;
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.nav-item.is-active, .nav-item:hover { background: rgba(213, 170, 115, 0.16); color: var(--gold); }

.sidebar-foot {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.16);
}
.sidebar-foot img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
}
.sidebar-foot strong { display: block; font-size: 14px; }
.sidebar-foot span { color: var(--gold); font-size: 12px; }

.main { margin-left: 260px; min-width: 0; }
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(231, 225, 214, 0.9);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
}
.topbar h1 { margin: 0; font-size: 22px; }
.eyebrow { margin: 0; color: var(--gold-deep); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 800; }
.account { margin-left: auto; position: relative; }
.account form { display: none; }
.avatar-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--gold);
    border-radius: 50%;
    background: white;
    cursor: pointer;
    overflow: hidden;
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 210px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(16, 32, 66, 0.14);
    padding: 8px;
    z-index: 20;
}
.account-menu a, .account-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    text-align: left;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    cursor: pointer;
}
.account-menu a:hover, .account-menu button:hover { background: #f6f3ee; }
.btn-line { background: white; color: var(--navy); border: 1px solid var(--line); padding: 10px 14px; }
.icon-btn { display: none; border: 0; background: white; border-radius: 12px; width: 40px; height: 40px; }

.content { padding: 28px; }
.page-intro h2 { margin: 0 0 6px; font-size: 30px; }
.page-intro p { margin: 0 0 18px; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.stat-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: white;
    border: 0;
    border-left: 3px solid var(--gold);
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 8px 22px rgba(16, 32, 66, 0.06);
}
.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(16, 32, 66, 0.06);
    color: var(--navy);
    flex: none;
}
a.stat-card { color: inherit; text-decoration: none; }
.stat-card h3 { margin: 0 0 4px; font-size: 16px; }
.stat-card p { margin: 0; color: var(--muted); font-size: 14px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--muted);
    background: white;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(16, 32, 66, 0.05);
}
.tabs a.is-active { background: var(--navy); color: var(--gold); }

.panel {
    width: 100%;
    background: white;
    border: 0;
    border-left: 3px solid var(--navy);
    border-radius: 14px;
    padding: 0 0 22px;
    box-shadow: 0 8px 22px rgba(16, 32, 66, 0.06);
}
.panel-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}
.panel-head .stat-icon {
    background: var(--navy);
    color: var(--gold);
}
.panel-head-action { margin-left: auto; }
.panel-head h2 { margin: 0; font-size: 18px; }
.panel-head p { margin: 2px 0 0; color: var(--muted); }
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    padding: 22px 22px 0;
}
.field label { margin: 0 0 8px; }
.input-group {
    display: flex;
    align-items: center;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fcfbf9;
    overflow: hidden;
}
.input-group:focus-within {
    border-color: var(--gold-deep);
    box-shadow: 0 0 0 4px rgba(213, 170, 115, 0.25);
}
.input-icon {
    width: 46px;
    align-self: stretch;
    display: grid;
    place-items: center;
    color: var(--gold);
    background: var(--navy);
    border-right: 0;
}
.input-group select,
.input-group input {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    margin: 0;
    min-width: 0;
}
.input-group input:focus { box-shadow: none; }
.input-group .eye-btn { position: static; transform: none; flex: none; }
.photo-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0;
    padding: 22px;
    border-bottom: 1px solid var(--line);
}
.photo-block img {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    background: white;
    border: 3px solid var(--gold);
    flex: none;
}
.photo-block h2 { margin: 0; font-size: 18px; }
.photo-block p { margin: 4px 0 12px; color: var(--muted); }
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--navy);
    font-weight: 700;
    cursor: pointer;
}
input[type="file"] { display: none; }
.panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 22px 0;
}
.panel .btn-gold, .panel .btn-line { width: auto; min-width: 160px; margin-top: 0; }
#remove-photo-form { display: none; }
.filters {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr auto;
    gap: 12px;
    padding: 18px 22px 0;
    align-items: center;
}
.filters .btn-gold { width: auto; margin: 0; min-height: 48px; }
.filters-search { grid-template-columns: 1fr auto; }
.filters-lead { grid-template-columns: 1.2fr 0.8fr 0.8fr auto; }
.filters-audit { grid-template-columns: 1.3fr 0.8fr 0.7fr 0.7fr auto; }
.input-group select {
    border: 0;
    background: transparent;
    width: 100%;
    padding: 12px 16px;
    outline: none;
}
.table-wrap { padding: 18px 22px 8px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}
.data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td span, .data-table td strong { display: block; }
.data-table td span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.badge {
    display: inline-flex;
    background: rgba(16, 32, 66, 0.08);
    color: var(--navy);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
}
.badge-pending, .badge-clarification, .badge-draft, .badge-placed { background: rgba(213, 170, 115, 0.28); }
.badge-approved { background: var(--navy); color: var(--gold); }
.badge-rejected, .badge-suspended, .badge-superseded, .badge-cancelled, .badge-closed { background: rgba(141, 132, 120, 0.2); color: #6d645b; }
.notice {
    margin: 18px 22px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(213, 170, 115, 0.18);
    color: var(--navy);
}
.check-line {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 18px 22px 0;
    color: var(--navy);
    font-weight: 600;
}
.check-line input { margin-top: 4px; }
.field-span { grid-column: 1 / -1; }
.input-group textarea {
    border: 0;
    background: transparent;
    width: 100%;
    min-height: 110px;
    padding: 12px 16px;
    resize: vertical;
    outline: none;
    font: inherit;
    color: inherit;
}
.decision-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 22px;
}
.decision-grid .field { margin-bottom: 12px; }
.decision-grid .btn-gold, .decision-grid .btn-line { width: auto; }
.empty { color: var(--muted); text-align: center; }
.text-link { color: var(--navy); font-weight: 800; }
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}
.detail-grid span { display: block; color: var(--muted); font-size: 13px; }
.pager { padding: 8px 22px 18px; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-panel { padding: 32px 24px 12px; }
    .auth-panel h1 { font-size: 34px; }
    .auth-card { margin: 12px auto 32px; }
    .icon-btn { display: inline-grid; place-items: center; }
    .sidebar { transform: translateX(-105%); transition: 0.2s ease; }
    .sidebar.is-open { transform: none; }
    .main { margin-left: 0; }
    .stat-grid, .report-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .field-grid, .filters, .detail-grid, .decision-grid { grid-template-columns: 1fr; }
}
