@font-face {
    font-family: "Aalabiya";
    src: url("assets/fonts/Aalabiya.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #061632;
    --bg-2: #0b2f6b;
    --card: rgba(255, 255, 255, 0.09);
    --card-border: rgba(255, 255, 255, 0.16);
    --text: #ffffff;
    --muted: #cbd5e1;

    --primary: #0b2f6b;
    --secondary: #c99a18;
    --gold-light: #f3d06a;
    --gold-dark: #9b7410;

    --success: #22c55e;
    --danger: #ef4444;
    --shadow: 0 24px 80px rgba(7, 26, 61, 0.42);
}

[data-bs-theme="light"] {
    --bg: #eef4ff;
    --bg-2: #ffffff;
    --card: rgba(255, 255, 255, 0.92);
    --card-border: rgba(11, 47, 107, 0.14);
    --text: #0f172a;
    --muted: #475569;
    --shadow: 0 24px 80px rgba(11, 47, 107, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Aalabiya", "Segoe UI", Tahoma, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(201, 154, 24, 0.22), transparent 34%),
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 34%),
        linear-gradient(135deg, #061632, #0b2f6b);
    overflow-x: hidden;
}

.app-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 24px;
    border-left: 1px solid var(--card-border);
    background: rgba(3, 12, 30, 0.34);
    backdrop-filter: blur(22px);
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 34px;
}

.brand-logo {
    width: 96px;
    height: 96px;
    min-width: 96px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(243, 208, 106, 0.38);
    box-shadow: 0 18px 45px rgba(201, 154, 24, 0.24);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
    display: block;
}

.brand h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 900;
    color: #ffffff;
}

.brand span {
    font-size: 14px;
    color: var(--muted);
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.menu-list a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 14px 16px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 18px;
    overflow: hidden;
    transition: 0.25s ease;
}

.menu-list a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 154, 24, 0.22), rgba(11, 47, 107, 0.45));
    opacity: 0;
    transition: 0.25s ease;
}

.menu-list a i,
.menu-list a span {
    position: relative;
    z-index: 1;
}

.menu-list a:hover,
.menu-list a.active {
    color: #ffffff;
    transform: translateX(-4px);
    box-shadow: 0 14px 40px rgba(201, 154, 24, 0.20);
}

.menu-list a:hover::before,
.menu-list a.active::before {
    opacity: 1;
}

.main-content {
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 4px;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    font-weight: 900;
}

.topbar h2,
.card-title-row h3 {
    margin: 0;
    font-weight: 900;
    color: #ffffff;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle,
.user-chip {
    min-height: 46px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    color: var(--text);
    backdrop-filter: blur(18px);
}

.theme-toggle {
    width: 46px;
    display: grid;
    place-items: center;
    cursor: pointer;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.glass-card {
    border: 1px solid var(--card-border);
    background: var(--card);
    backdrop-filter: blur(24px);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    padding: 22px;
    overflow: hidden;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(201, 154, 24, 0.11), transparent 55%);
    pointer-events: none;
}

.stat-card span {
    position: relative;
    color: var(--muted);
    font-size: 15px;
}

.stat-card strong {
    position: relative;
    display: block;
    font-size: 36px;
    margin-top: 8px;
    color: #ffffff;
}

.stat-card i {
    position: absolute;
    left: 22px;
    top: 22px;
    font-size: 40px;
    color: rgba(243, 208, 106, 0.42);
}

.content-grid {
    display: grid;
    grid-template-columns: 390px 1fr;
    gap: 22px;
}

.glass-card {
    padding: 24px;
}

.card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.card-title-row > i {
    font-size: 34px;
    color: var(--gold-light);
}

.form-label {
    color: #ffffff;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    background-color: rgba(255, 255, 255, 0.09);
    color: var(--text);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.64);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.25rem rgba(201, 154, 24, 0.18);
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.form-select option {
    background: #0b2f6b;
    color: #ffffff;
}

.neon-btn {
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    font-weight: 900;
    color: #171000;
    background: linear-gradient(135deg, #9b7410, #c99a18, #f3d06a);
    box-shadow: 0 18px 45px rgba(201, 154, 24, 0.32);
    transition: 0.25s ease;
}

.neon-btn:hover {
    transform: translateY(-2px);
    color: #171000;
    background: linear-gradient(135deg, #b88712, #d6a821, #ffe08a);
    box-shadow: 0 22px 55px rgba(201, 154, 24, 0.44);
}

.form-message {
    min-height: 24px;
    font-weight: 800;
}

.form-message.success {
    color: var(--success);
}

.form-message.error {
    color: var(--danger);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(270px, 100%);
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.09);
}

.search-box i {
    color: var(--gold-light);
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.64);
}

.modern-table {
    color: var(--text);
    margin: 0;
}

.modern-table thead th {
    color: var(--gold-light);
    font-size: 14px;
    border-bottom: 1px solid var(--card-border);
    white-space: nowrap;
}

.modern-table td {
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    white-space: nowrap;
}

.modern-table code {
    color: var(--gold-light);
    background: rgba(201, 154, 24, 0.13);
    padding: 4px 8px;
    border-radius: 8px;
}

.badge-category {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(201, 154, 24, 0.16);
    color: var(--gold-light);
    font-weight: 800;
}

.delete-btn {
    border: 0;
    border-radius: 12px;
    padding: 8px 11px;
    color: #ffffff;
    background: rgba(239, 68, 68, 0.86);
    transition: 0.2s ease;
}

.delete-btn:hover {
    transform: scale(1.05);
    background: rgba(220, 38, 38, 1);
}

.empty-state {
    padding: 45px 10px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: static;
    }

    .content-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .brand-logo {
        width: 82px;
        height: 82px;
        min-width: 82px;
    }
}

@media (max-width: 650px) {
    .main-content,
    .sidebar {
        padding: 16px;
    }

    .topbar,
    .card-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .brand-logo {
        width: 72px;
        height: 72px;
        min-width: 72px;
    }
}
.table-card {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.modern-table {
    min-width: 1200px;
}
.table-card {
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

.modern-table {
    min-width: 1200px;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 95px;
    padding: 7px 11px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 13px;
}

.stock-success {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.18);
    border: 1px solid rgba(34, 197, 94, 0.28);
}

.stock-warning {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.28);
}

.stock-danger {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.28);
}
/* =========================
   Responsive Dashboard Fixes
   لكل صفحات السايدبار
========================= */

.table-card {
    overflow: hidden;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.modern-table {
    min-width: 1100px;
}

/* موبايل وتابلت */
@media (max-width: 1100px) {
    .app-shell {
        display: grid;
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    .sidebar {
        position: relative;
        top: auto;
        height: auto;
        width: 100%;
        padding: 18px;
        border-left: 0;
        border-bottom: 1px solid var(--card-border);
    }

    .brand {
        margin-bottom: 18px;
    }

    .brand-logo {
        width: 74px;
        height: 74px;
        min-width: 74px;
        border-radius: 20px;
    }

    .brand h1 {
        font-size: 19px;
        line-height: 1.4;
    }

    .brand span {
        font-size: 13px;
    }

    .menu-list {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .menu-list li {
        flex: 0 0 auto;
    }

    .menu-list a {
        min-height: 46px;
        padding: 11px 14px;
        border-radius: 15px;
        white-space: nowrap;
    }

    .menu-list a:hover,
    .menu-list a.active {
        transform: translateY(-2px);
    }

    .main-content {
        padding: 18px;
    }

    .content-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
        justify-content: space-between;
    }

    .glass-card {
        padding: 18px;
        border-radius: 22px;
    }

    .stat-card {
        padding: 18px;
        border-radius: 22px;
    }

    .stat-card strong {
        font-size: 30px;
    }
}

/* موبايل صغير */
@media (max-width: 650px) {
    body {
        overflow-x: hidden;
    }

    .sidebar {
        padding: 14px;
    }

    .main-content {
        padding: 14px;
    }

    .brand {
        align-items: center;
        gap: 10px;
    }

    .brand-logo {
        width: 62px;
        height: 62px;
        min-width: 62px;
        border-radius: 18px;
    }

    .brand-logo img {
        padding: 5px;
    }

    .brand h1 {
        font-size: 16px;
        line-height: 1.35;
    }

    .brand span {
        font-size: 12px;
    }

    .menu-list {
        gap: 8px;
    }

    .menu-list a {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    .menu-list a i {
        font-size: 15px;
    }

    .topbar h2 {
        font-size: 22px;
    }

    .eyebrow {
        font-size: 11px;
    }

    .stats-grid {
        gap: 12px;
        margin-bottom: 16px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .stat-card i {
        font-size: 30px;
        left: 16px;
        top: 16px;
    }

    .card-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .card-title-row h3 {
        font-size: 20px;
    }

    .search-box {
        width: 100%;
    }

    .form-control,
    .form-select {
        min-height: 46px;
        font-size: 15px;
    }

    .neon-btn {
        min-height: 48px;
        font-size: 15px;
    }

    .modern-table {
        min-width: 1000px;
        font-size: 14px;
    }

    .modern-table thead th,
    .modern-table td {
        padding: 10px 12px;
    }

    .user-chip {
        min-height: 42px;
        padding: 0 13px;
    }

    .theme-toggle {
        width: 42px;
        min-height: 42px;
    }
}

/* موبايل صغير جدًا */
@media (max-width: 420px) {
    .brand h1 {
        font-size: 14px;
    }

    .brand-logo {
        width: 54px;
        height: 54px;
        min-width: 54px;
    }

    .menu-list a span {
        font-size: 13px;
    }

    .topbar h2 {
        font-size: 20px;
    }

    .glass-card,
    .stat-card {
        border-radius: 18px;
    }
}