:root {
    --primary: #00897b;
    --primary-light: #4ebaaa;
    --primary-dark: #005b4f;
    --secondary: #26c6da;
    --accent: #ffb300;
    --bg-main: #f4f7f6;
    --bg-sidebar: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --glass: rgba(255, 255, 255, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    background: var(--bg-sidebar);
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 137, 123, 0.3);
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-dark);
}

.logo-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-btn {
    border: none;
    background: transparent;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.nav-btn i {
    font-size: 1.1rem;
}

.nav-btn:hover {
    background: rgba(0, 137, 123, 0.05);
    color: var(--primary);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 137, 123, 0.2);
}

.sidebar-footer {
    padding-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: 80px;
    background: var(--white);
    padding: 0 3rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.top-header h2 {
    font-weight: 600;
    color: var(--primary-dark);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

#content-area {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
}

/* Dashboard Cards */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 2.5rem;
    border-radius: 24px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 91, 79, 0.2);
}

.welcome-text h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.welcome-text p {
    opacity: 0.8;
}

.mini-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    border-radius: 16px;
    backdrop-filter: blur(10px);
    text-align: center;
}

.mini-stat .label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 0.2rem;
}

.mini-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Latest Report Card */
.report-card {
    background: var(--white);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    position: relative;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.report-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

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

.card-header-main {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.card-actions {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
    background: #f8f9fa;
    padding: 0.4rem;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.action-btn {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn.edit {
    background: #e3f2fd;
    color: #1976d2;
}

.action-btn.delete {
    background: #ffebee;
    color: #e53935;
}

.action-btn:hover {
    transform: scale(1.1);
}

.report-date {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-icon {
    width: 50px;
    height: 50px;
    background: #e0f2f1;
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.date-info h4 {
    font-size: 1.4rem;
    color: var(--primary-dark);
}

.revenue-badge {
    background: #fff8e1;
    color: #f57c00;
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-group {
    margin-bottom: 2rem;
}

.stat-group h5 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    letter-spacing: 1px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px dashed #eee;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-main);
    font-weight: 500;
}

.stat-value {
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-value.highlight {
    color: var(--secondary);
}

.pending-list-card {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 12px;
}

.pending-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
}

.pending-name {
    font-size: 0.9rem;
}

.pending-amt {
    font-weight: 600;
    color: #e53935;
}

/* Attendance Display */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
}

.att-col {
    min-width: 0; /* Prevent flex overflow */
}

.att-col h6 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.att-col .stat-row {
    flex-wrap: wrap; /* Prevent overlap by wrapping */
    gap: 0.5rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-card i {
    font-size: 3rem;
    color: #e53935;
    margin-bottom: 1rem;
}

.modal-card h3 {
    margin-bottom: 0.5rem;
}

.modal-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.modal-btns {
    display: flex;
    gap: 1rem;
}

.delete-btn {
    background: #e53935;
    color: white;
    flex: 1;
}

/* Form Styles */
.glass-form {
    background: var(--white);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
    max-width: 900px;
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.form-header h3 {
    font-size: 1.8rem;
    color: var(--primary-dark);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-divider {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

input, select {
    padding: 0.8rem 1rem;
    border: 2px solid #eef2f3;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.1);
}

.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn.secondary {
    background: #e0f2f1;
    color: var(--primary);
}

.btn.large {
    padding: 1.2rem 3rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.btn-remove {
    background: #ffebee;
    color: #e53935;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
}

.form-actions {
    margin-top: 3rem;
}

/* History Grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.no-data {
    text-align: center;
    padding: 5rem;
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.no-data i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.no-data p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Responsive Improvements */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 80px 1fr;
    }
    .logo-text, .sidebar-footer p, .nav-btn span {
        display: none;
    }
    .sidebar {
        padding: 1.5rem 1rem;
    }
    .nav-btn {
        justify-content: center;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }
    
    .app-container {
        display: block;
        padding-bottom: 80px; /* Space for bottom nav */
    }

    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        flex-direction: row;
        padding: 0 1rem;
        border-right: none;
        border-top: 1px solid rgba(0,0,0,0.05);
        justify-content: space-around;
        align-items: center;
        background: white;
    }

    .logo, .sidebar-footer {
        display: none !important;
    }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-btn {
        flex-direction: column;
        gap: 4px;
        font-size: 0.7rem;
        padding: 0.5rem;
    }
    
    .nav-btn i { font-size: 1.2rem; }

    .top-header {
        padding: 0 1.5rem;
        height: 70px;
    }

    #content-area {
        padding: 1.5rem;
    }

    .welcome-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .welcome-text h3 { font-size: 1.4rem; }

    .report-card {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .revenue-badge {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .glass-form {
        padding: 1.5rem;
    }

    .dynamic-row {
        grid-template-columns: 1fr 80px auto;
    }

    .report-grid {
        grid-template-columns: 1fr;
    }
}
