/* Mahakal Tattva - Admin & User Dashboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --adm-sidebar-bg: #0f1217;
    --adm-sidebar-hover: #1c212a;
    --adm-accent: #D4AF37;
    --adm-accent-orange: #f26522;
    --adm-body-bg: #f4f6f9;
    --adm-card-bg: #ffffff;
    --adm-text-main: #1f2937;
    --adm-text-muted: #6b7280;
    --adm-border: #e5e7eb;
}

body.admin-body {
    background-color: var(--adm-body-bg);
    font-family: 'Inter', sans-serif;
    color: var(--adm-text-main);
    display: flex;
    min-height: 100vh;
    padding-bottom: 0;
}

/* Layout */
.dashboard-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.dash-sidebar {
    width: 260px;
    background: var(--adm-sidebar-bg);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: all 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.dash-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-brand img {
    height: 42px;
}

.dash-brand h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    color: var(--adm-accent);
    margin: 0;
    letter-spacing: 1.5px;
}

.dash-brand span {
    font-size: 0.65rem;
    color: #9ca3af;
    display: block;
    text-transform: uppercase;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.menu-header {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6b7280;
    padding: 12px 20px 6px;
    font-weight: 700;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #d1d5db;
    font-size: 0.92rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-item a:hover,
.sidebar-item.active a {
    background: var(--adm-sidebar-hover);
    color: var(--adm-accent);
    border-left: 4px solid var(--adm-accent);
}

.sidebar-item i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Content Area */
.dash-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--adm-border);
    padding: 14px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--adm-text-main);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--adm-accent);
    color: #0f1217;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Content Area */
.dash-content {
    padding: 30px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.revenue { background: #fef3c7; color: #d97706; }
.stat-icon.orders { background: #e0e7ff; color: #4f46e5; }
.stat-icon.darshan { background: #fce7f3; color: #db2777; }
.stat-icon.users { background: #d1fae5; color: #059669; }

.stat-details h3 {
    font-size: 0.82rem;
    color: var(--adm-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-details .stat-number {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--adm-text-main);
}

/* Admin Data Card / Tables */
.data-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--adm-border);
    margin-bottom: 30px;
    overflow: hidden;
}

.data-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.data-card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--adm-text-main);
    margin: 0;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.admin-table th {
    background: #f9fafb;
    padding: 12px 18px;
    font-weight: 600;
    color: #4b5563;
    border-bottom: 1px solid var(--adm-border);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--adm-border);
    color: #374151;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: #f9fafb;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-in_progress, .badge-processing { background: #e0e7ff; color: #3730a3; }
.badge-completed, .badge-delivered, .badge-paid { background: #d1fae5; color: #065f46; }
.badge-shipped { background: #e0f2fe; color: #0369a1; }
.badge-cancelled, .badge-failed { background: #fee2e2; color: #991b1b; }

/* Admin Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    gap: 5px;
}

.btn-action-view { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.btn-action-view:hover { background: #e5e7eb; }
.btn-action-edit { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.btn-action-edit:hover { background: #dbeafe; }
.btn-action-delete { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.btn-action-delete:hover { background: #fee2e2; }

/* Devotee / User Profile Box */
.user-profile-box {
    background: linear-gradient(135deg, #11141a 0%, #1e2430 100%);
    color: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-info h2 {
    font-family: 'Cinzel', serif;
    color: var(--adm-accent);
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.user-profile-info p {
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Video Proof Link Box */
.video-proof-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-proof-box a {
    color: #15803d;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Dashboard Hamburger Toggle & Sidebar Close */
.dash-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    color: var(--adm-text-main);
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.dash-menu-toggle:hover {
    background: var(--adm-accent-orange);
    color: #ffffff;
    border-color: var(--adm-accent-orange);
}

.dash-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #cbd5e1;
    font-size: 1.1rem;
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s ease;
}

.dash-sidebar-close:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.dash-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dash-backdrop.show {
    opacity: 1;
    visibility: visible;
}

body.dash-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 991px) {
    .dash-menu-toggle {
        display: inline-flex !important;
    }
    .dash-sidebar-close {
        display: inline-flex !important;
    }
    .dash-sidebar {
        position: fixed !important;
        left: -320px !important;
        width: 285px !important;
        max-width: 86vw !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 1050 !important;
        box-shadow: 6px 0 30px rgba(0, 0, 0, 0.5) !important;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        touch-action: pan-y !important;
        display: block !important;
    }
    .dash-sidebar.active {
        left: 0 !important;
    }
    .dash-brand {
        position: sticky !important;
        top: 0 !important;
        background: var(--adm-sidebar-bg) !important;
        z-index: 20 !important;
        padding: 18px 18px !important;
    }
    .sidebar-menu {
        list-style: none !important;
        padding: 10px 0 20px !important;
        margin: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }
    .sidebar-item a {
        padding: 13px 20px !important;
        font-size: 0.95rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    }
    .sidebar-footer {
        position: relative !important;
        bottom: auto !important;
        background: var(--adm-sidebar-bg) !important;
        padding: 20px 20px 50px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }
    .topbar-title {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .dash-content {
        padding: 15px;
    }
}

@media (max-width: 991px) {
    .dash-topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1020 !important;
        padding: 10px 14px !important;
    }
    .topbar-title {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        min-width: 0 !important;
        flex: 1 !important;
    }
    .topbar-title h1 {
        font-size: 1.05rem !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .dash-menu-toggle {
        display: inline-flex !important;
        width: 42px !important;
        height: 42px !important;
        font-size: 1.25rem !important;
        border-radius: 10px !important;
        flex-shrink: 0 !important;
    }
}

/* Devotee Dark Portal Topbar Overrides */
body.admin-body .dash-topbar {
    background: #0f1422;
    border-bottom: 1px solid rgba(234, 179, 8, 0.25);
    color: #f8fafc;
}
body.admin-body .dash-topbar .topbar-title h1 {
    color: #f8fafc;
}
body.admin-body .dash-menu-toggle {
    background: #1e293b;
    border: 1.5px solid rgba(234, 179, 8, 0.5);
    color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}
body.admin-body .dash-menu-toggle:hover {
    background: #fbbf24;
    color: #0f172a;
    border-color: #fbbf24;
}

@media (max-width: 768px) {
    .dash-topbar {
        padding: 10px 14px !important;
        flex-wrap: nowrap !important;
        gap: 10px;
    }
    .topbar-title h1 {
        font-size: 0.95rem !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card {
        padding: 14px;
        gap: 10px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.15rem;
    }
    .stat-details .stat-number {
        font-size: 1.25rem;
    }
    .user-profile-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 18px 16px;
    }
    .data-card {
        padding: 16px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
