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

/* ==========================================================================
   CSS Variables & Theme Definitions
   ========================================================================== */

/* 1. Dark Mode (Default) */
:root,
[data-theme="dark"] {
    --primary: #059669;
    --primary-hover: #10b981;
    --primary-dark: #064e3b;
    --primary-light: #ecfdf5;
    --primary-border: #a7f3d0;
    
    --bg-main: #090e12;
    --bg-surface: #111d24;
    --bg-card: #16242c;
    --bg-card-hover: #1d2f3a;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #1e3a47;
    --border-glow: rgba(16, 185, 129, 0.25);
    
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.14);
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.35), 0 2px 4px -2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.45), 0 4px 6px -4px rgba(0, 0, 0, 0.35);
    
    --font-kurdish: 'NRT', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 2. Colorful Mode (Clean Crisp White Background with Vivid Colorful Modules) */
[data-theme="colorful"] {
    --primary: #059669;
    --primary-hover: #10b981;
    --primary-dark: #047857;
    --primary-light: #ecfdf5;
    --primary-border: #a7f3d0;
    
    --bg-main: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --border-color: #e2e8f0;
    --border-glow: rgba(16, 185, 129, 0.2);
    
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --info: #0284c7;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.07), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 30px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.05);
}

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

html, body {
    direction: rtl;
    text-align: right;
    font-family: var(--font-kurdish);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Background Ambient Glows */
.bg-decor {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.glow-orb-1 {
    position: absolute;
    top: -100px;
    right: 12%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0) 70%);
    border-radius: 50%;
    filter: blur(50px);
    transition: all 0.5s ease;
}

.glow-orb-2 {
    position: absolute;
    bottom: -120px;
    left: 8%;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.12) 0%, rgba(14, 165, 233, 0) 70%);
    border-radius: 50%;
    filter: blur(55px);
    transition: all 0.5s ease;
}

/* White & Colorful Mode Orbs (Soft Pastel Lighting) */
[data-theme="colorful"] .glow-orb-1 {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0) 70%);
}
[data-theme="colorful"] .glow-orb-2 {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.07) 0%, rgba(59, 130, 246, 0) 70%);
}

/* App Container */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 1420px;
    margin: 0 auto;
    padding: 24px;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 28px;
    backdrop-filter: blur(14px);
    transition: all 0.3s ease;
}

[data-theme="colorful"] .navbar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.brand-logo-wrap:hover {
    transform: scale(1.05);
}

[data-theme="colorful"] .brand-logo-wrap {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

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

.nav-center {
    flex: 1;
    max-width: 460px;
}

.search-input-wrap {
    position: relative;
    width: 100%;
}

.search-input-wrap svg {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 42px 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: var(--bg-surface);
}

[data-theme="colorful"] .search-input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}
[data-theme="colorful"] .search-input:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

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

/* Theme Switcher Button */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

[data-theme="colorful"] .theme-toggle-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
[data-theme="colorful"] .theme-toggle-btn:hover {
    border-color: #059669;
    color: #059669;
    background: #f8fafc;
}

.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
}

[data-theme="colorful"] .user-badge {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #0284c7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: bold;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-role-pill {
    font-size: 0.72rem;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-radius: 12px;
}

[data-theme="colorful"] .user-role-pill {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.btn-nav-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-nav-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

[data-theme="colorful"] .btn-nav-action {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
[data-theme="colorful"] .btn-nav-action:hover {
    background: #f8fafc;
    border-color: #059669;
    color: #059669;
}

.btn-logout {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-logout:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: #fca5a5;
}

[data-theme="colorful"] .btn-logout {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}
[data-theme="colorful"] .btn-logout:hover {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}

/* ==========================================================================
   Stats Banner
   ========================================================================== */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-border);
}

[data-theme="colorful"] .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
[data-theme="colorful"] .stat-card:hover {
    border-color: #059669;
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.12);
}

.stat-info .stat-label {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .stat-val {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon-wrap.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.stat-icon-wrap.blue {
    background: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
}
.stat-icon-wrap.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="colorful"] .stat-icon-wrap.green {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
[data-theme="colorful"] .stat-icon-wrap.blue {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}
[data-theme="colorful"] .stat-icon-wrap.amber {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* ==========================================================================
   Section Header
   ========================================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-badge {
    font-size: 0.8rem;
    padding: 5px 12px;
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="colorful"] .section-badge {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   Dashboard 19 Buttons Grid
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 18px;
}

.module-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.module-card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, 0.45), 0 0 16px rgba(16, 185, 129, 0.2);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card:active {
    transform: translateY(-2px) scale(0.99);
}

.module-icon-box {
    width: 62px;
    height: 62px;
    border-radius: 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.module-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    transition: color 0.2s ease;
}

.module-card:hover .module-name {
    color: #34d399;
}

.module-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Dark Mode Theme Colors for Icons
   -------------------------------------------------------------------------- */
.theme-emerald {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.25), rgba(4, 120, 87, 0.15));
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}
.theme-blue {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.25), rgba(3, 105, 161, 0.15));
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: #38bdf8;
}
.theme-indigo {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(79, 70, 229, 0.15));
    border: 1px solid rgba(129, 140, 248, 0.35);
    color: #a5b4fc;
}
.theme-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(147, 51, 234, 0.15));
    border: 1px solid rgba(192, 132, 252, 0.35);
    color: #d8b4fe;
}
.theme-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.15));
    border: 1px solid rgba(251, 191, 36, 0.35);
    color: #fcd34d;
}
.theme-teal {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(13, 148, 136, 0.15));
    border: 1px solid rgba(45, 212, 191, 0.35);
    color: #5eead4;
}
.theme-rose {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.25), rgba(225, 29, 72, 0.15));
    border: 1px solid rgba(251, 113, 133, 0.35);
    color: #fda4af;
}

/* ==========================================================================
   COLORFUL MODE (WHITE BACKGROUND + VIVID COLORFUL MODULES)
   ========================================================================== */
[data-theme="colorful"] .module-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

[data-theme="colorful"] .module-card:hover {
    background: #ffffff;
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
}

[data-theme="colorful"] .module-card .module-name {
    color: #0f172a;
}
[data-theme="colorful"] .module-card:hover .module-name {
    color: #059669;
}
[data-theme="colorful"] .module-card .module-desc {
    color: #64748b;
}

/* Colorful Icon Boxes on White Surface */
[data-theme="colorful"] .module-card .module-icon-box {
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    color: #ffffff;
    border: none;
}

/* Individual Module Accent Colors in Colorful White Mode */
[data-theme="colorful"] .module-card[data-id="raw_materials"] .module-icon-box {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}
[data-theme="colorful"] .module-card[data-id="raw_materials"]:hover {
    border-color: #10b981;
}

[data-theme="colorful"] .module-card[data-id="factory_warehouse"] .module-icon-box {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
}
[data-theme="colorful"] .module-card[data-id="factory_warehouse"]:hover {
    border-color: #0284c7;
}

[data-theme="colorful"] .module-card[data-id="second_warehouse"] .module-icon-box {
    background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}
[data-theme="colorful"] .module-card[data-id="second_warehouse"]:hover {
    border-color: #4f46e5;
}

[data-theme="colorful"] .module-card[data-id="transfer"] .module-icon-box {
    background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}
[data-theme="colorful"] .module-card[data-id="transfer"]:hover {
    border-color: #0d9488;
}

[data-theme="colorful"] .module-card[data-id="manufacturing"] .module-icon-box {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}
[data-theme="colorful"] .module-card[data-id="manufacturing"]:hover {
    border-color: #7c3aed;
}

[data-theme="colorful"] .module-card[data-id="report_manufacturing"] .module-icon-box {
    background: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.35);
}
[data-theme="colorful"] .module-card[data-id="report_manufacturing"]:hover {
    border-color: #d97706;
}

[data-theme="colorful"] .module-card[data-id="purchases"] .module-icon-box {
    background: linear-gradient(135deg, #16a34a 0%, #4ade80 100%);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
}
[data-theme="colorful"] .module-card[data-id="purchases"]:hover {
    border-color: #16a34a;
}

[data-theme="colorful"] .module-card[data-id="report_purchases"] .module-icon-box {
    background: linear-gradient(135deg, #0369a1 0%, #38bdf8 100%);
    box-shadow: 0 6px 16px rgba(3, 105, 161, 0.35);
}
[data-theme="colorful"] .module-card[data-id="report_purchases"]:hover {
    border-color: #0369a1;
}

[data-theme="colorful"] .module-card[data-id="sales"] .module-icon-box {
    background: linear-gradient(135deg, #047857 0%, #34d399 100%);
    box-shadow: 0 6px 16px rgba(4, 120, 87, 0.35);
}
[data-theme="colorful"] .module-card[data-id="sales"]:hover {
    border-color: #047857;
}

[data-theme="colorful"] .module-card[data-id="report_sales"] .module-icon-box {
    background: linear-gradient(135deg, #6366f1 0%, #a5b4fc 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}
[data-theme="colorful"] .module-card[data-id="report_sales"]:hover {
    border-color: #6366f1;
}

[data-theme="colorful"] .module-card[data-id="delegates"] .module-icon-box {
    background: linear-gradient(135deg, #db2777 0%, #f472b6 100%);
    box-shadow: 0 6px 16px rgba(219, 39, 119, 0.35);
}
[data-theme="colorful"] .module-card[data-id="delegates"]:hover {
    border-color: #db2777;
}

[data-theme="colorful"] .module-card[data-id="debts_companies"] .module-icon-box {
    background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
    box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
}
[data-theme="colorful"] .module-card[data-id="debts_companies"]:hover {
    border-color: #e11d48;
}

[data-theme="colorful"] .module-card[data-id="debts_delegates"] .module-icon-box {
    background: linear-gradient(135deg, #ea580c 0%, #fb923c 100%);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
}
[data-theme="colorful"] .module-card[data-id="debts_delegates"]:hover {
    border-color: #ea580c;
}

[data-theme="colorful"] .module-card[data-id="cashbox"] .module-icon-box {
    background: linear-gradient(135deg, #ca8a04 0%, #facc15 100%);
    box-shadow: 0 6px 16px rgba(202, 138, 4, 0.35);
}
[data-theme="colorful"] .module-card[data-id="cashbox"]:hover {
    border-color: #ca8a04;
}

[data-theme="colorful"] .module-card[data-id="advances"] .module-icon-box {
    background: linear-gradient(135deg, #0891b2 0%, #22d3ee 100%);
    box-shadow: 0 6px 16px rgba(8, 145, 178, 0.35);
}
[data-theme="colorful"] .module-card[data-id="advances"]:hover {
    border-color: #0891b2;
}

[data-theme="colorful"] .module-card[data-id="expenses"] .module-icon-box {
    background: linear-gradient(135deg, #dc2626 0%, #f87171 100%);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
}
[data-theme="colorful"] .module-card[data-id="expenses"]:hover {
    border-color: #dc2626;
}

[data-theme="colorful"] .module-card[data-id="waste_loss"] .module-icon-box {
    background: linear-gradient(135deg, #c2410c 0%, #f97316 100%);
    box-shadow: 0 6px 16px rgba(194, 65, 12, 0.35);
}
[data-theme="colorful"] .module-card[data-id="waste_loss"]:hover {
    border-color: #c2410c;
}

[data-theme="colorful"] .module-card[data-id="users"] .module-icon-box {
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
[data-theme="colorful"] .module-card[data-id="users"]:hover {
    border-color: #2563eb;
}

[data-theme="colorful"] .module-card[data-id="payroll"] .module-icon-box {
    background: linear-gradient(135deg, #059669 0%, #34d399 100%);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35);
}
[data-theme="colorful"] .module-card[data-id="payroll"]:hover {
    border-color: #059669;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background-color: var(--bg-main);
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

[data-theme="colorful"] .login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: linear-gradient(135deg, #059669, #047857);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
    color: #fff;
}

[data-theme="colorful"] .login-logo {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.28);
}

.login-title {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-sub {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: 20px;
}

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

.input-wrap {
    position: relative;
}

.input-wrap svg.icon-start {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 12px 42px 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: #0d171d;
}

[data-theme="colorful"] .input-wrap input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
[data-theme="colorful"] .input-wrap input:focus {
    background: #ffffff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-toggle-pwd {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}
.btn-toggle-pwd:hover {
    color: var(--text-primary);
}

.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}

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

.alert-warning {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

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

[data-theme="colorful"] .alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}
[data-theme="colorful"] .alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
[data-theme="colorful"] .alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
}

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.modal-backdrop.show .modal-box {
    transform: scale(1);
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-head h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
}
.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

[data-theme="colorful"] .modal-footer {
    background: #f8fafc;
}

.btn-secondary {
    padding: 9px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
}
.btn-secondary:hover {
    background: var(--bg-card-hover);
}

[data-theme="colorful"] .btn-secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}
[data-theme="colorful"] .btn-secondary:hover {
    background: #f1f5f9;
}

/* Hide the browser's increment/decrement controls on number fields. */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-center {
        max-width: 100%;
    }
    .nav-user-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .module-card {
        padding: 16px 12px;
    }
    .module-icon-box {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
    }
    .module-name {
        font-size: 0.92rem;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
