/* ==========================================================================
   Admin Dashboard Styles — Clean Blue-White Glassmorphism
   ========================================================================== */

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

/* Login Screen */
.login-screen {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-card {
    width: min(440px, 100%);
    padding: 2.1rem;
}

.login-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.back-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.back-link:hover {
    color: var(--accent-primary);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.65rem;
}

.login-brand h1 {
    font-size: 1.35rem;
}

.login-brand p {
    font-size: 0.83rem;
    color: var(--text-muted);
}

.login-hint {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* Authenticated Layout */
.admin-shell {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem;
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 1.25rem;
    height: calc(100vh - 2.5rem);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1.15rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-brand div {
    display: flex;
    flex-direction: column;
}

.sidebar-brand strong {
    font-family: var(--font-display);
    font-size: 1rem;
}

.sidebar-brand small {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.62rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.22s ease;
}

.sidebar-link:hover {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.sidebar-link.active {
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 6px 16px -4px rgba(37, 99, 235, 0.45);
}

.nav-count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.1rem 0.48rem;
    border-radius: var(--radius-pill);
    background: rgba(148, 163, 184, 0.16);
}

.sidebar-link.active .nav-count {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.nav-count.is-unread {
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* Main Admin Column */
.admin-main {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    min-width: 0;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.4rem;
    border-radius: var(--radius-lg);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.admin-page-title {
    font-size: 1.25rem;
    margin-bottom: 0.1rem;
}

.admin-page-sub {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.mobile-sidebar-btn {
    display: none;
}

/* Overview Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1.1;
}

.stat-card small {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* Admin Panel Cards */
.admin-panel {
    padding: 1.6rem 1.75rem;
}

.admin-panel h3 {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.panel-desc {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.panel-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.text-link {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--accent-primary);
}

.quick-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    margin-top: 0.35rem;
}

.checkbox-inline input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--accent-primary);
}

/* Items List */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.9rem;
}

.admin-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.15rem;
    padding: 1.05rem 1.2rem;
    border-radius: var(--radius-md);
    background: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border);
}

.admin-list-item.is-unread-row {
    border-color: var(--accent-primary);
    background: var(--accent-soft);
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.item-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.15rem;
}

.item-pill {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.16rem 0.58rem;
    border-radius: var(--radius-pill);
    background: var(--accent-soft-strong);
    color: var(--accent-primary);
}

.item-pill.subtle {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.item-main strong {
    font-size: 0.98rem;
}

.item-main p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.btn-danger-ghost {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.24);
}

html[data-theme="dark"] .btn-danger-ghost {
    color: #f87171;
}

.btn-danger-ghost:hover {
    background: #ef4444;
    color: #ffffff;
}

.empty-state {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 1.25rem 0;
}

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

    .mobile-sidebar-btn {
        display: inline-grid;
    }

    .admin-sidebar {
        position: fixed;
        top: 1rem;
        left: 1rem;
        bottom: 1rem;
        width: 270px;
        z-index: 150;
        transform: translateX(-120%);
        transition: transform 0.3s var(--ease-spring);
    }

    .admin-sidebar.is-open {
        transform: translateX(0);
    }

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

@media (max-width: 680px) {
    .form-row-3,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-list-item {
        flex-direction: column;
    }
}
