:root {
    --admin-bg: #050505;
    --admin-bg-soft: #0d0d0d;
    --admin-card: #141414;
    --admin-card-soft: #1b1b1b;
    --admin-gold: #d4af37;
    --admin-gold-soft: #f5dc8a;
    --admin-gold-deep: #a8861f;
    --admin-danger: #ff4d4f;
    --admin-success: #20bf6b;
    --admin-info: #4b7bec;
    --admin-text: #ffffff;
    --admin-muted: #9b9b9b;
    --admin-border: rgba(255, 255, 255, 0.08);
    --admin-glass: rgba(20, 20, 20, 0.84);
    --admin-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
    color: var(--admin-text);
    background:
        radial-gradient(circle at 90% -20%, rgba(212, 175, 55, 0.16) 0, transparent 45%),
        radial-gradient(circle at 10% 120%, rgba(212, 175, 55, 0.08) 0, transparent 40%),
        linear-gradient(180deg, #0a0a0a 0%, var(--admin-bg) 42%, #030303 100%);
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    padding-bottom: 96px;
}

@supports (padding: max(0px)) {
    body {
        padding-bottom: max(96px, calc(96px + env(safe-area-inset-bottom)));
    }
}

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

.container {
    width: min(960px, 100%);
    margin-inline: auto;
    padding: 20px;
}

.page-shell {
    width: min(960px, 100%);
    margin-inline: auto;
    padding: 22px 20px 120px;
}

.page-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.page-title {
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: var(--admin-gold);
}

.page-subtitle {
    margin-top: 6px;
    color: var(--admin-muted);
    font-size: 0.92rem;
}

.surface-card {
    border: 1px solid var(--admin-border);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(23, 23, 23, 0.92), rgba(7, 7, 7, 0.92));
    box-shadow: var(--admin-shadow);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--admin-border);
    background: var(--admin-glass);
    backdrop-filter: blur(10px);
}

.user-info h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--admin-gold-soft);
}

.user-info p {
    margin: 2px 0 0;
    color: var(--admin-muted);
    font-size: 0.78rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--admin-gold);
    background: #111;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 999;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px 8px;
    background: rgba(10, 10, 10, 0.96);
    border-top: 1px solid var(--admin-border);
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.45);
}

.bottom-nav::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--admin-gold), transparent);
    opacity: 0.9;
}

.nav-item {
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.64rem;
    color: #686868;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-item i {
    font-size: 1.15rem;
}

.nav-item.active {
    color: var(--admin-gold-soft);
}

.nav-item.active i {
    transform: translateY(-3px);
    color: var(--admin-gold);
}

.nav-item.logout-nav.active,
.nav-item.logout-nav:active {
    color: var(--admin-danger);
}

.fab-wrapper {
    position: relative;
    width: 56px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.fab {
    position: absolute;
    top: -38px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 4px solid var(--admin-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #090909;
    font-size: 1.45rem;
    background: linear-gradient(140deg, var(--admin-gold-deep), var(--admin-gold), var(--admin-gold-soft));
    box-shadow: 0 10px 24px rgba(212, 175, 55, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.fab:active {
    transform: scale(0.96);
}

/* Add Menu */
.add-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.24s ease;
}

@media (max-width: 900px) {
    .header,
    .add-menu-overlay {
        backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.add-menu-content {
    width: min(620px, 100%);
    border-top: 2px solid var(--admin-gold);
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, #171717, #101010);
    padding: 24px 18px 20px;
    transform: translateY(100%);
    transition: transform 0.24s ease;
}

.add-menu-content.show {
    transform: translateY(0);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.action-btn:hover {
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateX(-3px);
    background: rgba(255, 255, 255, 0.05);
}

.ab-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ab-text h4 {
    margin: 0 0 3px;
    font-size: 0.97rem;
}

.ab-text p {
    margin: 0;
    color: var(--admin-muted);
    font-size: 0.78rem;
}

.close-menu-btn {
    width: 100%;
    margin-top: 8px;
    border: 1px solid #414141;
    background: transparent;
    color: var(--admin-muted);
    border-radius: 999px;
    padding: 11px 14px;
    cursor: pointer;
}

.close-menu-btn:hover {
    border-color: var(--admin-danger);
    color: var(--admin-danger);
}

/* Generic Buttons + Inputs */
.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 10px;
    color: #0a0a0a;
    font-weight: 800;
    background: linear-gradient(135deg, var(--admin-gold), var(--admin-gold-deep));
    cursor: pointer;
}

.btn-ghost {
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    padding: 8px 14px;
    color: #d7d7d7;
    background: rgba(255, 255, 255, 0.03);
}

.form-control,
input,
select,
textarea {
    font-family: inherit;
}

.smart-banner {
    border: 1px solid rgba(212, 175, 55, 0.28);
    border-right: 4px solid var(--admin-gold);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(212, 175, 55, 0.09);
    color: #f0e1ac;
    margin-bottom: 14px;
    font-size: 0.9rem;
}

.smart-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.smart-chip {
    border-radius: 10px;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, 0.02);
    padding: 9px 10px;
    color: #d6d6d6;
    font-size: 0.8rem;
}

.empty-state,
.error-state,
.loading-state {
    border-radius: 14px;
    padding: 34px 20px;
    text-align: center;
    border: 1px dashed var(--admin-border);
    background: rgba(255, 255, 255, 0.02);
}

/* Toast */
.portal-toast-wrap {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-toast {
    min-width: 220px;
    max-width: min(92vw, 360px);
    padding: 11px 13px;
    border-radius: 11px;
    border: 1px solid var(--admin-border);
    color: #fff;
    background: rgba(16, 16, 16, 0.95);
    box-shadow: var(--admin-shadow);
    font-size: 0.86rem;
}

.portal-toast.info { border-color: rgba(75, 123, 236, 0.35); }
.portal-toast.success { border-color: rgba(32, 191, 107, 0.35); }
.portal-toast.error { border-color: rgba(255, 77, 79, 0.45); }

@media (max-width: 768px) {
    .smart-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding-inline: 14px;
    }

    .container,
    .page-shell {
        padding-inline: 14px;
    }
}
