/* assets/css/style.css */

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --danger-color: #e63946;
    --text-dark: #2b2d42;
    --text-light: #8d99ae;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-md: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background-color: #edf2f4;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
}

/* -- Sidebar -- */
.sidebar {
    width: 260px;
    background: var(--white);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    transition: all 0.3s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 3rem;
    padding: 0 0.5rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: transparent;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.brand-text h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-light);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-links li a:hover, .nav-links li a.active {
    background: #eef2ff;
    color: var(--primary-color);
}

.nav-links li a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.user-profile {
    margin-top: auto;
    padding: 1rem;
    background: #f8faff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #dbeafe;
    border-radius: 50%;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.user-info p {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* -- Main Content -- */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    width: calc(100% - 260px);
}

/* -- Dashboard Cards -- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-info h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-info h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

.icon-box {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.bg-blue { background: #e0e7ff; color: #4361ee; }
.bg-orange { background: #ffedd5; color: #f97316; }
.bg-green { background: #dcfce7; color: #22c55e; }
.bg-purple { background: #f3e8ff; color: #a855f7; }

/* -- Tables -- */
.table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    background: #f8fafc;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-dark);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: #fff7ed; color: #c2410c; }
.status-approved { background: #f0fdf4; color: #15803d; }
.status-rejected { background: #fef2f2; color: #b91c1c; }

/* -- Forms & Inputs -- */
.form-group {
    margin-bottom: 1rem;
}

/* -- Buttons -- */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* -- Login Page Specific -- */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    width: 100%;
    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);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.25rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

/* -- Modal -- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* -- Footer -- */
.footer {
    position: fixed;
    bottom: 0;
    left: 260px;
    right: 0;
    background: var(--white);
    border-top: 1px solid #e9ecef;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
    z-index: 100;
}

.footer-content {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.footer-content p {
    margin: 0;
}

/* Adjust main content to account for footer */
.main-content,
main {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .footer {
        left: 0;
        padding: 0.8rem 1rem;
    }
    
    .footer-content {
        font-size: 0.8rem;
    }
}

/* -- Utilities -- */
.hidden { display: none; }
.text-right { text-align: right; }
.mt-3 { margin-top: 1rem; }

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    /* Sidebar becomes hidden/collapsed */
    .sidebar {
        width: 0;
        padding: 0;
        overflow: hidden;
        position: fixed;
        z-index: 1001;
        transition: width 0.3s ease;
    }
    
    .sidebar.active {
        width: 260px;
        padding: 2rem 1.5rem;
    }
    
    /* Main content takes full width */
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem 1rem;
    }
    
    /* Hamburger menu button */
    .hamburger-btn {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1000;
        background: var(--primary-color);
        border: none;
        color: white;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.2rem;
    }
    
    /* Stats grid adjust */
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-info h1 {
        font-size: 1.5rem;
    }
    
    /* Table responsive */
    .table-container {
        overflow-x: auto;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    table th, table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Form responsive */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .input-field {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Button responsive */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Grid adjust */
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Footer adjust */
    .footer {
        left: 0;
        padding: 0.8rem 1rem;
    }
    
    .footer-content {
        font-size: 0.8rem;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    h1 {
        font-size: 1.3rem !important;
    }
    
    h2 {
        font-size: 1.1rem !important;
    }
    
    h3 {
        font-size: 1rem !important;
    }
    
    /* Sidebar fully hidden */
    .sidebar {
        width: 100%;
    }
    
    /* Stats grid single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-info h1 {
        font-size: 1.3rem;
    }
    
    .stat-info h3 {
        font-size: 0.8rem;
    }
    
    /* Table hidden columns */
    table th:nth-child(n+3),
    table td:nth-child(n+3) {
        display: none;
    }
    
    /* Card padding */
    .stat-card,
    [style*="padding: 1.5rem"],
    [style*="padding: 2rem"] {
        padding: 1rem 0.75rem !important;
    }
    
    /* Form full width */
    input[class*="input"],
    select[class*="input"],
    textarea {
        width: 100%;
    }
    
    /* Button full width */
    .btn {
        width: 100%;
        padding: 0.75rem;
    }
    
    /* Modal/Dialog responsive */
    [role="dialog"],
    .modal {
        width: 95% !important;
        margin: 0 auto !important;
    }
    
    /* Footer text center */
    .footer-content {
        text-align: center;
    }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
    .main-content {
        padding: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Extra large screens (1920px and above) */
@media (min-width: 1920px) {
    .main-content {
        max-width: 1400px;
        margin-left: 260px;
        padding: 3rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .footer,
    .hamburger-btn,
    .action-bar,
    button,
    input[type="button"],
    input[type="submit"] {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }
    
    body {
        background: white;
    }
}
