/* ============================================================
   DOPPEL-DENKER – Admin Panel Styles (Desktop Only)
   ============================================================ */

@import url('https://cdn.jsdelivr.net/npm/remixicon@4.5.0/fonts/remixicon.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --green-900: #1B4332;
    --green-800: #2D6A4F;
    --green-700: #40916C;
    --green-600: #52B788;
    --green-400: #74C69D;
    --green-200: #B7E4C7;
    --green-100: #D8F3DC;
    --green-50: #F0FAF3;

    --accent: #52B788;
    --sidebar-w: 240px;

    --text-primary: #1B3626;
    --text-secondary: #3D6B53;
    --text-muted: #7DA98A;

    --border: rgba(45, 106, 79, 0.12);
    --shadow-sm: 0 2px 8px rgba(27, 67, 50, 0.08);
    --shadow-md: 0 8px 24px rgba(27, 67, 50, 0.12);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--green-50);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

/* ── Mobile Blocker ── */
.mobile-blocker {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--green-50);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    gap: 16px;
}

.mobile-blocker .blocker-icon {
    font-size: 4rem;
}

.mobile-blocker h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.mobile-blocker p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .mobile-blocker {
        display: flex;
    }

    .admin-layout {
        display: none !important;
    }
}

/* ── Layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 100%);
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 4px 0 20px rgba(27, 67, 50, 0.2);
}

.sidebar-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo .logo-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-emoji {
    font-size: 1.6rem;
}

.sidebar-logo h2 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.sidebar-logo .admin-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 700;
}

.sidebar-link .link-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.sidebar-bottom {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sidebar-user .s-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
}

.sidebar-user .s-email {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 155px;
}

.btn-logout-side {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-logout-side:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ── Main Content ── */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 32px;
    max-width: calc(100% - var(--sidebar-w));
}

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

.admin-topbar h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.admin-topbar .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Cards ── */
.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Admin Stat Grid ── */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.admin-stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.admin-stat .a-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.admin-stat .a-val {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.admin-stat .a-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Table ── */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--green-50);
}

/* ── Buttons (admin) ── */
.btn-a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
}

.btn-a:active {
    transform: scale(0.97);
}

.btn-a-primary {
    background: linear-gradient(135deg, var(--green-700), var(--green-800));
    color: #fff;
    box-shadow: 0 3px 12px rgba(45, 106, 79, 0.3);
}

.btn-a-primary:hover {
    background: linear-gradient(135deg, var(--green-800), var(--green-900));
}

.btn-a-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.btn-a-danger:hover {
    background: #dc2626;
    color: #fff;
}

.btn-a-glass {
    background: var(--green-50);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-a-glass:hover {
    background: var(--green-100);
}

.btn-a-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* ── Toggle ── */
.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    inset: 0;
    background: #ddd;
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition);
}

.toggle .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked+.slider {
    background: var(--green-700);
}

.toggle input:checked+.slider::before {
    transform: translateX(20px);
}

/* ── Badge ── */
.badge-a {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-a-green {
    background: var(--green-100);
    color: var(--green-800);
}

.badge-a-muted {
    background: #f3f4f6;
    color: #6b7280;
}

.badge-a-red {
    background: #fef2f2;
    color: #dc2626;
}

.badge-a-blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-a-amber {
    background: #fffbeb;
    color: #92400e;
}

.badge-a-purple {
    background: #f5f3ff;
    color: #5b21b6;
}

/* ── Form modal ── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(27, 54, 38, 0.35);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: all;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(27, 67, 50, 0.2);
    padding: 28px;
    width: 520px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.show .modal-box {
    transform: scale(1) translateY(0);
}

.modal-box h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: var(--green-50);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

/* ── Toast ── */
.toast-container-a {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-a {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease both;
}

.toast-a.success {
    border-left: 4px solid var(--green-600);
}

.toast-a.error {
    border-left: 4px solid #dc2626;
}

.toast-a.info {
    border-left: 4px solid var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Input search ── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--green-50);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 16px;
}

.search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.search-bar .search-icon {
    color: var(--text-muted);
}

/* ── Section divider ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}