:root {
    --admin-blue: #194d8f;
    --admin-blue-dark: #0f315f;
    --admin-orange: #ff9900;
    --admin-text: #172033;
    --admin-muted: #6b7280;
    --admin-border: #e5e7eb;
    --admin-bg: #f4f7fb;
    --admin-white: #ffffff;
    --admin-danger: #b42318;
    --admin-success: #027a48;
    --admin-shadow: 0 18px 45px rgba(15,49,95,.12);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--admin-text);
    background: var(--admin-bg);
}
a { color: inherit; }
a:hover, a:focus { text-decoration: none; }
button, input, select, textarea { font: inherit; }

.admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(255,153,0,.14), transparent 34%),
        linear-gradient(135deg, #0f315f, #194d8f 54%, #f4f7fb 54%);
}
.login-card {
    width: min(100%, 440px);
    padding: 34px;
    border-radius: 24px;
    background: #fff;
    box-shadow: var(--admin-shadow);
}
.login-card__brand {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--admin-blue), var(--admin-blue-dark));
    font-weight: 900;
}
.login-card h1 {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 900;
}
.login-card p {
    margin: 0 0 22px;
    color: var(--admin-muted);
    line-height: 1.5;
}
.login-form { display: grid; gap: 16px; }
.login-form label,
.admin-upload-form label {
    display: grid;
    gap: 8px;
    color: #344054;
    font-weight: 800;
}
.login-form input,
.admin-upload-form input,
.admin-upload-form select,
.admin-upload-form textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    color: var(--admin-text);
    background: #fff;
    outline: none;
}
.admin-upload-form textarea { resize: vertical; }
.login-form input:focus,
.admin-upload-form input:focus,
.admin-upload-form select:focus,
.admin-upload-form textarea:focus {
    border-color: #8bb8ef;
    box-shadow: 0 0 0 4px rgba(25,77,143,.12);
}

.admin-btn,
.admin-mini-btn {
    border: 0;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    transition: .2s ease;
}
.admin-btn {
    min-height: 46px;
    padding: 11px 18px;
}
.admin-btn--primary {
    color: #fff;
    background: var(--admin-blue);
    box-shadow: 0 12px 24px rgba(25,77,143,.2);
}
.admin-btn--primary:hover { background: var(--admin-blue-dark); }
.admin-btn--primary:disabled { opacity: .65; cursor: wait; }
.admin-btn--light {
    color: var(--admin-blue);
    background: #eef5ff;
}
.admin-mini-btn {
    min-height: 34px;
    padding: 7px 12px;
    color: var(--admin-blue);
    background: #eef5ff;
}
.admin-alert,
.admin-message {
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
}
.admin-alert--error,
.admin-message--error {
    color: var(--admin-danger);
    background: #fff1f0;
    border: 1px solid #ffd3ce;
}
.admin-message--success {
    color: var(--admin-success);
    background: #ecfdf3;
    border: 1px solid #abefc6;
}

.admin-page { min-height: 100vh; }
.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 28px;
    background: #fff;
    border-bottom: 1px solid var(--admin-border);
}
.admin-topbar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-topbar__brand > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--admin-blue), var(--admin-blue-dark));
    font-weight: 900;
}
.admin-topbar__brand strong { display: block; font-size: 16px; }
.admin-topbar__brand small { color: var(--admin-muted); }
.admin-topbar__actions {
    display: flex;
    gap: 10px;
}
.admin-topbar__actions a {
    padding: 10px 14px;
    border-radius: 999px;
    color: #344054;
    background: #f8fafc;
    font-weight: 800;
}
.admin-topbar__actions a:hover { color: var(--admin-blue); background: #eef5ff; }

.admin-shell {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 26px;
    padding: 26px;
}
.admin-sidebar {
    position: sticky;
    top: 94px;
    align-self: start;
    display: grid;
    gap: 16px;
}
.admin-stat,
.admin-section-nav,
.admin-hero,
.admin-panel,
.admin-modal__card {
    background: #fff;
    border: 1px solid var(--admin-border);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15,49,95,.06);
}
.admin-stat { padding: 20px; }
.admin-stat span { display: block; color: var(--admin-muted); font-weight: 800; }
.admin-stat strong { display: block; margin-top: 8px; font-size: 40px; line-height: 1; }
.admin-section-nav {
    display: grid;
    gap: 6px;
    padding: 12px;
}
.admin-section-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    color: #344054;
    font-weight: 900;
}
.admin-section-nav a:hover { color: var(--admin-blue); background: #eef5ff; }
.admin-content { display: grid; gap: 18px; }
.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding: 28px;
}
.admin-hero span {
    color: var(--admin-orange);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.admin-hero h1 {
    margin: 6px 0 8px;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 900;
}
.admin-hero p { max-width: 760px; margin: 0; color: var(--admin-muted); line-height: 1.55; }
.admin-panels { display: grid; gap: 18px; }
.admin-panel { overflow: hidden; }
.admin-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--admin-border);
    background: linear-gradient(180deg, #fff, #fbfdff);
}
.admin-panel__head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.admin-panel__head p { margin: 0; color: var(--admin-muted); }
.admin-subsections { display: grid; }
.admin-subsection { padding: 18px 24px; }
.admin-subsection + .admin-subsection { border-top: 1px solid var(--admin-border); }
.admin-subsection__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.admin-subsection__head h3 { margin: 0; font-size: 17px; font-weight: 900; }
.admin-docs { display: grid; gap: 10px; }
.admin-doc {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    background: #fff;
}
.admin-doc__main { min-width: 0; }
.admin-doc__main strong {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.admin-doc__main span { display: block; color: var(--admin-muted); font-size: 13px; }
.admin-doc__main p { margin: 6px 0 0; color: var(--admin-muted); }
.admin-doc__actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 8px;
}
.admin-doc__actions a,
.admin-doc__actions button {
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: #f8fafc;
    color: #344054;
    font-weight: 900;
}
.admin-doc__actions a:hover { color: var(--admin-blue); background: #eef5ff; }
.admin-doc__actions button { color: var(--admin-danger); }
.admin-doc__actions button:hover { background: #fff1f0; }
.admin-empty {
    padding: 14px;
    border-radius: 14px;
    color: var(--admin-muted);
    background: #f8fafc;
}

body.is-modal-open { overflow: hidden; }
.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}
.admin-modal[hidden] { display: none; }
.admin-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .62);
}
.admin-modal__card {
    position: relative;
    width: min(100%, 760px);
    max-height: min(90vh, 780px);
    overflow: auto;
}
.admin-modal__head,
.admin-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--admin-border);
}
.admin-modal__head h2 { margin: 0 0 6px; font-weight: 900; }
.admin-modal__head p { margin: 0; color: var(--admin-muted); }
.admin-modal__close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    color: #344054;
    background: #f8fafc;
    font-size: 28px;
    line-height: 1;
}
.admin-upload-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.admin-modal__footer {
    padding: 0;
    border-bottom: 0;
    justify-content: flex-end;
}

@media (max-width: 991px) {
    .admin-shell { grid-template-columns: 1fr; padding: 18px; }
    .admin-sidebar { position: static; }
    .admin-section-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-hero, .admin-panel__head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 640px) {
    .admin-topbar { align-items: flex-start; flex-direction: column; padding: 14px; }
    .admin-topbar__actions { width: 100%; }
    .admin-topbar__actions a { flex: 1; text-align: center; }
    .admin-section-nav, .admin-form-grid { grid-template-columns: 1fr; }
    .admin-doc { flex-direction: column; }
    .admin-doc__actions { align-items: stretch; }
    .admin-doc__actions a, .admin-doc__actions button { flex: 1; text-align: center; }
}
