:root {
    --bg-main: #f8f9fa;
    --bg-sidebar: #ffffff;
    --text-primary: #1a1d21;
    --text-secondary: #64748b;
    --accent: #3b82f6;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --sidebar-width: 260px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
}

.nav-item:hover,
.nav-item.active {
    background-color: #f1f5f9;
}

.nav-item i {
    font-size: 1.1rem;
    color: var(--text-secondary);
    min-width: 20px;
    text-align: center;
}

.nav-item.active i {
    color: var(--accent);
}

/* Main Wrapper & Layout */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.header {
    background: var(--bg-sidebar);
    height: 64px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 90;
}

.content {
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Reusable Components */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-container {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.search-container:focus-within {
    border-color: var(--accent);
}

.search-container input {
    background: transparent;
    border: none;
    outline: none;
    margin-left: 0.5rem;
    width: 100%;
    font-size: 0.9rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.avatar-blue {
    background: #dbeafe;
    color: #1e40af;
}

.avatar-green {
    background: #dcfce7;
    color: #166534;
}

.avatar-red {
    background: #fee2e2;
    color: #991b1b;
}

/* Dashboard Specific (Index) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.greeting {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.post-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-meta {
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-content {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.post-actions {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.appreciation-banner {
    background: linear-gradient(to right, #fee2e2, #e0e7ff);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Tabs Styling */
.tabs-container {
    display: flex;
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.tab {
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent);
}

/* Inbox & Page Headers */
.inbox-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.inbox-icon-container,
.profile-icon-header {
    width: 36px;
    height: 36px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inbox-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

/* Calendar View */
.calendar-container {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.calendar-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 100px);
    /* Fixed width for better control */
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-label {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-right: 1px solid var(--border-color);
}

.calendar-cell {
    min-height: 120px;
    padding: 0.75rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.calendar-cell.inactive {
    background-color: #f8fafc;
    color: #cbd5e1;
}

.day-number {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.day-number.today {
    background: var(--accent);
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 3px solid transparent;
}

.event-blue {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #0ea5e9;
}

.event-green {
    background: #dcfce7;
    color: #166534;
    border-color: #22c55e;
}

/* Profile View */
.profile-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.profile-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.profile-sidebar-right {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    height: fit-content;
    box-shadow: var(--card-shadow);
}

.profile-sidebar-right h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.detail-item {
    margin-bottom: 1.5rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.profile-card-list {
    list-style: none;
}

.profile-card-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.profile-card-list li:last-child {
    border-bottom: none;
}

.stat-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chart-placeholder {
    height: 120px;
    background: linear-gradient(to top, #f8fafc, #ffffff);
    border-radius: 8px;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.chart-line {
    position: absolute;
    bottom: 30%;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* Absences View */
.absences-layout {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 2rem;
}

.balance-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.balance-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.balance-period {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.balance-stats {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    border-top: 1px solid #f1f5f9;
}

.balance-item {
    text-align: center;
    flex: 1;
}

.balance-item .val {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.balance-item .lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.yearly-calendar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-top: 0.75rem;
}

.mini-day-label {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 700;
    padding-bottom: 4px;
}

.mini-cell {
    text-align: center;
    font-size: 0.75rem;
    padding: 4px 0;
    border-radius: 4px;
}

.mini-cell.has-absence {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.absences-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.absences-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.absences-table td:last-child {
    text-align: right;
}

.val-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Documents Specific Styling */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.folder-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow);
}

.folder-icon {
    font-size: 2.5rem;
    color: #ffd966; /* Classic folder yellow */
}

.folder-name {
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.folder-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-list-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.file-row {
    display: grid;
    grid-template-columns: 48px 1fr 150px 120px 80px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.file-row:hover {
    background: #f8fafc;
}

.file-row:last-child {
    border-bottom: none;
}

.file-icon {
    font-size: 1.25rem;
}

.file-name {
    font-weight: 500;
}

.file-date, .file-size {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.file-actions {
    text-align: right;
    color: var(--text-secondary);
    cursor: pointer;
}

.doc-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
}

.filter-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Responsive Adjustments */
@media (max-width: 1200px) {

    .dashboard-grid,
    .profile-widgets,
    .absences-layout,
    .profile-content-wrapper {
        grid-template-columns: 1fr;
    }

    .yearly-calendar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 1rem 0.5rem;
    }

    .nav-item span,
    .nav-section-title,
    .logo span {
        display: none;
    }

    .main-wrapper {
        margin-left: 80px;
    }

    .header {
        padding: 0 1rem;
    }

    .yearly-calendar {
        grid-template-columns: 1fr;
    }
}