:root {
    --navy: #10243e;
    --navy-light: #193653;
    --blue: #1769e0;
    --blue-hover: #1058bd;
    --background: #f4f6f9;
    --surface: #ffffff;
    --border: #e3e8ef;
    --text: #142033;
    --muted: #657187;
    --green: #168452;
    --green-bg: #e8f7ef;
    --orange: #a35b00;
    --orange-bg: #fff2dc;
    --danger: #a32323;
    --danger-bg: #fff0f0;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

a {
    color: var(--blue);
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    padding: 25px 18px;
    background: var(--navy);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.brand,
.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    padding: 0 10px 30px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--blue);
    color: white;
    font-size: 21px;
    font-weight: 800;
}

.brand strong,
.login-brand strong {
    display: block;
    font-size: 18px;
}

.brand small,
.login-brand small,
.user-card small {
    display: block;
    opacity: .65;
    margin-top: 2px;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    padding: 12px 13px;
    border-radius: 9px;
    color: #cbd7e6;
    display: flex;
    align-items: center;
    gap: 12px;
}

nav a:hover,
nav a.active {
    background: var(--navy-light);
    color: white;
}

nav a.disabled {
    opacity: .45;
    pointer-events: none;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, .1);
    padding-top: 18px;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #345371;
    font-weight: 700;
}

.logout-button {
    border: 0;
    padding: 10px 0 0;
    background: transparent;
    color: #b9c9d9;
    cursor: pointer;
}

.content {
    margin-left: 248px;
    padding: 38px;
    min-height: 100vh;
}

.page-header,
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 3px 0 8px;
    font-size: 31px;
}

.eyebrow {
    margin: 0;
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
}

.muted {
    color: var(--muted);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 9px;
    border: 0;
    cursor: pointer;
    font-weight: 700;
}

.primary-button {
    color: white;
    background: var(--blue);
}

.primary-button:hover {
    background: var(--blue-hover);
}

.secondary-button {
    background: white;
    border: 1px solid var(--border);
    color: var(--text);
}

.full-width {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 25px;
}

.stat-card,
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(16, 36, 62, .04);
}

.stat-card {
    padding: 22px;
}

.stat-card strong {
    display: block;
    margin: 14px 0 7px;
    font-size: 30px;
}

.stat-card small,
.stat-label {
    color: var(--muted);
}

.stat-label {
    font-weight: 700;
}

.online {
    color: var(--green);
}

.panel {
    padding: 24px;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h2 {
    margin: 0 0 5px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.file-name {
    max-width: 350px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge.waiting {
    color: var(--orange);
    background: var(--orange-bg);
}

.empty-state {
    padding: 65px 20px;
    text-align: center;
}

.empty-state strong {
    font-size: 20px;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 22px;
}

.upload-panel {
    max-width: 900px;
}

.upload-form {
    display: grid;
    gap: 22px;
}

.drop-zone {
    min-height: 330px;
    border: 2px dashed #bdc8d5;
    border-radius: 14px;
    background: #f9fbfd;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-align: center;
    cursor: pointer;
    transition: .2s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--blue);
    background: #f1f6ff;
}

.drop-zone input {
    display: none;
}

.drop-zone strong {
    font-size: 20px;
}

.drop-zone span,
.drop-zone small {
    color: var(--muted);
}

.drop-zone em {
    margin-top: 10px;
    color: var(--blue);
    font-style: normal;
    font-weight: 700;
}

.upload-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e5efff;
    color: var(--blue) !important;
    font-size: 30px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.alert {
    padding: 13px 15px;
    border-radius: 9px;
    margin-bottom: 20px;
}

.alert.error {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #f4cccc;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 25px;
    background:
        radial-gradient(circle at top left, #e7effa, transparent 40%),
        var(--background);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 38px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(16, 36, 62, .12);
}

.login-brand {
    margin-bottom: 35px;
}

.login-card h1 {
    margin: 0 0 8px;
}

.form-stack {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.form-stack label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.form-stack input {
    width: 100%;
    min-height: 45px;
    padding: 10px 12px;
    border: 1px solid #cdd5df;
    border-radius: 8px;
    outline: none;
}

.form-stack input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .12);
}

@media (max-width: 1050px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .sidebar {
        position: static;
        width: auto;
        min-height: auto;
    }

    .content {
        margin-left: 0;
        padding: 24px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }
}
