@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-bg: #111827;
    --dark-surface: #1f2937;
    --dark-border: #374151;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-heading: #ffffff;
    --nav-active-bg: rgba(255, 255, 255, 0.05);
    --glass-bg: rgba(31, 41, 55, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --body-bg-image: none;
}

html[data-theme="theme-light-1"] {
    --dark-bg: #f3f4f6;
    --dark-surface: #ffffff;
    --dark-border: #e5e7eb;
    --text-main: #374151;
    --text-muted: #6b7280;
    --text-heading: #111827;
    --nav-active-bg: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --body-bg-image: none;
}

html[data-theme="theme-light-2"] {
    --dark-bg: #e0e7ff;
    --dark-surface: #ffffff;
    --dark-border: #c7d2fe;
    --text-main: #1e1b4b;
    --text-muted: #4f46e5;
    --text-heading: #312e81;
    --nav-active-bg: rgba(79, 70, 229, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(99, 102, 241, 0.2);
    --body-bg-image: none;
}

html[data-theme="theme-img-dark"] {
    --dark-bg: #111827;
    --dark-surface: rgba(17, 24, 39, 0.75);
    --dark-border: rgba(255, 255, 255, 0.1);
    --text-main: #f3f4f6;
    --text-muted: #d1d5db;
    --text-heading: #ffffff;
    --nav-active-bg: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(17, 24, 39, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --body-bg-image: url('../uploads/themes/dark_bg.png');
}

html[data-theme="theme-img-light"] {
    --dark-bg: #f3f4f6;
    --dark-surface: rgba(255, 255, 255, 0.85);
    --dark-border: rgba(0, 0, 0, 0.1);
    --text-main: #1f2937;
    --text-muted: #4b5563;
    --text-heading: #111827;
    --nav-active-bg: rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --body-bg-image: url('../uploads/themes/light_bg.png');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: var(--body-bg-image);
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}


/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #374151, #111827);
    padding: 20px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 24px;
}

.auth-card p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--dark-surface);
    border-right: 1px solid var(--dark-border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--dark-border);
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    background: var(--nav-active-bg);
    color: var(--text-heading);
    border-right: 3px solid var(--primary-color);
}

.nav-group {
    display: flex;
    flex-direction: column;
}

.nav-item-header {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    user-select: none;
}

.nav-item-header i:first-child {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item-header:hover {
    background: var(--nav-active-bg);
    color: var(--text-heading);
}

.sidebar-dropdown {
    background: rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 24px 10px 48px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.dropdown-item i {
    margin-right: 8px;
    font-size: 14px;
    width: 14px;
    text-align: center;
}

.dropdown-item:hover,
.dropdown-item.active {
    color: var(--text-heading);
    background: var(--nav-active-bg);
    border-right-color: var(--primary-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.topbar {
    height: 70px;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-heading);
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.content-wrapper {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
}

/* Cards & Widgets */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 16px;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.stat-details h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-details p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Tables */
.table-container {
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 16px 24px;
    text-align: left;
    border-bottom: 1px solid var(--dark-border);
}

th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.2);
}

td {
    font-size: 14px;
}

tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge.new {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}

.badge.assigned {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
}

.badge.processing {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.badge.approved {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

.badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    margin-right: 5px;
}

.action-btn:hover {
    background: var(--primary-color);
}

.action-btn.danger:hover {
    background: var(--danger-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
    padding-bottom: 20px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--dark-surface);
    border: 1px solid var(--dark-border);
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    cursor: default;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media print {
    .pagination {
        display: none !important;
    }
}

@media print {
    .sidebar, .topbar, .btn, .action-btn, .alert, .no-print, .no-print * {
        display: none !important;
    }

    .app-container {
        display: block !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        width: 100% !important;
    }

    .content-wrapper {
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    .table-container {
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        color: black !important;
        overflow: visible !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
        border: 1px solid #333 !important;
        margin-top: 10px !important;
    }

    th, td {
        border: 1px solid #333 !important;
        color: black !important;
        padding: 8px !important;
        font-size: 12px !important;
    }

    th {
        background: #f0f0f0 !important;
        text-transform: uppercase !important;
        -webkit-print-color-adjust: exact;
    }

    .table-header {
        padding: 10px 0 !important;
        border-bottom: 2px solid #333 !important;
        margin-bottom: 10px !important;
    }

    .table-title {
        font-size: 20px !important;
        font-weight: bold !important;
        color: black !important;
    }

    .badge {
        border: 1px solid #ccc !important;
        background: transparent !important;
        color: black !important;
    }

    * {
        color: black !important;
        text-shadow: none !important;
        box-shadow: none !important;
    }
}