/* ===== HRMS Dashboard Shared Styles ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4fa;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 240px;
    min-height: 100vh;
    background: linear-gradient(160deg, #1565c0 0%, #1976d2 100%);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(21,101,192,0.15);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 22px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-logo .logo-icon {
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}

.sidebar-logo .logo-icon svg { width: 22px; height: 22px; fill: #fff; }
.sidebar-logo span { color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: -0.3px; }

.sidebar-nav { flex: 1; padding: 18px 0; }
.sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.45) rgba(255,255,255,0.08);
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.45);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.62);
}

.nav-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 24px 6px 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.nav-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; min-width: 18px; }

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-left-color: #fff;
}

.sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.15s;
}

.logout-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logout-btn:hover { color: #fff; }

/* Main content */
.main-content {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top bar */
.topbar {
    background: #fff;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    position: sticky; top: 0; z-index: 90;
}

.topbar-title { font-size: 1.18rem; font-weight: 700; color: #1a1a2e; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #4a4a6a;
}

.topbar-user.topbar-user-dropdown {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.topbar-user.topbar-user-dropdown::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 10px;
}

.topbar-user-menu-toggle {
    width: 28px;
    height: 28px;
    border: 1px solid #d9e4f2;
    background: #f8fbff;
    border-radius: 8px;
    color: #6f7891;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.topbar-user.topbar-user-dropdown:hover .topbar-user-menu-toggle,
.topbar-user.topbar-user-dropdown.is-open .topbar-user-menu-toggle {
    background: #eef4ff;
    color: #1565c0;
    border-color: #cfdff7;
}

.topbar-user-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e1e9f5;
    border-radius: 12px;
    box-shadow: 0 16px 28px rgba(17, 24, 39, 0.12);
    padding: 8px;
    display: none;
    z-index: 200;
}

.topbar-user.topbar-user-dropdown:hover .topbar-user-menu,
.topbar-user.topbar-user-dropdown:focus-within .topbar-user-menu,
.topbar-user.topbar-user-dropdown.is-open .topbar-user-menu {
    display: block;
}

.topbar-user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-decoration: none;
    color: #2e3954;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
}

.topbar-user-menu-item:hover {
    background: #f3f8ff;
    color: #1565c0;
}

.topbar-user-menu-item.active {
    background: #eef4ff;
    color: #1565c0;
}

.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #1565c0;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    text-transform: uppercase;
}

.role-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin { background: #e8f0fe; color: #1565c0; }
.badge-manager { background: #e8f8ee; color: #2e7d32; }
.badge-employee { background: #fff3e0; color: #e65100; }

/* Page content */
.page-content { padding: 32px; flex: 1; }

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}

.stat-icon svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bg-blue { background: linear-gradient(135deg, #1565c0, #42a5f5); }
.bg-green { background: linear-gradient(135deg, #2e7d32, #66bb6a); }
.bg-orange { background: linear-gradient(135deg, #e65100, #ffa726); }
.bg-purple { background: linear-gradient(135deg, #6a1b9a, #ab47bc); }
.bg-teal { background: linear-gradient(135deg, #00695c, #26a69a); }
.bg-red { background: linear-gradient(135deg, #c62828, #ef5350); }

.stat-info { flex: 1; }
.stat-label { font-size: 0.8rem; color: #7a7a9a; font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: #1a1a2e; line-height: 1; }

/* Section card */
.section-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-bottom: 24px;
}

.section-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef1f8;
}

/* Info grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px 24px;
}

.info-item { display: flex; flex-direction: column; gap: 3px; }
.info-label { font-size: 0.76rem; font-weight: 600; color: #8899b0; text-transform: uppercase; letter-spacing: 0.5px; }
.info-value { font-size: 0.92rem; color: #1a1a2e; font-weight: 500; }
.info-value.empty { color: #c0c0d0; font-style: italic; }

/* Table */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
thead tr { background: #f5f7ff; }
th { padding: 11px 14px; text-align: left; font-size: 0.8rem; font-weight: 700; color: #7a7a9a; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid #eef1f8; }
td { padding: 12px 14px; font-size: 0.9rem; color: #1a1a2e; border-bottom: 1px solid #f0f4fa; }
tr:last-child td { border-bottom: none; }

.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.status-active { background: #e8f8ee; color: #2e7d32; }
.status-inactive { background: #fde8e8; color: #c0392b; }

/* ── Birthday accordion panel (manager dashboard) ── */
.bday-wrap {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    border: 1px solid #e5ecf8;
    overflow: hidden;
}

.bday-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    transition: opacity 0.15s;
}

.bday-trigger:hover { opacity: 0.93; }

.bday-trigger-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bday-icon-box {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.18);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.bday-count {
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
}

.bday-card-label {
    font-size: 0.84rem;
    font-weight: 500;
    opacity: 0.88;
    color: #fff;
    margin-top: 2px;
}

.bday-chevron {
    font-size: 0.85rem;
    transition: transform 0.25s;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
}

.bday-wrap.is-open .bday-chevron { transform: rotate(180deg); }

.bday-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0 24px;
}

.bday-wrap.is-open .bday-panel {
    max-height: 600px;
    padding: 16px 24px 20px;
}

.bday-panel-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #8899b0;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

/* Birthday list items */
.birthday-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.birthday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #edf2f8;
    background: #fafbfe;
    transition: transform 0.15s, box-shadow 0.15s;
}

.birthday-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102,126,234,0.1);
}

.birthday-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.birthday-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.92rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(102,126,234,0.22);
}

.birthday-name {
    font-weight: 700;
    font-size: 0.92rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.birthday-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 0.8rem;
    color: #6f7891;
}

.birthday-role {
    display: inline-flex;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: capitalize;
}

.birthday-role-employee { background: #e8f0fe; color: #1565c0; }
.birthday-role-manager  { background: #e8f8ee; color: #2e7d32; }

.birthday-when {
    font-size: 0.82rem;
    font-weight: 700;
    color: #667eea;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 4px 10px;
    background: #f0f1fd;
    border-radius: 999px;
}

/* ── Birthday card — this month ── */
.bday-month-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(17,24,39,0.07);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e5ecf8;
}

.bday-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.bday-month-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.bday-month-icon {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.18);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.bday-month-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 3px;
}

.bday-month-subtitle {
    font-size: 0.84rem;
    font-weight: 500;
    opacity: 0.82;
}

.bday-month-count {
    width: 48px; height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.3);
}

.bday-month-list {
    padding: 16px 20px;
    display: grid;
    gap: 10px;
}

.bday-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #edf2f8;
    background: #fafbfe;
    transition: transform 0.15s, box-shadow 0.15s;
}

.bday-person:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(102,126,234,0.12);
}

.bday-person.bday-past {
    opacity: 0.55;
}

.bday-person.bday-today {
    background: linear-gradient(135deg, #fef9e7 0%, #fdf2d1 100%);
    border-color: #f59e0b;
    box-shadow: 0 4px 18px rgba(245,158,11,0.15);
    animation: bdayGlow 2s ease-in-out infinite alternate;
}

@keyframes bdayGlow {
    0% { box-shadow: 0 4px 18px rgba(245,158,11,0.12); }
    100% { box-shadow: 0 6px 24px rgba(245,158,11,0.22); }
}

.bday-person-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.bday-person-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(102,126,234,0.25);
}

.bday-person-avatar.bday-av-mgr {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    box-shadow: 0 4px 10px rgba(46,125,50,0.25);
}

.bday-person-info { min-width: 0; }

.bday-person-name {
    font-weight: 700;
    font-size: 0.94rem;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bday-today-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f59e0b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    white-space: nowrap;
    animation: bdayPulse 1.5s ease-in-out infinite;
}

@keyframes bdayPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.bday-person-date {
    font-size: 0.82rem;
    color: #6f7891;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.bday-person-role {
    display: inline-flex;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
}

.bday-role-e { background: #e8f0fe; color: #1565c0; }
.bday-role-m { background: #e8f8ee; color: #2e7d32; }

.bday-day-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid #dde3f0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #6f7891;
    flex-shrink: 0;
    background: #f5f7fc;
}

.bday-day-circle.bday-day-active {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.bday-empty {
    text-align: center;
    padding: 32px 20px;
    color: #8a90aa;
    font-size: 0.92rem;
}

.bday-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

@media (max-width: 900px) {
    .sidebar { width: 64px; }
    .sidebar-logo span, .nav-section-label, .nav-item span, .logout-btn span { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .main-content { margin-left: 64px; }
}
