/* ================================================
   Global Styles - Leave Management System
   ================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7f7f7;
    color: #333;
    display: flex;
    line-height: 1.6;
}

/* ================================================
   Sidebar Styles
   ================================================ */
.sidebar {
    width: 220px;
    background: #fff;
    height: 100vh;
    border-right: 1px solid #eee;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar h2 {
    margin: 0 20px 30px;
    color: #3498db;
    font-size: 18px;
    font-weight: bold;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li {
    padding: 12px 20px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.sidebar ul li.active {
    background: #dee4e7;
    border-left: 4px solid #3498db;
    font-weight: bold;
    color: #3498db;
}

.sidebar ul li:hover {
    background: #f9f9f9;
}

.sidebar ul li:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

/* ================================================
   Main Layout
   ================================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
}

.main {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - 220px);
    transition: margin-left 0.3s ease, width 0.3s ease;
}

.main.expanded {
    margin-left: 0;
    width: 100%;
}

/* ================================================
   Navbar
   ================================================ */
.navbar {
    background: #fff;
    /* padding: 15px 20px;   */
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.navbar .left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar .icon {
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.navbar .icon:hover {
    background: #f5f5f5;
}

.navbar .profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.navbar .profile:hover {
    background: #f5f5f5;
}

.navbar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ================================================
   Profile Dropdown
   ================================================ */
.profile-wrapper {
    position: relative;
    display: inline-block;
}

.profile-info span {
    font-size: 14px;
    font-weight: 500;
}

.profile-info small {
    font-size: 12px;
    color: #666;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 160px;
    z-index: 1000;
    margin-top: 5px;
}

.profile-dropdown a {
    display: block;
    padding: 10px 15px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
}

.profile-dropdown a:hover {
    background: #f9f9f9;
}

/* ================================================
   Content Layout
   ================================================ */
.content-wrapper {
    display: flex;
    gap: 20px;
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.content {
    flex: 3;
    min-width: 0;
}

.rightbar {
    flex: 1;
    min-width: 280px;
}

/* ================================================
   Header
   ================================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 24px;
    margin: 0;
    color: #2c3e50;
}

/* ================================================
   Statistics Cards
   ================================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat h2 {
    font-size: 32px;
    margin: 0 0 8px 0;
    font-weight: bold;
}

.stat h2.approved {
    color: #2e7d32;
}

.stat h2.pending {
    color: #f57c00;
}

.stat h2.rejected {
    color: #c62828;
}

.stat h2.total {
    color: #225bd6;
}

.status-badge.total {
    background: #d1fae5;
    color: #065f46;
}

.stat p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* ================================================
   Calendar
   ================================================ */
.calendar {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

.calendar h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #2c3e50;
}

.calendar-container {
    overflow-x: auto;
}

.calendar table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.calendar th,
.calendar td {
    border: 1px solid #e8e8e8;
    padding: 12px 8px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
    min-height: 90px;
}

.calendar th {
    background: #f8f9fa;
    font-weight: 600;
    text-align: center;
    color: #555;
}

.calendar td {
    position: relative;
}

.date-number {
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.event {
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    display: block;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

.event.annual {
    background: #dcedc8;
    color: #2e7d32;
}

.event.sick {
    background: #ffcdd2;
    color: #c62828;
}

.event.other {
    background: #ffe0b2;
    color: #ef6c00;
}

.event.holiday {
    background: #bbdefb;
    color: #1565c0;
}

/* ================================================
   Boxes (Sidebar Widgets)
   ================================================ */
.box {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.box h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    color: #2c3e50;
}

.team {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.team:hover {
    background: #f8f9fa;
}

.team img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
}

.team-info {
    flex: 1;
}

.team-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.status {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.available {
    background: #c8e6c9;
    color: #2e7d32;
}

.status.busy {
    background: #ffcdd2;
    color: #c62828;
}

.holidays ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.holidays ul li {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
}

.holidays ul li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.holiday-date {
    font-weight: 500;
    color: #333;
}

/* ================================================
   Forms
   ================================================ */
.form-container {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 700px;
    margin: 0 auto 30px;
}

.form-container h2 {
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(198, 40, 40, 0.1);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* ================================================
   Buttons
   ================================================ */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #3498db63;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #eee;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* ================================================
   Messages
   ================================================ */
#messageContainer {
    margin-bottom: 15px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.message.success {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.message.error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* ================================================
   Filters
   ================================================ */
.filters {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 14px;
    color: #444;
}

.filter-group select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.filter-actions {
    display: flex;
    gap: 10px;
}

/* ================================================
   Tables
   ================================================ */
.history-container,
.table-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.history-container h3,
.table-container h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #2c3e50;
}

.table-responsive {
    overflow-x: auto;
}

.history-table,
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.history-table th,
.history-table td,
table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.history-table th,
table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

.history-table tr:hover,
table tr:hover {
    background: #f9f9f9;
}

/* ================================================
   Status Badges
   ================================================ */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-badge.approved,
.approved {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-badge.total,
.total {
    background: #aac5ee;
    color: #1190da;
}

.status-badge.pending,
.pending {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.rejected,
.rejected {
    background: #ffcdd2;
    color: #c62828;
}

.status-badge.cancelled {
    background: #e0e0e0;
    color: #757575;
}

/* ================================================
   Leave Type Badges
   ================================================ */
.leave-type {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    display: inline-block;
}

.leave-type.annual {
    background: #e8f5e9;
    color: #2e7d32;
}

.leave-type.sick {
    background: #ffebee;
    color: #c62828;
}

.leave-type.maternity,
.leave-type.paternity {
    background: #f3e5f5;
    color: #7b1fa2;
}

.leave-type.emergency {
    background: #fff3e0;
    color: #f57c00;
}

.leave-type.other {
    background: #e3f2fd;
    color: #1976d2;
}

/* ================================================
   Pagination
   ================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 20px 0;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.pagination a {
    color: #3498db;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: #3498db;
    color: #fff;
    transform: translateY(-1px);
}

.pagination .current {
    background: #3498db;
    color: #fff;
    border: 1px solid #3498db;
}

.pagination .disabled {
    color: #ccc;
    border: 1px solid #eee;
    cursor: not-allowed;
}

/* ================================================
   Empty State
   ================================================ */
.empty-state,
.no-requests {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.empty-state h3,
.no-requests h3 {
    margin-bottom: 10px;
    color: #999;
}

/* ================================================
   Loading State
   ================================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }

    .rightbar {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main {
        margin-left: 0;
        width: 100%;
    }

    .navbar {
        padding: 10px 15px;
    }

    .content-wrapper {
        padding: 15px;
        gap: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 15px;
    }

    .stat {
        padding: 16px;
    }

    .stat h2 {
        font-size: 24px;
    }

    .calendar {
        padding: 16px;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: auto;
    }

    .filter-actions {
        justify-content: center;
    }

    .history-table,
    table {
        min-width: 600px;
    }
}

@media (max-width: 600px) {
    .form-container {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}
 
@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    .navbar .profile {
        width: 100%;
        justify-content: flex-start;
    }

    .content-wrapper {
        padding: 10px;
    }

    .calendar table {
        min-width: 600px;
    }
}