/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    /* Indigo 600 */
    --primary-dark: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f3f4f6;
    --text-color: #1e293b;
    --sidebar-width: 260px;
    --header-height: 90px;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.95);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
}

/* Utilities */
.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.fw-bold {
    font-weight: 600;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Login Page Redesign */
body.login-body {
    background-color: #f0f4f8;
    /* Light blue-grey background */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    height: 100vh;
}

.login-container {
    display: flex;
    background: transparent;
    width: 100%;
    max-width: 1100px;
    height: 600px;
    border-radius: 20px;
    overflow: hidden;
    /* Box shadow is optional here since we might want the card on the right to float */
}

.login-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
}

.login-brand-logo {
    width: 180px;
    height: auto;
    margin-bottom: 2rem;
    /* Basic drop shadow for the logo if needed */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-left h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.login-left p {
    color: #64748b;
    font-size: 1rem;
}

.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.login-card {
    background: white;
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.login-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #1e293b;
}

.login-card p.subtitle {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: #2563eb;
    /* Bright Blue */
    width: 100%;
    font-size: 1rem;
    padding: 0.875rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.footer-text {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        height: auto;
        max-width: 500px;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 0;
    }

    .mobile-logo-container {
        display: block !important;
        text-align: center;
        width: 100%;
    }

    .mobile-logo-container img {
        display: inline-block;
        margin: 0 auto 1rem auto;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block !important;
    }

    .top-header {
        padding: 0 1rem;
    }
}

/* Restored Form Utilities */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}


/* Dashboard Layout */
.wrapper {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-color);
}

.sidebar-menu {
    padding: 1.5rem 0;
    flex: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    gap: 0.75rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-weight: 600;
}

.menu-item:hover,
.menu-item.active {
    color: var(--primary-color);
    background-color: #eff6ff;
    border-left-color: var(--primary-color);
}


.menu-item svg {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 1.5rem 0;
    border-top: 1px solid #f1f5f9;
}

.logout-btn {
    color: var(--danger-color);
}

.logout-btn:hover {
    background-color: #fee2e2;
    color: #991b1b;
    border-left-color: var(--danger-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    border-bottom: 1px solid #e2e8f0;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--secondary-color);
}

.badge-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 8px;
    height: 8px;
    background-color: var(--danger-color);
    border-radius: 50%;
    border: 2px solid white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e2e8f0;
}

.user-info {
    text-align: left;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* Dashboard Cards */
.content-padding {
    padding: 2rem;
}

.welcome-section {
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--secondary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: row;
    /* Ensure row direction */
    align-items: center;
    gap: 1.5rem;
    /* Increased gap */
}

.stat-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    /* Prevent shrinking */
    flex-shrink: 0;
    /* Prevent shrinking */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-purple-light {
    background: #e0e7ff;
    color: #4F46E5;
}

.bg-orange-light {
    background: #ffedd5;
    color: #f59e0b;
}

.bg-green-light {
    background: #dcfce7;
    color: #10b981;
}

.bg-blue-light {
    background: #dbeafe;
    color: #2563eb;
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-info p {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* Tables */
.table-card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.common-table {
    width: 100%;
    border-collapse: collapse;
}

.common-table th,
.common-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.common-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-present,
.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-absent {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #ffedd5;
    color: #9a3412;
}

.status-submitted {
    background: #dbeafe;
    color: #1e40af;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    }

    .content-padding {
        padding: 1rem;
    }

    .top-header {
        padding: 0 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack cards on mobile */
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }

    .login-card {
        padding: 2rem;
    }
}

/* Responsive Table Wrapper */
/* .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
} */
/* Disabling wrapper scroll preference for Card View strategy */

/* Ensure table doesn't overflow its container specifically */
.common-table {
    width: 100%;
}

@media (max-width: 768px) {

    /* Force table to not be like tables anymore */
    .common-table.mobile-card-view,
    .common-table.mobile-card-view tbody,
    .common-table.mobile-card-view th,
    .common-table.mobile-card-view td,
    .common-table.mobile-card-view tr {
        display: block;
    }

    /* Hide table headers (but not display: none;, for accessibility) */
    .common-table.mobile-card-view thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .common-table.mobile-card-view tr {
        border: 1px solid #e2e8f0;
        border-radius: 0.75rem;
        margin-bottom: 1rem;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        padding: 0.5rem;
    }

    .common-table.mobile-card-view td {
        /* Behave  like a "row" */
        border: none;
        border-bottom: 1px solid #f1f5f9;
        position: relative;
        padding: 0.75rem 0;
        /* Removed padding-left: 50% */
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .common-table.mobile-card-view td:last-child {
        border-bottom: 0;
    }

    .common-table.mobile-card-view td:before {
        /* Now like a table header */
        content: attr(data-label);
        font-weight: 600;
        color: var(--secondary-color);
        font-size: 0.9rem;
        margin-right: 1rem;
        text-align: left;
    }
}