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

:root {
    --bg-base: #0b0f19;
    --bg-surface: rgba(17, 24, 39, 0.7);
    --bg-surface-hover: rgba(31, 41, 55, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --color-primary: #8b5cf6;
    --color-primary-glow: rgba(139, 92, 246, 0.35);
    --color-secondary: #06b6d4;
    --color-secondary-glow: rgba(6, 182, 212, 0.35);
    --color-focus: #22d3ee;
    --color-focus-border: rgba(34, 211, 238, 0.65);
    --color-focus-glow: rgba(34, 211, 238, 0.28);
    
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.6), 0 12px 15px -8px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--color-primary-glow);
    
    --sidebar-width: 220px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(6, 182, 212, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* App Layout */
.app-container {
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 110;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.5rem;
    margin-bottom: 0;
    min-width: 0;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--color-primary-glow);
    font-weight: 700;
    color: white;
    font-size: 1rem;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 1rem 0 0.35rem 0.35rem;
    font-weight: 600;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid transparent;
}

.nav-item a i {
    font-size: 0.9rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-item a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
    padding-left: 1.25rem;
}

.nav-item.active a {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(6, 182, 212, 0.05));
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: inset 0 0 12px rgba(139, 92, 246, 0.15);
}

.nav-item.active a i {
    color: var(--color-secondary);
    filter: drop-shadow(0 0 5px var(--color-secondary-glow));
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #22d3ee);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e1b4b;
    font-weight: 600;
    font-size: 0.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

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

.user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    min-width: 0;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-sizing: border-box;
}

/* Top Navigation / Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.top-header-text {
    flex: 1;
    min-width: 0;
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sidebar-toggle:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 105;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

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

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.theme-toggle:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-hover);
    color: var(--color-primary);
}

.theme-toggle .theme-icon-monokai {
    color: var(--color-secondary);
}

/* Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

/* Stat Card Specifics */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: var(--text-primary);
}

.stat-icon.primary {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--color-primary);
}

.stat-icon.secondary {
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--color-secondary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--color-success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger), #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    filter: brightness(1.1);
}

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

/* Table Styling */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    padding: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.custom-table td {
    padding: 1.15rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-draft {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-processing {
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.operation-status-form {
    margin: 0;
    min-width: 8.5rem;
}

.operation-status-select {
    width: 100%;
    min-width: 8.5rem;
    padding: 0.2rem 1.75rem 0.2rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 30px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.5rem center;
    background-size: 10px 6px;
}

[dir="rtl"] .operation-status-select {
    padding: 0.2rem 0.5rem 0.2rem 1.75rem;
    background-position: right 0.5rem center;
}

.operation-status-select.badge-draft {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border-color: rgba(245, 158, 11, 0.3);
}

.operation-status-select.badge-processing {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--color-info);
    border-color: rgba(59, 130, 246, 0.3);
}

.operation-status-select.badge-completed {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border-color: rgba(16, 185, 129, 0.3);
}

.operation-timeline-card .card-title i {
    margin-inline-end: 0.5rem;
    opacity: 0.85;
}

.operation-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.operation-timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.25rem;
    position: relative;
}

.operation-timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 1.1rem;
    bottom: 0;
    inset-inline-start: 0.45rem;
    width: 2px;
    background: var(--border-color);
}

.operation-timeline-marker {
    flex-shrink: 0;
    width: 0.95rem;
    height: 0.95rem;
    margin-top: 0.15rem;
    border-radius: 50%;
    background: var(--color-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    z-index: 1;
}

.operation-timeline-body {
    flex: 1;
    min-width: 0;
}

.operation-timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.operation-timeline-user {
    color: var(--text-secondary);
}

.operation-timeline-user i {
    margin-inline-end: 0.35rem;
    opacity: 0.75;
}

.operation-timeline-action {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.operation-timeline-changes {
    margin: 0;
    padding-inline-start: 1.1rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.operation-timeline-changes li + li {
    margin-top: 0.2rem;
}

.operation-change-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.operation-change-row + .operation-change-row {
    margin-top: 0.5rem;
}

.operation-change-field {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.operation-change-values {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    font-size: 0.88rem;
}

.operation-change-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-inline-end: 0.35rem;
}

.operation-change-value {
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.operation-change-value--from {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.45);
}

.operation-change-value--to {
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
}

.operation-change-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.7;
}

.operation-history-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-control:focus,
.form-control:focus-visible {
    outline: none;
    border-color: var(--color-focus-border);
    box-shadow: 0 0 0 3px var(--color-focus-glow), 0 0 14px rgba(34, 211, 238, 0.18);
    background: rgba(17, 24, 39, 0.85);
}

.login-form input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

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

/* Table Actions column */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

/* Dynamic operation items editor */
.operation-items-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.operation-items-table th {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.operation-items-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: none;
}

/* Keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard dynamic aesthetics */
.welcome-card {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Quick view list cards */
.list-item-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

/* Loading overlays or pulse animations */
.pulse {
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
    }
}

/* RTL layout */
html[dir="rtl"] .sidebar {
    right: 0;
    left: auto;
    border-right: none;
    border-left: 1px solid var(--border-color);
}

html[dir="rtl"] .main-content {
    width: calc(100% - var(--sidebar-width));
    margin-right: var(--sidebar-width);
    margin-left: 0;
}

html[dir="rtl"] .brand {
    padding-right: 0.5rem;
    padding-left: 0;
}

html[dir="rtl"] .nav-item a:hover {
    padding-right: 1.25rem;
    padding-left: 1rem;
}

html[dir="rtl"] .error-list {
    margin-right: 1rem;
    margin-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .actions-cell {
    justify-content: flex-start !important;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

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

/* Operation form — compact semi-desktop layout */
.operation-form-card {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

.operation-form-compact {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.operation-form-compact .form-group {
    margin-bottom: 0.65rem;
}

.operation-form-compact .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.operation-form-compact .form-control {
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
}

.operation-form-compact .form-control-mono {
    font-family: monospace;
    font-weight: 700;
    color: var(--color-secondary);
}

.operation-form-compact .form-control-compact {
    min-height: 2.5rem;
    resize: vertical;
}

.operation-form-compact .form-static-value {
    display: flex;
    align-items: center;
    min-height: 2.05rem;
    padding: 0.45rem 0.65rem;
    background: rgba(17, 24, 39, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.operation-form-compact .form-row {
    gap: 0.75rem;
}

.operation-form-compact .form-row-4 {
    grid-template-columns: 1.1fr 1fr 0.75fr 1fr;
}

.operation-form-compact .form-row-3,
.operation-form-compact .form-row-product {
    grid-template-columns: repeat(3, 1fr);
}

.operation-form-compact .form-row-product {
    grid-template-columns: 2fr 0.75fr 0.75fr;
}

.operation-form-card .form-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 992px) {
    .operation-form-compact .form-row-4,
    .operation-form-compact .form-row-3,
    .operation-form-compact .form-row-product {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .operation-form-card {
        padding: 1rem;
    }

    .operation-form-compact .form-row-4,
    .operation-form-compact .form-row-3,
    .operation-form-compact .form-row-product {
        grid-template-columns: 1fr;
    }
}

/* Guest / Login */
.guest-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.guest-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    padding: 2rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand h1 {
    font-size: 1.5rem;
    margin-top: 1rem;
}

.login-brand p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.35rem;
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.remember-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-block-logout {
    width: 100%;
    margin-top: 0.75rem;
    justify-content: center;
}

.logout-form {
    margin-top: 0.5rem;
}

.badge-role-admin {
    background: rgba(139, 92, 246, 0.25);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.badge-role-manager {
    background: rgba(6, 182, 212, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(6, 182, 212, 0.35);
}

.badge-role-data_entry {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

html[dir="rtl"] th[style*="text-align: right"],
html[dir="rtl"] td[style*="text-align: right"] {
    text-align: left !important;
}

/* Desktop: collapse sidebar */
@media (min-width: 993px) {
    body.sidebar-collapsed .sidebar {
        transform: translate3d(-100%, 0, 0);
    }

    html[dir="rtl"] body.sidebar-collapsed .sidebar {
        transform: translate3d(100%, 0, 0);
    }

    body.sidebar-collapsed .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Mobile / tablet: off-canvas sidebar (must come after RTL rules) */
@media (max-width: 992px) {
    .sidebar {
        transform: translate3d(-100%, 0, 0);
    }

    html[dir="rtl"] .sidebar {
        transform: translate3d(100%, 0, 0);
    }

    html[dir="rtl"] body.sidebar-open .sidebar,
    body.sidebar-open .sidebar {
        transform: translate3d(0, 0, 0);
    }

    .sidebar-close {
        display: flex;
    }

    .main-content {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 1rem;
        gap: 1.25rem;
    }

    .top-header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.35rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

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

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

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .btn {
        min-height: 44px;
    }
}

/* White Monokai light theme */
[data-theme="monokai"] {
    --bg-base: #f8f8f2;
    --bg-surface: rgba(255, 255, 255, 0.88);
    --bg-surface-hover: rgba(245, 245, 240, 0.95);
    --border-color: rgba(39, 40, 34, 0.12);
    --border-hover: rgba(39, 40, 34, 0.22);

    --color-primary: #a6e22e;
    --color-primary-glow: rgba(166, 226, 46, 0.35);
    --color-secondary: #66d9ef;
    --color-secondary-glow: rgba(102, 217, 239, 0.35);
    --color-focus: #66d9ef;
    --color-focus-border: rgba(102, 217, 239, 0.65);
    --color-focus-glow: rgba(102, 217, 239, 0.28);

    --color-success: #a6e22e;
    --color-warning: #fd971f;
    --color-danger: #f92672;
    --color-info: #ae81ff;

    --text-primary: #272822;
    --text-secondary: #75715e;
    --text-muted: #908e7a;

    --shadow-sm: 0 2px 8px rgba(39, 40, 34, 0.08);
    --shadow-md: 0 10px 25px -5px rgba(39, 40, 34, 0.1), 0 8px 10px -6px rgba(39, 40, 34, 0.08);
    --shadow-lg: 0 20px 35px -10px rgba(39, 40, 34, 0.12), 0 12px 15px -8px rgba(39, 40, 34, 0.1);
}

[data-theme="monokai"] body {
    background-image:
        radial-gradient(at 10% 20%, rgba(166, 226, 46, 0.1) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(102, 217, 239, 0.1) 0px, transparent 50%);
}

[data-theme="monokai"] ::-webkit-scrollbar-thumb {
    background: rgba(39, 40, 34, 0.15);
}

[data-theme="monokai"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 40, 34, 0.25);
}

[data-theme="monokai"] .sidebar {
    background: rgba(245, 245, 240, 0.98);
}

[data-theme="monokai"] .sidebar-close,
[data-theme="monokai"] .sidebar-toggle {
    background: rgba(39, 40, 34, 0.04);
}

[data-theme="monokai"] .sidebar-close:hover,
[data-theme="monokai"] .sidebar-toggle:hover {
    background: rgba(39, 40, 34, 0.08);
}

[data-theme="monokai"] .brand-name {
    background: linear-gradient(to right, #272822, #66a80f);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="monokai"] .nav-item a:hover {
    background: rgba(39, 40, 34, 0.04);
    border-color: rgba(39, 40, 34, 0.06);
}

[data-theme="monokai"] .nav-item.active a {
    color: #272822;
    background: linear-gradient(135deg, rgba(166, 226, 46, 0.22), rgba(102, 217, 239, 0.08));
    border-color: rgba(166, 226, 46, 0.35);
    box-shadow: inset 0 0 12px rgba(166, 226, 46, 0.12);
}

[data-theme="monokai"] .sidebar-overlay {
    background: rgba(39, 40, 34, 0.4);
}

[data-theme="monokai"] .btn-primary {
    background: linear-gradient(135deg, #a6e22e, #86b825);
    box-shadow: 0 4px 15px rgba(166, 226, 46, 0.3);
}

[data-theme="monokai"] .btn-primary:hover {
    box-shadow: 0 6px 20px rgba(166, 226, 46, 0.45);
}

[data-theme="monokai"] .btn-secondary {
    background: rgba(39, 40, 34, 0.04);
}

[data-theme="monokai"] .btn-secondary:hover {
    background: rgba(39, 40, 34, 0.08);
    border-color: rgba(39, 40, 34, 0.15);
    color: var(--text-primary);
}

[data-theme="monokai"] .custom-table tbody tr:hover {
    background: rgba(39, 40, 34, 0.03);
}

[data-theme="monokai"] .badge-secondary {
    background: rgba(39, 40, 34, 0.06);
}

[data-theme="monokai"] .alert-success {
    background: rgba(166, 226, 46, 0.15);
    color: #4a5f1a;
    border-color: rgba(166, 226, 46, 0.35);
}

[data-theme="monokai"] .alert-danger {
    background: rgba(249, 38, 114, 0.12);
    color: #9d1a52;
    border-color: rgba(249, 38, 114, 0.3);
}

[data-theme="monokai"] .form-control {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-primary);
    border-color: rgba(39, 40, 34, 0.15);
}

[data-theme="monokai"] .form-control:focus,
[data-theme="monokai"] .form-control:focus-visible {
    background: #fff;
    box-shadow: 0 0 0 3px var(--color-focus-glow), 0 0 14px rgba(102, 217, 239, 0.15);
}

[data-theme="monokai"] .operation-items-box {
    background: rgba(39, 40, 34, 0.03);
}

[data-theme="monokai"] .operation-items-table th {
    border-bottom-color: rgba(39, 40, 34, 0.1);
}

[data-theme="monokai"] .welcome-card {
    background: linear-gradient(135deg, rgba(166, 226, 46, 0.18) 0%, rgba(248, 248, 242, 0.95) 100%);
    border-color: rgba(166, 226, 46, 0.28);
}

[data-theme="monokai"] .glass-card::before {
    background: linear-gradient(135deg, rgba(39, 40, 34, 0.02) 0%, transparent 100%);
}

[data-theme="monokai"] .operation-form-compact .form-static-value {
    background: rgba(255, 255, 255, 0.75);
}

[data-theme="monokai"] .badge-role-admin {
    background: rgba(174, 129, 255, 0.15);
    color: #7c4dcc;
    border-color: rgba(174, 129, 255, 0.3);
}

[data-theme="monokai"] .badge-role-manager {
    background: rgba(102, 217, 239, 0.15);
    color: #0891b2;
    border-color: rgba(102, 217, 239, 0.3);
}

[data-theme="monokai"] .badge-role-data_entry {
    background: rgba(166, 226, 46, 0.15);
    color: #5a7a18;
    border-color: rgba(166, 226, 46, 0.3);
}

[data-theme="monokai"] .theme-toggle:hover {
    color: var(--color-warning);
}
