:root {
    --admin-bg: #0f1012;
    --admin-panel: #191b1f;
    --admin-panel-2: #22252a;
    --admin-border: #353940;
    --admin-text: #f7f7f7;
    --admin-muted: #aeb3bb;
    --admin-red: #f31318;
    --admin-red-dark: #b7080d;
    --admin-green: #22c55e;
    --admin-yellow: #f2b84b;
    --admin-blue: #60a5fa;
    --admin-radius: 18px;
    --admin-shadow: 0 20px 50px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

.admin-body {
    margin: 0;
    min-height: 100vh;
    color: var(--admin-text);
    background: var(--admin-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-body input,
.admin-body select,
.admin-body textarea,
.admin-body button { font: inherit; }

.admin-body a { color: inherit; }

.admin-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    padding: 12px clamp(18px, 4vw, 64px);
    border-bottom: 1px solid var(--admin-border);
    background: rgba(15, 16, 18, .95);
    backdrop-filter: blur(16px);
}

.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--admin-text);
    text-decoration: none;
}

.admin-brand img {
    display: block;
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
}

.admin-brand span,
.admin-user span { display: grid; gap: 1px; }
.admin-brand strong { font-size: 1.02rem; letter-spacing: -.02em; }
.admin-brand small,
.admin-user small { color: var(--admin-muted); font-size: .78rem; }

.admin-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    text-align: right;
}

.admin-main {
    width: min(1540px, calc(100% - 36px));
    margin: 0 auto;
    padding: 38px 0 70px;
}

.admin-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.admin-heading h1,
.admin-login-card h1 {
    margin: 4px 0 8px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -.055em;
}

.admin-eyebrow {
    margin: 0;
    color: var(--admin-red);
    font-weight: 800;
    font-size: .76rem;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.admin-muted { margin: 0; color: var(--admin-muted); }

.admin-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1;
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.admin-button:hover { transform: translateY(-1px); }
.admin-button:focus-visible,
.admin-body input:focus-visible,
.admin-body select:focus-visible,
.admin-body textarea:focus-visible,
.admin-link:focus-visible { outline: 3px solid rgba(243, 19, 24, .35); outline-offset: 2px; }
.admin-button-primary { color: #fff; background: var(--admin-red); }
.admin-button-primary:hover { background: var(--admin-red-dark); }
.admin-button-dark { color: #111; background: #fff; }
.admin-button-ghost { color: var(--admin-text); border-color: var(--admin-border); background: transparent; }
.admin-button-ghost:hover { border-color: #737983; background: var(--admin-panel); }

.admin-alert {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 12px;
    font-weight: 650;
}
.admin-alert-success { color: #b7f7ca; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); }
.admin-alert-error { color: #ffc4c6; border-color: rgba(243, 19, 24, .45); background: rgba(243, 19, 24, .1); }

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

.admin-stats > * {
    display: grid;
    gap: 3px;
    min-height: 100px;
    align-content: center;
    padding: 18px;
    border: 1px solid var(--admin-border);
    border-radius: 15px;
    background: var(--admin-panel);
    text-decoration: none;
}
.admin-stats a:hover { border-color: #616772; background: var(--admin-panel-2); }
.admin-stats strong { font-size: 1.65rem; line-height: 1; }
.admin-stats span { color: var(--admin-muted); font-size: .84rem; }

.admin-card {
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    background: var(--admin-panel);
    box-shadow: var(--admin-shadow);
}

.admin-filters { margin-bottom: 18px; padding: 16px; }
.admin-filters form {
    display: grid;
    grid-template-columns: minmax(180px, .55fr) minmax(260px, 1.4fr) auto auto;
    gap: 12px;
    align-items: end;
}
.admin-filter-search { min-width: 0; }

.admin-body label { display: grid; gap: 7px; }
.admin-body label > span { color: #d9dce1; font-size: .82rem; font-weight: 700; }
.admin-body input,
.admin-body select,
.admin-body textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--admin-text);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: #111316;
}
.admin-body textarea { min-height: 92px; resize: vertical; }

.admin-workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-workspace.has-detail { grid-template-columns: minmax(620px, 1.35fr) minmax(390px, .75fr); }
.admin-table-card { min-width: 0; overflow: hidden; }
.admin-card-title { display: flex; justify-content: space-between; gap: 16px; padding: 20px 22px; border-bottom: 1px solid var(--admin-border); }
.admin-card-title h2 { margin: 0 0 3px; font-size: 1.15rem; }
.admin-card-title p { margin: 0; color: var(--admin-muted); font-size: .84rem; }
.admin-table-wrap { overflow-x: auto; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th,
.admin-table td { padding: 15px 16px; border-bottom: 1px solid var(--admin-border); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--admin-muted); background: #15171a; font-size: .73rem; letter-spacing: .07em; text-transform: uppercase; }
.admin-table tbody tr:hover,
.admin-table tbody tr.is-selected { background: #22252a; }
.admin-table td strong { display: block; margin-bottom: 4px; }
.admin-table td small { display: block; color: var(--admin-muted); font-size: .77rem; line-height: 1.4; }
.admin-link { color: #fff; font-weight: 750; text-underline-offset: 4px; }

.admin-progress {
    display: block;
    width: 90px;
    height: 6px;
    margin-bottom: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #0c0d0f;
}
.admin-progress::-webkit-progress-bar { background: #0c0d0f; }
.admin-progress::-webkit-progress-value { background: var(--admin-red); }
.admin-progress::-moz-progress-bar { background: var(--admin-red); }

.admin-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 800;
    white-space: nowrap;
}
.status-pending { color: #ffd786; border-color: rgba(242, 184, 75, .38); background: rgba(242, 184, 75, .1); }
.status-approved { color: #a9f3c0; border-color: rgba(34, 197, 94, .38); background: rgba(34, 197, 94, .1); }
.status-suspended,
.status-rejected { color: #ffc0c2; border-color: rgba(243, 19, 24, .4); background: rgba(243, 19, 24, .1); }
.status-draft { color: #c8dfff; border-color: rgba(96, 165, 250, .38); background: rgba(96, 165, 250, .1); }

.admin-empty { padding: 50px 24px; color: var(--admin-muted); text-align: center; }
.admin-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px; color: var(--admin-muted); font-size: .86rem; }
.admin-pagination a { color: #fff; font-weight: 700; }

.admin-detail { overflow: hidden; }
.admin-detail-head { display: flex; justify-content: space-between; gap: 18px; padding: 22px; border-bottom: 1px solid var(--admin-border); }
.admin-detail-head h2 { margin: 12px 0 3px; font-size: 1.55rem; letter-spacing: -.035em; }
.admin-detail-head p { margin: 0; color: var(--admin-muted); }
.admin-detail-head img { width: 76px; height: 76px; flex: 0 0 auto; object-fit: cover; border: 1px solid var(--admin-border); border-radius: 14px; background: #fff; }

.admin-data { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 8px 22px; }
.admin-data div { min-width: 0; padding: 13px 0; border-bottom: 1px solid var(--admin-border); }
.admin-data div:nth-child(odd) { padding-right: 12px; }
.admin-data dt { color: var(--admin-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.admin-data dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 650; }

.admin-detail-section { padding: 19px 22px; border-bottom: 1px solid var(--admin-border); }
.admin-detail-section h3,
.admin-action-form h3 { margin: 0 0 12px; font-size: .95rem; }
.admin-detail-section p { color: #d8dbe0; line-height: 1.55; }
.admin-chip { display: inline-flex; margin: 0 5px 7px 0; padding: 6px 9px; color: #dfe5eb; border: 1px solid var(--admin-border); border-radius: 999px; background: #111316; font-size: .74rem; }
.admin-chip-red { border-color: rgba(243, 19, 24, .35); }

.admin-action-form { display: grid; gap: 12px; padding: 21px 22px; border-bottom: 1px solid var(--admin-border); background: #15171a; }
.admin-action-form label small { color: var(--admin-muted); font-weight: 500; }
.admin-form-hint { margin: -4px 0 0; color: var(--admin-muted); font-size: .76rem; }
.admin-field-error { display: block; margin-top: -6px; color: #ffb9bb; }
.admin-history article { padding: 11px 0; border-top: 1px solid var(--admin-border); }
.admin-history article:first-of-type { border-top: 0; }
.admin-history article strong,
.admin-history article span { display: block; }
.admin-history article span { margin-top: 3px; color: var(--admin-muted); font-size: .74rem; }
.admin-history article p { margin: 7px 0 0; }

.admin-login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background: radial-gradient(circle at 15% 5%, rgba(243, 19, 24, .16), transparent 35%);
}
.admin-login-card { width: min(470px, 100%); padding: clamp(28px, 5vw, 48px); border: 1px solid var(--admin-border); border-radius: 24px; background: var(--admin-panel); box-shadow: var(--admin-shadow); }
.admin-login-card .admin-brand { margin-bottom: 36px; }
.admin-login-card .admin-brand img { width: 64px; height: 64px; }
.admin-login-form { display: grid; gap: 16px; margin-top: 24px; }
.admin-back { display: inline-block; margin-top: 22px; color: var(--admin-muted); font-weight: 650; text-underline-offset: 4px; }

@media (max-width: 1180px) {
    .admin-stats { grid-template-columns: repeat(3, 1fr); }
    .admin-workspace.has-detail { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .admin-header { position: static; align-items: flex-start; }
    .admin-user > span { display: none; }
    .admin-main { width: min(100% - 24px, 1540px); padding-top: 24px; }
    .admin-heading { align-items: flex-start; flex-direction: column; }
    .admin-heading-actions { width: 100%; justify-content: flex-start; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .admin-filters form { grid-template-columns: 1fr; }
    .admin-filters .admin-button { width: 100%; }
    .admin-table th:nth-child(2),
    .admin-table td:nth-child(2),
    .admin-table th:nth-child(3),
    .admin-table td:nth-child(3) { display: none; }
    .admin-data { grid-template-columns: 1fr; }
    .admin-data div:nth-child(odd) { padding-right: 0; }
}

@media (max-width: 440px) {
    .admin-header { gap: 10px; padding: 10px 12px; }
    .admin-brand span { display: none; }
    .admin-stats { grid-template-columns: 1fr 1fr; }
    .admin-stats > * { min-height: 82px; padding: 13px; }
    .admin-detail-head { align-items: flex-start; }
    .admin-detail-head img { width: 60px; height: 60px; }
}

@media (prefers-reduced-motion: reduce) {
    .admin-button { transition: none; }
}
