/**
 * SIM AL-ASY'ARIYYAH
 * Main Stylesheet
 * 
 * Warna Yayasan: Hijau, Putih, Emas
 */

/* ============================================
   VARIABLES & RESET
   ============================================ */

:root {
    /* Warna Yayasan */
    --primary-green: #2d5016;
    --primary-green-light: #4a7c2c;
    --primary-green-dark: #1a3009;
    --gold: #d4af37;
    --gold-light: #f4cf5f;
    --gold-dark: #b8941f;

    /* Warna Netral */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.3s ease;
}

/* ============================================
   DARK MODE THEME
   ============================================ */

:root[data-theme="dark"] {
    /* Warna Netral - Inverted */
    --white: #1a1a2e;
    --gray-50: #16213e;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;

    /* Status Colors - Slightly brighter for dark bg */
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;

    /* Shadows - More visible on dark */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Dark mode body and background */
:root[data-theme="dark"] body {
    background-color: #0f0f23;
    color: #e0e0e0;
}

/* Dark mode general text */
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4,
:root[data-theme="dark"] h5,
:root[data-theme="dark"] h6 {
    color: #ffffff;
}

:root[data-theme="dark"] p,
:root[data-theme="dark"] span,
:root[data-theme="dark"] label,
:root[data-theme="dark"] div {
    color: inherit;
}

/* Dark mode cards */
:root[data-theme="dark"] .card {
    background-color: #1a1a2e;
    border: 1px solid #374151;
    color: #e0e0e0;
}

:root[data-theme="dark"] .card-header,
:root[data-theme="dark"] .card-title {
    color: #ffffff;
}

/* Dark mode sidebar - Very important for contrast */
:root[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0d1b2a, #1b263b);
}

:root[data-theme="dark"] .sidebar-link,
:root[data-theme="dark"] .sidebar-text {
    color: #e0e0e0 !important;
}

:root[data-theme="dark"] .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
}

:root[data-theme="dark"] .sidebar-link.active {
    background: rgba(45, 80, 22, 0.6);
    color: #ffffff !important;
}

:root[data-theme="dark"] .sidebar-icon {
    color: #d4af37;
}

:root[data-theme="dark"] .sidebar-section-title {
    color: #9ca3af;
}

:root[data-theme="dark"] .user-info-name,
:root[data-theme="dark"] .user-info-role {
    color: #e0e0e0;
}

/* Dark mode header */
:root[data-theme="dark"] .header {
    background: #1a1a2e;
    border-bottom: 1px solid #374151;
    color: #e0e0e0;
}

:root[data-theme="dark"] .header-title {
    color: #ffffff;
}

/* Dark mode inputs */
:root[data-theme="dark"] .form-control {
    background-color: #1f2937;
    border-color: #4b5563;
    color: #e0e0e0;
}

:root[data-theme="dark"] .form-control::placeholder {
    color: #9ca3af;
}

:root[data-theme="dark"] .form-control:focus {
    border-color: var(--primary-green-light);
    color: #ffffff;
}

:root[data-theme="dark"] .form-label {
    color: #d1d5db;
}

/* Dark mode tables */
:root[data-theme="dark"] table {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

:root[data-theme="dark"] thead {
    background-color: var(--primary-green);
}

:root[data-theme="dark"] thead th {
    color: #ffffff;
}

:root[data-theme="dark"] tbody tr {
    border-bottom: 1px solid #374151;
}

:root[data-theme="dark"] tbody td {
    color: #e0e0e0;
}

:root[data-theme="dark"] tbody tr:hover {
    background-color: #1f2937;
}

/* Dark mode modals */
:root[data-theme="dark"] .modal-content {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

:root[data-theme="dark"] .modal-header {
    border-bottom-color: #374151;
}

:root[data-theme="dark"] .modal-title {
    color: #ffffff;
}

:root[data-theme="dark"] .modal-footer {
    border-top-color: #374151;
}

/* Dark mode buttons */
:root[data-theme="dark"] .btn-outline {
    border-color: #6b7280;
    color: #e0e0e0;
}

:root[data-theme="dark"] .btn-outline:hover {
    background-color: #374151;
    color: #ffffff;
}

/* Dark mode badges */
:root[data-theme="dark"] .badge {
    color: #ffffff;
}

/* Dark mode stats cards */
:root[data-theme="dark"] .stat-card {
    background-color: #1a1a2e;
    color: #e0e0e0;
}

:root[data-theme="dark"] .stat-value {
    color: #ffffff;
}

:root[data-theme="dark"] .stat-label {
    color: #9ca3af;
}

/* Dark mode kepala sekolah cards */
:root[data-theme="dark"] .kepsek-card {
    background-color: #1a1a2e;
    border: 1px solid #374151;
}

:root[data-theme="dark"] .kepsek-sekolah,
:root[data-theme="dark"] .kepsek-value {
    color: #e0e0e0;
}

:root[data-theme="dark"] .kepsek-label {
    color: #9ca3af;
}

/* Dark mode toast */
:root[data-theme="dark"] .toast {
    background: #1a1a2e;
    color: #e0e0e0;
}

/* Dark mode dropdown */
:root[data-theme="dark"] .dropdown-menu {
    background-color: #1a1a2e;
    border: 1px solid #374151;
}

:root[data-theme="dark"] .dropdown-item {
    color: #e0e0e0;
}

:root[data-theme="dark"] .dropdown-item:hover {
    background-color: #1f2937;
}

/* Dark mode alert boxes */
:root[data-theme="dark"] .alert {
    border-color: #374151;
}

/* Dark mode empty states */
:root[data-theme="dark"] .empty-state {
    color: #9ca3af;
}

/* Dark mode profile request cards */
:root[data-theme="dark"] .request-card {
    background: #1a1a2e;
    color: #e0e0e0;
}

:root[data-theme="dark"] .request-name {
    color: #ffffff;
}

:root[data-theme="dark"] .request-nipy {
    color: #9ca3af;
}

/* Dark mode filter tabs */
:root[data-theme="dark"] .filter-tab {
    background: #374151;
    color: #e0e0e0;
}

:root[data-theme="dark"] .filter-tab.active {
    background: var(--primary-green);
    color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-green-dark);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-green-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--gold);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-error {
    background-color: var(--error);
    color: var(--white);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
}

.btn-outline:hover {
    background-color: var(--primary-green);
    color: var(--white);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 0.5rem;
    transition: var(--transition);
    background-color: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-control:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

.form-control.error {
    border-color: var(--error);
}

.form-error {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--error);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: 1.5rem;
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   TABLES
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
}

thead {
    background-color: var(--primary-green);
    color: var(--white);
}

thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition);
}

tbody tr:hover {
    background-color: var(--gray-50);
}

tbody td {
    padding: 1rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 1rem;
    text-align: center;
}

.badge-success {
    background-color: var(--success);
    color: var(--white);
}

.badge-primary {
    background-color: var(--info);
    color: var(--white);
}

.badge-warning {
    background-color: var(--warning);
    color: var(--white);
}

.badge-error {
    background-color: var(--error);
    color: var(--white);
}

.badge-info {
    background-color: #06b6d4;
    color: var(--white);
}

.badge-purple {
    background-color: #a855f7;
    color: var(--white);
}

.badge-dark {
    background-color: #1f2937;
    color: var(--white);
}

.badge-gray {
    background-color: var(--gray-400);
    color: var(--white);
}

.badge-pink {
    background-color: #ec4899;
    color: var(--white);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.toast {
    background-color: var(--white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease;
    position: relative;
    z-index: 10001;
    /* Higher than container z-index context if needed */
    overflow: hidden;
    /* Clip the rotating gradient */
    border: none;
    /* Remove default border to let RGB show */
}

/* RGB Gaming Border for Toast */
.toast::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            #ff0000,
            #ff8800,
            #ffff00,
            #00ff00,
            #00ffff,
            #0000ff,
            #ff00ff,
            #ff0000);
    z-index: -2;
    animation: rotate 4s linear infinite;
    opacity: 1;
}

.toast::after {
    content: '';
    position: absolute;
    inset: 3px;
    /* Border thickness */
    background: var(--white);
    /* Inner background */
    border-radius: 0.6rem;
    /* Slightly less than toast radius */
    z-index: -1;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.toast-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.toast-close:hover {
    color: var(--gray-600);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary-green);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-info {
    color: var(--info);
}

.text-gray {
    color: var(--gray-500);
}

.bg-primary {
    background-color: var(--primary-green);
}

.bg-success {
    background-color: var(--success);
}

.bg-warning {
    background-color: var(--warning);
}

.bg-error {
    background-color: var(--error);
}

.bg-info {
    background-color: var(--info);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.rounded {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   FILE UPLOAD & PROGRESS
   ============================================ */

.file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    background-color: var(--gray-50);
}

.file-upload-wrapper:hover,
.file-upload-wrapper.dragover {
    border-color: var(--primary-green);
    background-color: rgba(45, 80, 22, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder i {
    font-size: 3rem;
    color: var(--gray-400);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.file-upload-wrapper:hover .upload-placeholder i {
    color: var(--primary-green);
}

.img-preview {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
    margin-top: 1rem;
}

.progress-bar-container {
    width: 100%;
    background-color: var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
    height: 1.5rem;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-green);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    transition: width 0.3s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */


/* ============================================
   RGB CONFIRM MODAL
   ============================================ */

.rgb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rgb-modal-overlay.show {
    opacity: 1;
}

.rgb-modal-box {
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}

/* RGB Gaming Border Animation */
.rgb-modal-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg,
            #ff0000,
            #ff8800,
            #ffff00,
            #00ff00,
            #00ffff,
            #0000ff,
            #ff00ff,
            #ff0000);
    z-index: -2;
    animation: rotate 4s linear infinite;
    opacity: 1;
}

.rgb-modal-box::after {
    content: '';
    position: absolute;
    inset: 3px;
    /* Border thickness */
    background: #ffffff;
    /* Inner background matching modal */
    border-radius: 14px;
    /* Slightly less than box radius */
    z-index: -1;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.rgb-modal-overlay.show .rgb-modal-box {
    transform: scale(1);
}

.rgb-modal-content {
    background: transparent;
    /* Transparent to show ::after bg */
    padding: 24px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.rgb-modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    animation: bounce 1s infinite;
}

.rgb-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.rgb-modal-message {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 24px;
    line-height: 1.5;
}

.rgb-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.rgb-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.rgb-btn-cancel {
    background-color: #f3f4f6;
    color: #4b5563;
}

.rgb-btn-cancel:hover {
    background-color: #e5e7eb;
    color: #1f2937;
}

.rgb-btn-confirm {
    background-color: var(--primary-green);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
}

.rgb-btn-confirm:hover {
    background-color: var(--primary-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(16, 185, 129, 0.3);
}

.rgb-btn-danger {
    background-color: var(--error);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2);
}

.rgb-btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(239, 68, 68, 0.3);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

/* ============================================
   STANDARD MODALS (Added Fix)
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    margin: auto;
    padding: 0;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideDown 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    background-color: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--primary-green);
}

.close-btn {
    color: var(--gray-400);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--error);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    background-color: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Modal Form Styles */
.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-row .form-group {
        margin-bottom: 1rem;
    }
}

/* ============================================
   HEADER & USER MENU
   ============================================ */

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-bell {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: var(--error);
    color: var(--white);
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid var(--white);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-menu:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background-color: var(--primary-green);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
    text-align: left;
}

.user-name {
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    font-size: 1rem;
}

.user-role {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}


/* DARK MODE OVERRIDES */
[data-theme="dark"] {
    --white: #111827;
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);

    --bg-main: #1f2937;
    --text-main: #f9fafb;
}

[data-theme="dark"] body {
    background-color: var(--gray-50);
    color: var(--gray-900);
}

[data-theme="dark"] .card,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .header {
    background-color: var(--gray-50);
    border-color: var(--gray-100);
}

[data-theme="dark"] .sidebar-link:hover {
    background-color: var(--gray-200);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #374151;
    color: #fff;
    border-color: var(--gray-400);
}

[data-theme="dark"] table {
    color: var(--gray-900);
}

[data-theme="dark"] th {
    background-color: var(--gray-100);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--gray-200);
}