/* ==================== ANN Admin Panel ==================== */
:root {
    --navy: #0b1329;
    --navy-2: #101a38;
    --navy-3: #16224a;
    --gold: #d97706;
    --gold-light: #f59e0b;
    --bg: #f1f5f9;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --green: #16a34a;
    --red: #dc2626;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

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

body {
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

a { text-decoration: none; color: inherit; }

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

.admin-sidebar {
    width: 250px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-brand {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    gap: 12px;
    padding: 24px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.brand-badge {
    width: 44px; height: 44px;
    background: var(--gold); color: #fff;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; letter-spacing: 1px;
    flex-shrink: 0;
}
.admin-logo-img {
    height: 60px; width: auto; max-width: 170px;
    object-fit: contain;
    background: #fff; border-radius: 12px;
    padding: 6px 12px;
    flex-shrink: 0;
}
.sidebar-brand strong { display: block; color: #fff; font-size: 1rem; }
.sidebar-brand span { font-size: 0.72rem; opacity: 0.7; }

.sidebar-nav { padding: 16px 12px; flex-grow: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(217,119,6,0.5) rgba(255,255,255,0.06); }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(217,119,6,0.5); border-radius: 3px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
}
.sidebar-nav a i { width: 20px; text-align: center; color: var(--gold-light); }
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: #fff; }
.sidebar-nav a.active i { color: #fff; }
.nav-sep { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 4px; }
.logout-link { color: #fca5a5 !important; }
.logout-link i { color: #fca5a5 !important; }

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 8px;
    flex-shrink: 0;
}
.sidebar-footer i { color: var(--gold-light); }

.admin-main { flex-grow: 1; min-width: 0; }

.admin-topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.admin-topbar h2 { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.admin-topbar h2 i { color: var(--gold); margin-inline-end: 8px; }
.topbar-date { color: var(--muted); font-size: 0.85rem; direction: ltr; }

/* Topbar menu button (mobile only) */
.topbar-menu-btn {
    display: none;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
}
.topbar-menu-btn:hover { border-color: var(--gold); color: var(--gold); }

/* Mobile sidebar overlay */
.sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(11, 19, 41, 0.5);
    z-index: 110;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }

/* Instant search toolbar (rendered above list tables) */
.search-body { padding: 0; margin-bottom: 14px; }
.search-body .instant-search {
    max-width: 380px;
    background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
    padding-right: 14px;
    padding-left: 40px;
}

.admin-content { padding: 28px; max-width: 1200px; }

/* ---------- Cards / Stats ---------- */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: #fff7ed;
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-box h3 { font-size: 1.5rem; font-weight: 900; color: var(--navy); line-height: 1.2; }
.stat-box p { color: var(--muted); font-size: 0.85rem; }

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.panel-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    flex-wrap: wrap;
}
.panel-head h3 { font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.panel-head h3 i { color: var(--gold); margin-inline-end: 6px; }
.panel-body { padding: 22px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.2s;
}
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #b45309; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-3); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-red { background: #fee2e2; color: var(--red); }
.btn-red:hover { background: var(--red); color: #fff; }
.btn-green { background: #dcfce7; color: var(--green); }
.btn-green:hover { background: var(--green); color: #fff; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}
.admin-table th, .admin-table td {
    padding: 13px 16px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    background: #f8fafc;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}
.admin-table tbody tr:hover { background: #f8fafc; }
.row-thumb {
    width: 74px; height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f1f5f9;
}
.title-cell strong { display: block; color: var(--navy); font-size: 0.92rem; }
.title-cell small { color: var(--muted); font-size: 0.75rem; direction: ltr; display: block; }
.actions-cell { white-space: nowrap; display: flex; flex-wrap: wrap; gap: 5px; min-height: 30px; }
.actions-cell form { display: inline-flex; margin: 0; }
.actions-cell a, .actions-cell button { white-space: nowrap; }
.admin-table .btn-sm { padding: 5px 9px; font-size: 0.75rem; gap: 5px; border-radius: 7px; }

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.badge-active { background: #dcfce7; color: var(--green); }
.badge-hidden { background: #fee2e2; color: var(--red); }
.badge-order {
    background: #eff6ff; color: #2563eb;
    min-width: 30px; justify-content: center;
}

/* ---------- Forms ---------- */
.form-panel { max-width: 100%; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--navy);
}
.form-group label .req { color: var(--red); }
.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.92rem;
    background: #fff;
    transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.12); }
textarea.form-control { resize: vertical; min-height: 90px; }

.checkbox-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--gold); }

.image-preview {
    margin-top: 8px;
    max-width: 260px;
    max-height: 150px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: none;
}
.hint { font-size: 0.78rem; color: var(--muted); }

.form-actions {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px dashed var(--border);
    display: flex; gap: 12px; align-items: center;
}

/* ---------- Alerts ---------- */
.alert {
    padding: 13px 18px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-weight: 600;
    font-size: 0.92rem;
    display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---------- Login Page ---------- */
.login-body {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(1000px 500px at 90% -10%, rgba(217, 119, 6, 0.25), transparent),
        radial-gradient(800px 400px at 0% 110%, rgba(217, 119, 6, 0.15), transparent),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%);
    padding: 20px;
}
.login-card {
    width: 100%; max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 40px 36px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-badge { width: 64px; height: 64px; font-size: 1.2rem; margin: 0 auto 14px; border-radius: 16px; }
.login-brand h1 { font-size: 1.25rem; color: var(--navy); font-weight: 900; }
.login-brand p { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.login-card .form-group { margin-bottom: 16px; }
.login-btn { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; margin-top: 6px; }
.login-note {
    margin-top: 20px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .topbar-menu-btn { display: inline-flex; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar {
        position: fixed;
        right: 0; top: 0; bottom: 0;
        width: 270px;
        height: 100vh;
        z-index: 120;
        transform: translateX(102%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
    }
    body.sidebar-open .admin-sidebar { transform: translateX(0); }
    .admin-main { width: 100%; }
    .admin-topbar { padding: 12px 16px; }
    .admin-content { padding: 16px; }
    .search-body .instant-search { max-width: 100%; }
    .stat-cards { grid-template-columns: 1fr; }
}

/* ==================== Testimonials review queue ==================== */
.alert-warn {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tst-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.tst-tabs a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 7px 14px;
    border-radius: 20px;
    position: relative;
    transition: all .2s ease;
}

.tst-tabs a:hover {
    border-color: var(--gold);
    color: var(--navy);
}

.tst-tabs a.active {
    background: linear-gradient(45deg, var(--gold), var(--gold-dark));
    color: #fff;
    border-color: transparent;
}

.tab-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    margin-right: 4px;
    animation: tstPulse 1.2s infinite;
}

@keyframes tstPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.badge-pending {
    background: #fef3c7;
    color: #b45309;
}

.row-pending td {
    background: #fffbeb;
}

.sidebar-link-badge {
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.sidebar-section-title {
    padding: 10px 14px 6px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(217, 119, 6, 0.9);
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    margin-bottom: 10px;
    text-transform: none;
}

/* ---------- Reports: timeline ---------- */
.timeline {
    position: relative;
    padding: 4px 0 4px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    right: 11px;
    width: 2px;
    background: #e2e8f0;
}
.tl-item {
    position: relative;
    padding: 0 34px 18px 0;
}
.tl-item:last-child { padding-bottom: 4px; }
.tl-dot {
    position: absolute;
    right: 4px;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #cbd5e1;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #e2e8f0;
}
.tl-created .tl-dot { background: #64748b; }
.tl-start .tl-dot { background: #2563eb; }
.tl-deadline .tl-dot { background: #d97706; }
.tl-complete .tl-dot { background: #059669; box-shadow: 0 0 0 2px #bbf7d0; }
.tl-task .tl-dot { background: #94a3b8; }
.tl-done .tl-dot { background: #16a34a; box-shadow: 0 0 0 2px #bbf7d0; }
.tl-overdue .tl-dot { background: #dc2626; box-shadow: 0 0 0 2px #fecaca; }
.tl-assign .tl-dot { background: #9333ea; }
.tl-body {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tl-body strong { font-size: 0.9rem; color: #0f172a; }
.tl-body small { color: #64748b; font-size: 0.78rem; }
.tl-date {
    display: inline-block;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 1px 8px;
    margin-bottom: 4px;
}

/* ==================== Mobile Optimization for Admin Dashboard ==================== */
@media (max-width: 768px) {
    .admin-main {
        margin-right: 0 !important;
        width: 100% !important;
        overflow-x: hidden;
    }
    .admin-content {
        padding: 14px 10px !important;
    }
    .admin-topbar {
        padding: 10px 14px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    .stat-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .stat-box {
        padding: 14px 10px !important;
    }
    .stat-box h3 {
        font-size: 1.25rem !important;
    }
    .panel {
        border-radius: 12px !important;
        margin-bottom: 16px !important;
    }
    .panel-head {
        padding: 12px 14px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    .panel-body {
        padding: 12px !important;
    }
    .table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 10px;
        margin-bottom: 12px;
    }
    .admin-table th, .admin-table td {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
        white-space: nowrap;
    }
    .btn {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr !important;
    }
}

