:root {
    --primary-color: #000000;
    --accent-color: #FFD386;
    --text-light: #ffffff;
    --text-dark: #000000;
    --bg-dark: #121212;
    --bg-darker: #0a0a0a;
    --card-bg: rgba(20, 20, 20, 0.85);
    --border-color: rgba(255, 211, 134, 0.3);
    --hover-bg: rgba(255, 211, 134, 0.15);
    
    --font-primary: 'Tajawal', sans-serif;
    --font-numbers: 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--primary-color);
    color: var(--text-light);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: #fff;
}

.hidden {
    display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

/* Background Video */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--primary-color);
}
#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: filter 1.5s ease;
}
.video-blurred {
    filter: blur(10px) brightness(0.4);
}
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
}

/* Auth Module */
#auth-module {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease;
}
#auth-module.visible {
    opacity: 1;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}
.brand-logo {
    max-width: 120px;
    margin-bottom: 15px;
}
.auth-header h1 {
    font-size: 24px;
    color: var(--accent-color);
}
.auth-header p {
    font-size: 14px;
    color: #ccc;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ddd;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-light);
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 211, 134, 0.2);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}
.btn-primary {
    background: var(--accent-color);
    color: var(--text-dark);
}
.btn-primary:hover {
    background: #e6be79;
    transform: translateY(-2px);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    margin-top: 10px;
}
.btn-secondary:hover {
    background: var(--hover-bg);
}
.btn-danger {
    background: #e74c3c;
    color: white;
}
.btn-success {
    background: #2ecc71;
    color: white;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 13px;
}

.form-scroll {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 10px;
}

/* App Module Layout */
#app-module {
    display: flex;
    height: 100vh;
    background: var(--bg-dark);
}

.sidebar {
    width: 260px;
    background: var(--bg-darker);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
}
.sidebar.collapsed {
    width: 80px;
}
.sidebar.collapsed .sidebar-logo {
    max-width: 40px;
}
.sidebar.collapsed nav a span {
    display: none;
}
.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-logo {
    max-width: 100px;
    transition: max-width var(--transition-normal);
}
.sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}
.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ccc;
    font-size: 15px;
    border-right: 3px solid transparent;
}
.sidebar nav a i {
    width: 25px;
    font-size: 18px;
    text-align: center;
    margin-left: 15px;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: var(--hover-bg);
    color: var(--accent-color);
    border-right-color: var(--accent-color);
}
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}
.btn-logout {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}
.btn-logout:hover {
    background: #e74c3c;
    color: white;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    cursor: pointer;
    transition: color var(--transition-fast);
    position: relative;
}
.icon-btn:hover {
    color: var(--accent-color);
}
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-family: var(--font-numbers);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 25px;
}
.datetime-display {
    font-family: var(--font-numbers);
    font-size: 14px;
    color: #aaa;
}
.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.content-area {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-dark);
}

/* Dashboard Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform var(--transition-fast);
}
.kpi-card:hover {
    transform: translateY(-5px);
}
.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: var(--hover-bg);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.kpi-info h3 {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 5px;
}
.kpi-info p {
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font-numbers);
    color: var(--accent-color);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
@media (max-width: 992px) {
    .dashboard-sections { grid-template-columns: 1fr; }
}
.panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.data-table th {
    color: var(--accent-color);
    font-weight: 600;
}
.data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}
.badge-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.status-pending { background: #f39c12; color: #fff; }
.status-approved { background: #2ecc71; color: #fff; }
.status-rejected { background: #e74c3c; color: #fff; }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}
.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body {
    padding: 20px;
    overflow-y: auto;
}
.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast Notification */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: var(--card-bg);
    border-right: 4px solid var(--accent-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideInLeft 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}
@keyframes slideInLeft {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Utilities */
.text-center { text-align: center; }
.mt-3 { margin-top: 15px; }
.mb-3 { margin-bottom: 15px; }

/* Settings View specific */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}
.color-picker-wrapper input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Messages */
.message-thread {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}
.msg-sender { color: var(--accent-color); font-weight: bold; }
.msg-date { font-size: 12px; color: #888; font-family: var(--font-numbers); }

/* Notifications Dropdown */
.notification-wrapper {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 15px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(15px);
}
.dropdown-menu.hidden {
    display: none !important;
}
.dropdown-header {
    background: rgba(255,211,134,0.1);
    padding: 15px;
    font-weight: bold;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255,211,134,0.2);
    text-align: center;
}
.dropdown-body {
    max-height: 300px;
    overflow-y: auto;
}
.dropdown-item {
    transition: background var(--transition-fast);
}
.dropdown-item:hover {
    background: rgba(255,211,134,0.1);
}
.text-accent {
    color: var(--accent-color);
}
