/* =============================================
   ASAD ADVANCED APK — Premium Design System
   ============================================= */

/* ---- Reset & Foundation ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-dark: #f0f2f5;
    --bg-deeper: #e8eaed;
    --card-bg: #ffffff;
    --card-bg-hover: #fafbfc;
    --primary: #22c55e;
    --primary-light: #4ade80;
    --primary-dark: #16a34a;
    --primary-gradient: linear-gradient(135deg, #22c55e, #16a34a);
    --secondary-gradient: linear-gradient(135deg, #3b82f6, #2563eb);
    --accent-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
    --danger-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --warning-gradient: linear-gradient(135deg, #f59e0b, #d97706);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-soft: #e2e8f0;
    --border-hover: #cbd5e1;
    --sidebar-bg: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    background-color: var(--bg-dark);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0 auto;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    max-width: 100vw;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ---- Dark Theme ---- */
body.dark-theme {
    --bg-dark: #0a0b10;
    --bg-deeper: #06070a;
    --card-bg: #141520;
    --card-bg-hover: #1a1b28;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-soft: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --sidebar-bg: #0f1018;
    --glass-bg: rgba(20, 21, 32, 0.8);
    --glass-border: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

body.dark-theme .form-control {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

body.dark-theme .auth-toggle {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-theme .auth-toggle a.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ---- Page Load Animation ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.main-content {
    padding: 20px 20px 100px 20px;
    animation: fadeInUp 0.5s var(--transition-slow);
    max-width: 100%;
}

/* ---- Navbar ---- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition-normal);
}

.status-spacer {
    height: 0;
    /* Safe area for mobile status bar */
    height: env(safe-area-inset-top, 0);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    min-width: 0;
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.brand-text h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.wallet-chip {
    background: rgba(34, 197, 94, 0.08);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.15);
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.wallet-chip:hover {
    background: rgba(34, 197, 94, 0.15);
    transform: translateY(-1px);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
}

/* ---- Brand Strip / Hero ---- */
.brand-strip {
    background: var(--card-bg);
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.brand-strip::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(34, 197, 94, 0.08), transparent 70%);
    pointer-events: none;
}

.welcome-msg {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
}

.sub-msg {
    color: var(--text-secondary);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.stat-icon.s-1 { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.stat-icon.s-2 { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.stat-icon.s-3 { color: #eab308; background: rgba(234, 179, 8, 0.1); }

.stat-text { min-width: 0; }

.stat-text strong {
    display: block;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
}

.stat-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---- Card Grid ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    max-width: 100%;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: 0;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    animation: fadeInUp 0.5s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-hover);
}

.card:active {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.card-body {
    padding: 24px 16px;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-sm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ---- Bottom Navigation ---- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
    border-top: 1px solid var(--border-soft);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item:hover {
    color: var(--primary-light);
}

.nav-item i {
    font-size: 1.15rem;
    transition: transform var(--transition-normal);
}

/* ---- Auth Card ---- */
.auth-card {
    background: var(--card-bg);
    padding: 32px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-lg);
    animation: fadeInUp 0.5s ease;
}

.auth-toggle {
    display: flex;
    background-color: #f1f5f9;
    border-radius: var(--radius-full);
    padding: 4px;
    margin-bottom: 30px;
    width: 100%;
}

.auth-toggle a {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.auth-toggle a.active {
    color: var(--text-primary);
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* ---- Form Controls ---- */
.form-control {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    background: #f8fafc;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* ---- Alerts ---- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeInUp 0.3s ease;
}

.alert-success, .alert.success {
    background-color: rgba(34, 197, 94, 0.08);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert-danger, .alert.error {
    background-color: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.08);
    color: #2563eb;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ---- Status Badges ---- */
.status-badge {
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.status-active, .status-completed { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.status-pending, .status-processing { background: rgba(245, 158, 11, 0.1); color: #d97706; }
.status-failed, .status-disabled { background: rgba(239, 68, 68, 0.1); color: #dc2626; }
.status-maintenance { background: rgba(139, 92, 246, 0.1); color: #7c3aed; }

/* ---- Modal / Bottom Sheet ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.bottom-sheet {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-soft);
    border-radius: var(--radius-full);
    margin: 0 auto 16px auto;
}

.sheet-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}

.sheet-img {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-md);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.sheet-title-area {
    min-width: 0;
    flex: 1;
}

.sheet-title-area h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
    word-break: break-word;
}

.sheet-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.sheet-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.sheet-price-old {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.sheet-content {
    margin-bottom: 20px;
}

.sheet-content h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.sheet-content p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.sheet-actions {
    display: flex;
    gap: 10px;
}

.sheet-actions .btn-primary,
.sheet-actions .btn-secondary {
    flex: 1;
    text-align: center;
    text-decoration: none;
    padding: 12px;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-dark);
    padding: 12px 24px;
    border-radius: var(--radius-full);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    opacity: 0;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-xl);
    white-space: nowrap;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ---- Media Gallery ---- */
.media-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
    margin: 0;
}

.media-item {
    width: 100%;
    max-height: 250px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-dark);
    box-shadow: var(--shadow-sm);
}

/* =============================================
   ADMIN PANEL STYLES
   ============================================= */

.admin-layout {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: all var(--transition-normal);
    z-index: 50;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    margin-bottom: 30px;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.brand-icon-box {
    background: var(--primary-gradient);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    flex-shrink: 0;
}

.sidebar-menu {
    list-style: none;
    padding: 0 14px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    position: relative;
}

.sidebar-menu li a i {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition-normal);
}

.sidebar-menu li a:hover {
    color: var(--text-primary);
    background: rgba(34, 197, 94, 0.04);
}

.sidebar-menu li a:hover i {
    transform: scale(1.1);
}

.sidebar-menu li a.active {
    color: var(--primary);
    background: rgba(34, 197, 94, 0.08);
    font-weight: 600;
}

.sidebar-menu li a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-gradient);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-soft);
    margin: 12px 20px;
}

/* ---- Admin Content ---- */
.admin-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    animation: fadeInUp 0.4s ease;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.3;
}

.page-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.stat-icon-wrapper.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.stat-icon-wrapper.blue { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon-wrapper.yellow { background: rgba(234, 179, 8, 0.1); color: #eab308; }
.stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.arrow-up {
    position: absolute;
    top: 24px;
    right: 24px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    font-weight: 500;
}

.stat-chart {
    margin-top: auto;
    height: 40px;
    display: flex;
    align-items: flex-end;
}

/* ---- Form Card ---- */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 28px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    transition: all var(--transition-normal);
}

.form-card:hover {
    box-shadow: var(--shadow-lg);
}

.form-card h3 {
    margin: 0 0 20px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Table Card ---- */
.table-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    font-size: 0.9rem;
}

th {
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

td {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
    word-break: break-word;
}

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

tr:hover td {
    background: rgba(34, 197, 94, 0.02);
}

/* ---- Generator Card ---- */
.generator-card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-soft);
    margin-bottom: 28px;
    box-shadow: var(--shadow-md);
}

.generator-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* ---- Code Box ---- */
.code-box {
    background: rgba(34, 197, 94, 0.06);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(34, 197, 94, 0.12);
    color: var(--primary);
    letter-spacing: 0.5px;
}

/* ---- File Upload ---- */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border-soft);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-normal);
    background: rgba(34, 197, 94, 0.02);
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(34, 197, 94, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 16, 0.92);
    z-index: 10;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--primary);
    backdrop-filter: blur(4px);
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.9rem;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* ---- Tablet & Below ---- */
@media (max-width: 1024px) {
    .admin-content {
        padding: 24px;
    }
}

/* ---- Mobile Landscape & Tablet Portrait ---- */
@media (max-width: 768px) {
    /* Admin Layout → Stacked */
    .admin-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid var(--border-soft);
        padding: 12px 0;
        flex-direction: column;
    }

    .sidebar-brand {
        margin-bottom: 10px;
        padding: 8px 16px;
        font-size: 1rem;
    }

    .sidebar-menu {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 10px;
        gap: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }

    .sidebar-menu li a {
        padding: 8px 14px;
        white-space: nowrap;
        font-size: 0.8rem;
        border-radius: var(--radius-full);
        gap: 6px;
    }

    .sidebar-menu li a::before {
        display: none !important;
    }

    .sidebar-menu li a span.menu-text {
        display: inline;
    }

    .sidebar-divider {
        display: none;
    }

    .admin-content {
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    /* Table → Card Layout on mobile */
    .table-card {
        padding: 12px;
        overflow-x: hidden;
    }

    table, thead, tbody, th, td, tr {
        display: block;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        margin-bottom: 12px;
        padding: 4px;
        box-shadow: var(--shadow-sm);
        background: var(--card-bg);
    }

    td {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid var(--border-soft);
        padding: 10px 14px;
        text-align: left;
        word-break: break-word;
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        font-size: 0.7rem;
        text-transform: uppercase;
        margin-bottom: 4px;
        letter-spacing: 0.5px;
    }

    /* Form cards */
    .form-card, .generator-card {
        padding: 18px;
    }

    .form-card form[style*="grid-template-columns"] {
        display: flex !important;
        flex-direction: column !important;
    }

    .generator-form {
        flex-direction: column;
        align-items: stretch;
    }

    /* Stats row → 1 column */
    .stat-card {
        padding: 18px;
    }
}

/* ---- Mobile Portrait ---- */
@media (max-width: 600px) {
    .stats-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .navbar {
        padding: 10px 14px;
    }

    .brand-text h1 {
        font-size: 0.95rem;
    }

    .wallet-chip {
        font-size: 0.78rem;
        padding: 5px 10px;
    }

    .main-content {
        padding: 14px 14px 100px 14px;
    }

    .welcome-msg {
        font-size: 1.3rem;
    }

    .stat-box {
        padding: 12px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .auth-card {
        padding: 24px 18px;
    }

    /* Admin dashboard stats */
    .card-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ---- Very Small Screens ---- */
@media (max-width: 380px) {
    .brand-text h1 {
        font-size: 0.85rem;
    }

    .nav-actions {
        gap: 6px;
    }

    .wallet-chip {
        font-size: 0.72rem;
        padding: 4px 8px;
    }
}

/* ---- Prevent Horizontal Scroll Globally ---- */
html, body, .main-content, .admin-content, .admin-layout {
    max-width: 100vw;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

input, textarea, select, button {
    max-width: 100%;
}

/* ---- Print Styles ---- */
@media print {
    .sidebar, .bottom-nav, .navbar {
        display: none;
    }
    .admin-content {
        padding: 0;
    }
}
