/* ==========================================================================
   Beoyny Dashboard — Premium Design System (RTL)
   Version: 2.0
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* Brand Colors (Logo) */
    --primary: #995234;
    --primary-hover: #85462c;
    --primary-light: rgba(153, 82, 52, 0.08);
    --primary-glow: rgba(153, 82, 52, 0.25);

    /* Logo Secondary Colors */
    --logo-gold: #FFFFFF;

    /* Semantic Colors */
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.1);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.1);
    --info: #3B82F6;
    --info-light: rgba(59, 130, 246, 0.1);

    /* Sidebar (Dark Theme) */
    --sidebar-bg: #423124;
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-active-bg: rgba(153, 82, 52, 0.3);
    --sidebar-active-text: #FFFFFF;
    --sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --sidebar-border: rgba(255, 255, 255, 0.05);

    /* Surface & Background */
    --bg-body: #F1F5F9;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F8FAFC;
    --bg-input: #F8FAFC;

    /* Typography */
    --text-primary: #2C3331;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-inverse: #FFFFFF;

    /* Borders */
    --border-color: #E2E8F0;
    --border-focus: var(--primary);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: 150ms var(--ease-out);
    --transition-normal: 250ms var(--ease-out);
    --transition-slow: 350ms var(--ease-out);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

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

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar — Premium Dark
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow: hidden;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    gap: 0.75rem;
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.75rem;
    line-height: 1;
}

.sidebar-brand {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text-inverse);
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--sidebar-border) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-border);
    border-radius: 10px;
}

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--sidebar-text);
    padding: 1.25rem 0.75rem 0.5rem;
    letter-spacing: 1px;
    font-weight: 700;
    opacity: 0.6;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 0.9rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-md);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    gap: 0.75rem;
    position: relative;
    white-space: nowrap;
}

.nav-item .nav-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--sidebar-hover-bg);
    color: #CBD5E1;
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 700;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 3px 0 0 3px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-footer-text {
    font-size: 0.65rem;
    color: var(--sidebar-text);
    opacity: 0.5;
    text-align: center;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-wrapper {
    flex: 1;
    min-width: 0;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin var(--transition-slow);
    background: var(--bg-body);
}

/* ==========================================================================
   Top Header — Glass
   ========================================================================== */
.top-header {
    height: var(--header-height);
    background: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Info Button — Rule #2 */
.btn-info-circle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.btn-info-circle:hover {
    background: var(--primary);
    color: var(--text-inverse);
    transform: scale(1.05);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* User Profile */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.8rem 0.35rem 0.35rem;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-menu:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* ==========================================================================
   Content Area
   ========================================================================== */
.content-area {
    padding: 1.75rem;
    flex: 1;
    width: 100%;
}

/* ==========================================================================
   Cards — Multiple Variants
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(153, 82, 52, 0.12);
    box-shadow: 0 4px 20px -2px rgba(66, 49, 36, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 10px 25px -4px rgba(66, 49, 36, 0.08);
    transform: translateY(-2px);
}

.card-body {
    padding: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(153, 82, 52, 0.08);
    background: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stat Cards */
.stat-card {
    background: #FFFFFF;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(153, 82, 52, 0.12);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px -3px rgba(66, 49, 36, 0.04);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -5px rgba(66, 49, 36, 0.09);
    border-color: rgba(153, 82, 52, 0.25);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    border-radius: var(--radius-full);
}

.stat-card.stat-primary::after {
    background: linear-gradient(90deg, #995234, #C7633F);
}

.stat-card.stat-success::after {
    background: linear-gradient(90deg, #2E7D32, #4CAF50);
}

.stat-card.stat-warning::after {
    background: linear-gradient(90deg, #D48806, #E29B22);
}

.stat-card.stat-info::after {
    background: linear-gradient(90deg, #423124, #995234);
}

.stat-card.stat-danger::after {
    background: linear-gradient(90deg, #C62828, #E53935);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: transform var(--transition-fast);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-primary .stat-icon {
    background: rgba(153, 82, 52, 0.12);
    color: #995234;
}

.stat-success .stat-icon {
    background: rgba(46, 125, 50, 0.1);
    color: #2E7D32;
}

.stat-warning .stat-icon {
    background: rgba(226, 155, 34, 0.12);
    color: #D48806;
}

.stat-danger .stat-icon {
    background: rgba(198, 40, 40, 0.1);
    color: #C62828;
}

.stat-info .stat-icon {
    background: rgba(66, 49, 36, 0.12);
    color: #423124;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    margin-top: 0.5rem;
}

.stat-change.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-change.down {
    background: var(--danger-light);
    color: var(--danger);
}

/* ==========================================================================
   Data Table — Premium
   ========================================================================== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.table-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.table-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.table-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.table-search::before {
    content: '🔍';
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    pointer-events: none;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: var(--bg-body);
    padding: 0.85rem 1rem;
    text-align: right;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table Pagination */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 0.35rem;
}

.pagination-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    transition: all var(--transition-fast);
}

.pagination-btn:hover {
    background: var(--bg-body);
}

.pagination-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(153, 82, 52, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(153, 82, 52, 0.35);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-outline {
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-ghost {
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.form-required {
    color: var(--danger);
    margin-right: 2px;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.3rem;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='%2394A3B8' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 16px 12px;
    padding-left: 2.5rem;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    padding: 0;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-normal);
    box-shadow: var(--shadow-xl);
    max-height: 85vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2,
.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-start;
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    min-width: 300px;
    max-width: 420px;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(-120%);
    transition: transform 0.4s var(--ease-spring);
    font-weight: 600;
    font-size: 0.875rem;
    border-right: 4px solid transparent;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-right-color: var(--success);
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
    border-right-color: var(--danger);
}

.toast.error .toast-icon {
    color: var(--danger);
}

.toast.warning {
    border-right-color: var(--warning);
}

.toast.warning .toast-icon {
    color: var(--warning);
}

.toast-content {
    flex: 1;
    color: var(--text-primary);
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    gap: 0.3rem;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-gray {
    background: #F1F5F9;
    color: var(--text-muted);
}

.badge-role {
    background: var(--primary-light);
    color: var(--primary);
}

/* ==========================================================================
   Empty States & Skeletons
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite ease-in-out;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ==========================================================================
   Activity List
   ========================================================================== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--primary);
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    color: var(--text-secondary);
    line-height: 1.5;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ==========================================================================
   Grid System
   ========================================================================== */
.grid {
    display: grid;
    gap: 1.25rem;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-2-1 {
    grid-template-columns: 2fr 1fr;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.d-flex {
    display: flex;
}

.d-none {
    display: none;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.align-start {
    align-items: flex-start;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 0.75rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.ml-auto {
    margin-left: auto;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.text-center {
    text-align: center;
}

.text-primary-color {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

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

.text-sm {
    font-size: 0.8rem;
}

.text-xs {
    font-size: 0.7rem;
}

.text-lg {
    font-size: 1.15rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.rounded-full {
    border-radius: var(--radius-full);
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.w-full {
    width: 100%;
}

/* ==========================================================================
   Mobile Overlay
   ========================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ==========================================================================
   Login Page — Special Layout
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #FDF7F4 0%, #F8EFEA 50%, #EAD5CA 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(153, 82, 52, 0.15), transparent 70%);
    top: -100px;
    right: -100px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.1), transparent 70%);
    bottom: -80px;
    left: -80px;
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.7);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 3rem;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(153, 82, 52, 0.3);
    margin-top: 0.5rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(153, 82, 52, 0.4);
}

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

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Responsive — Tablet
   ========================================================================== */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2-1 {
        grid-template-columns: 1fr;
    }

    .content-area {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   Responsive — Mobile
   ========================================================================== */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .sidebar {
        right: 0 !important;
        transform: translateX(100%) !important;
        transition: transform var(--transition-slow) !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .sidebar-overlay {
        display: block;
    }

    .main-wrapper {
        margin-right: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-area {
        padding: 1rem;
    }

    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .grid-2-1 {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 0 1rem;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search {
        max-width: 100%;
    }

    .user-name {
        display: none;
    }

    .user-menu {
        padding: 0.25rem;
    }

    .toast {
        min-width: auto;
        max-width: calc(100vw - 3rem);
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 0 1rem;
        border-radius: var(--radius-lg);
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .header-title {
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {

    .sidebar,
    .top-header,
    .btn,
    .toast-container,
    .modal-overlay {
        display: none !important;
    }

    .main-wrapper {
        margin: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    body {
        background: white;
    }
}

/* ==========================================================================
   Scrollbar (Custom)
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ==========================================================================
   Selection
   ========================================================================== */
::selection {
    background: var(--primary-glow);
    color: var(--primary-hover);
}