:root {
    --bg-color: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --panel-bg-hover: rgba(249, 250, 251, 1);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 210px; /* Further reduced from 230px */
}

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: #f8fafc;
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 0.75rem; /* Reduced base font size to 12px for high density */
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    padding: 1rem 0.75rem; /* More compact sidebar */
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #111827;
    letter-spacing: -0.5px;
    background: -webkit-linear-gradient(120deg, #2563eb, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.user-info {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.user-name {
    font-weight: 600;
    color: #111827;
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.logout-container {
    margin-top: auto;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 0.5rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    transition: background 0.2s;
    font-weight: 600;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.top-bar .btn-logout {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: white;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.25rem 1.5rem; /* Reduced from 2rem */
    max-width: 1750px; /* Increased to allow more width */
    width: 100%;
    margin: 0 auto;
}

.main-content.full-width {
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 1.25rem; /* Further reduced from 1.4rem */
    color: #1e293b;
    font-weight: 700;
    margin-bottom: 0.15rem;
    letter-spacing: -0.5px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Glass Panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 16px;
    padding: 1rem; /* Further reduced from 1.25rem */
    backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 15px 30px rgba(0,0,0,0.04);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.glass-panel:hover {
    box-shadow: 0 30px 60px rgba(0,0,0,0.1);
}

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

.form-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-row label {
    flex: none;
    margin-bottom: 0.25rem;
    font-weight: 600;
    color: #374151;
    text-align: left;
}

.form-row .form-control-wrapper {
    flex: 1;
}

.form-card {
    margin: 0 auto;
}

.text-center-form .form-row {
    align-items: center;
}

.text-center-form .form-row label {
    text-align: center;
}

.text-center-form .form-actions {
    justify-content: center;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .form-row label {
        flex: 0 0 auto;
        text-align: left;
    }
    .form-actions {
        margin-left: 0 !important;
        justify-content: center;
    }
}

/* Action Rows (Dashboard List) */
.action-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-row {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    transition: all 0.2s ease;
    text-decoration: none;
}

.action-row:hover {
    border-color: var(--primary);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    background: #f8fafc;
}

.action-row .icon {
    font-size: 1.5rem;
    margin-right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 10px;
}

.action-row .text-info {
    flex: 1;
}

.action-row .action-title {
    font-weight: 600;
    display: block;
    margin-bottom: 0.1rem;
}

.action-row .action-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.action-row .arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    opacity: 0.5;
}

.btn-secondary {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #111827;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: 0.4rem 0.6rem; /* Even more compact inputs */
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

input:focus, select:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.8rem; /* Even more compact buttons */
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.4);
    filter: brightness(1.1);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

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

.btn-block {
    display: block;
    width: 100%;
}

.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-4 { margin-top: 2rem !important; }
.text-center { text-align: center !important; }
.max-w-md { max-width: 500px; }

/* Dashboard Login */
.login-wrapper {
    width: 100%;
    max-width: 480px;
}

.login-card {
    padding: 3rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.login-header h2 {
    color: #1e293b;
    font-size: 1.8rem; /* Smaller login title */
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.75px;
}

.login-header p {
    color: #64748b;
    font-weight: 500;
    font-size: 0.85rem; /* Smaller subtext */
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 1.5rem; /* Reduced from 1.8rem */
    color: #111827;
    font-weight: 700;
}

/* Action Grid */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #111827;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.action-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.action-card span {
    font-weight: 500;
}

.action-card:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.06);
    color: var(--primary);
}

/* Tables */
.table-container {
    overflow-x: auto;
    padding: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 0.35rem 0.5rem; /* Ultra-compact table cells */
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem; /* 12px */
}

.data-table td {
    white-space: normal;
}

.data-table th, .data-table .no-wrap {
    white-space: nowrap;
}

/* Cleaner Scrollbars */
.table-container::-webkit-scrollbar {
    height: 5px;
    width: 5px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.data-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #4b5563;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-submitted { background: rgba(245, 158, 11, 0.15); color: #d97706; border: 1px solid rgba(245, 158, 11, 0.2); }
.status-verified { background: rgba(37, 99, 235, 0.15); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.2); }
.status-approved { background: rgba(139, 92, 246, 0.15); color: #7c3aed; border: 1px solid rgba(139, 92, 246, 0.2); }
.status-paid { background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid rgba(16, 185, 129, 0.2); }
.status-rejected { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* Grid Cards (Actions) */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.action-item-card {
    display: flex;
    flex-direction: column;
}

.card-info {
    margin-bottom: 1.5rem;
}

.item-id {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.card-info .amount {
    font-size: 1.5rem;
    color: #111827;
    margin: 0.5rem 0;
    font-weight: 700;
}

.sub-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.inline-form {
    margin-top: auto;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.inline-form .form-group {
    margin-bottom: 1rem !important;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    border: 1px dashed var(--border-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1000;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #f8fafc;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 260px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        overflow-y: auto;
        background: #ffffff;
        border-right: 1px solid var(--border-color);
        box-shadow: 10px 0 25px rgba(0,0,0,0.05);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        padding: 1rem;
        padding-top: 70px !important; /* Make room for the toggle button */
        width: 100%;
    }
    
    /* Ensure tables can be horizontally scrolled natively */
    .table-container {
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    
    /* Responsive Card Tables for Mobile */
    .mobile-card-table, .mobile-card-table tbody, .mobile-card-table tr, .mobile-card-table td {
        display: block;
        width: 100%;
    }
    .mobile-card-table thead, .mobile-card-table th {
        display: none; /* Hide standard headers */
    }
    .mobile-card-table tr {
        margin-bottom: 1rem;
        background: #fff;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
        padding: 0.5rem;
    }
    .mobile-card-table td {
        display: flex;
        flex-direction: column;
        border-bottom: 1px solid #f1f5f9;
        padding: 0.75rem 0.5rem;
        text-align: left !important;
    }
    .mobile-card-table td:last-child {
        border-bottom: none;
    }
    .mobile-card-table td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.65rem;
        color: var(--text-muted);
        margin-bottom: 0.35rem;
        display: block;
    }
    
    /* Responsive stats cards */
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

