.admin-body {
    background: #edf2f7;
}

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(430px, 100%);
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--shadow);
    padding: 32px;
}

.login-card h1 {
    margin: 34px 0 8px;
    font-size: 30px;
}

.login-card p {
    color: var(--muted);
    margin: 0 0 26px;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fff;
    border-right: 1px solid var(--line);
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.admin-tabs {
    display: grid;
    gap: 10px;
}

.admin-tabs button,
.admin-link {
    min-height: 44px;
    border: 0;
    border-radius: 14px;
    background: #f3f6fa;
    color: var(--muted);
    padding: 0 16px;
    display: flex;
    align-items: center;
    font-weight: 800;
    text-align: left;
}

.admin-tabs button.active {
    background: var(--ink);
    color: #fff;
}

.admin-link {
    margin-top: auto;
}

.admin-link.danger {
    margin-top: 0;
    color: #d84a3a;
}

.admin-main {
    padding: 30px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 26px;
}

.admin-topbar h1 {
    margin: 0;
    font-size: 30px;
}

.admin-topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.admin-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card,
.admin-card {
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 14px 42px rgba(28, 39, 58, .08);
}

.stat-card {
    padding: 20px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.admin-card {
    padding: 24px;
}

.admin-card h2 {
    font-size: 22px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.card-head p {
    margin: 6px 0 0;
    color: var(--muted);
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

.admin-table th {
    color: #8a96a6;
    font-size: 13px;
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
}

.admin-table td {
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.admin-case-cell {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 260px;
}

.admin-thumb {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    object-fit: cover;
    background: #edf2f7;
    flex: 0 0 auto;
}

.admin-case-cell strong {
    display: block;
    margin-bottom: 5px;
}

.admin-case-cell small,
.status-pill,
.activity-list small {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    background: #f1f4f8;
    font-size: 12px;
    font-weight: 800;
}

.status-pill.published {
    background: #ecf9c8;
    color: #476020;
}

.row-actions {
    display: flex;
    gap: 8px;
}

.mini-btn {
    min-height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 16px;
    background: #f1f4f8;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mini-btn.danger {
    background: #fff0ee;
    color: #d84a3a;
}

.stack-form {
    display: grid;
    gap: 16px;
}

.stack-form label,
.case-form label {
    display: grid;
    gap: 8px;
    color: #536071;
    font-size: 13px;
    font-weight: 800;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.case-form input,
.case-form select,
.case-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fbfd;
    color: var(--ink);
    padding: 12px 14px;
    outline: 0;
    transition: border .16s ease, box-shadow .16s ease;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.case-form input:focus,
.case-form select:focus,
.case-form textarea:focus {
    border-color: #bdd7ff;
    box-shadow: 0 0 0 4px rgba(69, 103, 240, .08);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
}

.checkline {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px;
    min-height: 48px;
}

.checkline input {
    width: 18px !important;
    height: 18px;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 18px;
}

.nav-admin-list {
    display: grid;
    gap: 14px;
}

.nav-group {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fbfcfe;
    padding: 14px;
}

.nav-group-head,
.nav-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-group-head strong {
    font-size: 17px;
}

.nav-child {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
}

.nav-child span,
.nav-group small {
    color: var(--muted);
}

.activity-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.activity-item {
    padding: 14px;
    border-radius: 16px;
    background: #f6f8fb;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.case-dialog {
    width: min(1040px, calc(100vw - 28px));
    max-height: calc(100vh - 34px);
    border: 0;
    padding: 0;
    border-radius: 26px;
    box-shadow: 0 28px 90px rgba(23, 33, 47, .24);
    background: #fff;
}

.case-dialog::backdrop {
    background: rgba(23, 33, 47, .34);
    backdrop-filter: blur(4px);
}

.case-form {
    padding: 0;
}

.case-form header,
.case-form footer {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.case-form footer {
    border-top: 1px solid var(--line);
    border-bottom: 0;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
}

.case-form h2 {
    margin: 0;
}

.case-form p {
    margin: 6px 0 0;
    color: var(--muted);
}

.case-form-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-height: calc(100vh - 210px);
    overflow-y: auto;
}

.full-span {
    grid-column: 1 / -1;
}

@media (max-width: 1100px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-tabs {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .admin-link {
        margin-top: 0;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .admin-main {
        padding: 18px;
    }

    .admin-topbar,
    .card-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-form-grid {
        grid-template-columns: 1fr;
    }

    .case-form footer {
        grid-template-columns: 1fr;
    }

    .case-form footer .btn,
    .admin-actions .btn {
        width: 100%;
    }
}
