/* ============================================
   Astrea HR - Admin Dashboard Styles
   Theme: Gold / macOS Light & Dark
   ============================================ */

:root {
    /* Gold Primary Palette */
    --gold-50: #fdf8e8;
    --gold-100: #faedc5;
    --gold-200: #f5df9e;
    --gold-300: #f0d070;
    --gold-400: #ebc44a;
    --gold-500: #d4af37;
    --gold-600: #b8962e;
    --gold-700: #9a7d25;
    --gold-800: #7c631c;
    --gold-900: #5e4a13;
    --gold-950: #3f320d;

    /* Light Mode (macOS Light) */
    --bg-primary: #f5f5f7;
    --bg-secondary: #ffffff;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f0f2;
    --bg-input: #f5f5f7;
    --bg-dropdown: #ffffff;

    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #86868b;
    --text-inverse: #ffffff;

    --border-color: #d2d2d7;
    --border-light: #e8e8ed;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);

    --accent: var(--gold-500);
    --accent-hover: var(--gold-600);
    --accent-light: var(--gold-100);
    --accent-dark: var(--gold-700);

    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --info: #007aff;
    --purple: #af52de;

    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

/* Dark Mode (macOS Dark) */
[data-theme="dark"] {
    --bg-primary: #1c1c1e;
    --bg-secondary: #2c2c2e;
    --bg-sidebar: #1c1c1e;
    --bg-card: #2c2c2e;
    --bg-hover: #3a3a3c;
    --bg-input: #3a3a3c;
    --bg-dropdown: #2c2c2e;

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --text-inverse: #1d1d1f;

    --border-color: #48484a;
    --border-light: #3a3a3c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.35);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.4);

    --accent-light: var(--gold-900);
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* === ADMIN LAYOUT === */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    min-height: var(--header-height);
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 12px;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-tertiary);
    padding: 16px 14px 6px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent-dark);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item .nav-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-item .nav-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    transition: transform 0.2s;
    color: var(--text-tertiary);
}

.nav-item .nav-arrow.open { transform: rotate(90deg); }

.nav-submenu {
    padding-left: 34px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-submenu.open { max-height: 500px; }

.nav-submenu .nav-item {
    font-size: 0.8rem;
    padding: 7px 14px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    cursor: pointer;
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}

/* === HEADER === */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    width: 280px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.header-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 100%;
}

.header-search input::placeholder { color: var(--text-tertiary); }

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.header-btn .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--bg-secondary);
}

.header-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-input);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(20px);
}

.theme-toggle-icons {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    align-items: center;
    height: 100%;
    font-size: 0.6rem;
    color: var(--text-tertiary);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
    margin-left: 4px;
}

.header-profile:hover { background: var(--bg-hover); }

.header-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
}

.header-profile-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Sidebar Toggle (Burger) */
.sidebar-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.sidebar-toggle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    transition: transform 0.3s ease;
}

.sidebar-toggle.collapsed svg { transform: rotate(90deg); }

/* === PAGE CONTENT === */
.page-content {
    padding: 28px 30px;
    flex: 1;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.page-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.page-title h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.page-title p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
}

.btn-ghost {
    color: var(--text-secondary);
    padding: 9px 12px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* === STATS CARDS (KPI) === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon.gold { background: var(--accent-light); color: var(--accent); }
.stat-card-icon.green { background: #e8f8ee; color: var(--success); }
.stat-card-icon.orange { background: #fff3e0; color: var(--warning); }
.stat-card-icon.red { background: #ffe8e7; color: var(--danger); }
.stat-card-icon.blue { background: #e8f1ff; color: var(--info); }
.stat-card-icon.purple { background: #f3e8ff; color: var(--purple); }

[data-theme="dark"] .stat-card-icon.gold { background: rgba(212,175,55,0.15); }
[data-theme="dark"] .stat-card-icon.green { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .stat-card-icon.orange { background: rgba(255,149,0,0.15); }
[data-theme="dark"] .stat-card-icon.red { background: rgba(255,59,48,0.15); }
[data-theme="dark"] .stat-card-icon.blue { background: rgba(0,122,255,0.15); }
[data-theme="dark"] .stat-card-icon.purple { background: rgba(175,82,222,0.15); }

.stat-card-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
    line-height: 1.1;
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
    padding: 2px 8px;
    border-radius: 4px;
}

.stat-card-change.up { color: var(--success); background: #e8f8ee; }
.stat-card-change.down { color: var(--danger); background: #ffe8e7; }

[data-theme="dark"] .stat-card-change.up { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .stat-card-change.down { background: rgba(255,59,48,0.15); }

.stat-card-bg-icon {
    position: absolute;
    right: -8px;
    bottom: -8px;
    width: 80px;
    height: 80px;
    opacity: 0.04;
}

.stat-card-bg-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-width: 1;
}

/* === GRID LAYOUTS === */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-header .card-action {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.card-header .card-action:hover { color: var(--accent-hover); }

.card-body {
    padding: 22px;
}

.card-body-sm {
    padding: 16px 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* === ATTENDANCE STATUS === */
.attendance-overview {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.attendance-ring {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    position: relative;
}

.attendance-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.attendance-ring-bg { fill: none; stroke: var(--border-light); stroke-width: 8; }
.attendance-ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; }

.attendance-ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.attendance-ring-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.attendance-ring-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attendance-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attendance-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
}

.attendance-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.attendance-stat-dot.present { background: var(--success); }
.attendance-stat-dot.absent { background: var(--danger); }
.attendance-stat-dot.late { background: var(--warning); }
.attendance-stat-dot.halfday { background: var(--purple); }

.attendance-stat-label { color: var(--text-secondary); flex: 1; }
.attendance-stat-count { font-weight: 600; color: var(--text-primary); }

/* === DATE PICKER BAR === */
.date-picker-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 14px 22px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.date-picker-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.date-picker-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.date-picker-select {
    appearance: none;
    -webkit-appearance: none;
    padding: 7px 30px 7px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 90px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2386868b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.date-picker-select:hover { border-color: var(--accent); }
.date-picker-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.date-picker-display {
    font-size: 0.8rem;
    color: var(--text-accent);
    font-weight: 500;
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .date-picker-bar { flex-direction: column; align-items: stretch; }
    .date-picker-group { width: 100%; }
    .date-picker-select { width: 100%; }
    .date-picker-display { margin-left: 0; text-align: center; }
}

/* === RECENT ACTIVITY / TABLES === */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-dot.check-in { background: var(--success); }
.activity-dot.check-out { background: var(--info); }
.activity-dot.late { background: var(--warning); }
.activity-dot.leave { background: var(--purple); }
.activity-dot.alert { background: var(--danger); }

.activity-content { flex: 1; min-width: 0; }

.activity-text {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.activity-text span { color: var(--text-secondary); font-weight: 400; }

.activity-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* === DATA TABLE === */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 22px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    font-weight: 600;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
}

.data-table td {
    padding: 14px 22px;
    font-size: 0.85rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-hover); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.present {
    background: #e8f8ee;
    color: var(--success);
}

.status-badge.absent {
    background: #ffe8e7;
    color: var(--danger);
}

.status-badge.late {
    background: #fff3e0;
    color: var(--warning);
}

.status-badge.halfday {
    background: #f3e8ff;
    color: var(--purple);
}

.status-badge.pending {
    background: #fff8e1;
    color: #f5a623;
}

.status-badge.approved {
    background: #e8f8ee;
    color: var(--success);
}

.status-badge.rejected {
    background: #ffe8e7;
    color: var(--danger);
}

[data-theme="dark"] .status-badge.present { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .status-badge.absent { background: rgba(255,59,48,0.15); }
[data-theme="dark"] .status-badge.late { background: rgba(255,149,0,0.15); }
[data-theme="dark"] .status-badge.halfday { background: rgba(175,82,222,0.15); }
[data-theme="dark"] .status-badge.pending { background: rgba(245,166,35,0.15); }
[data-theme="dark"] .status-badge.approved { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .status-badge.rejected { background: rgba(255,59,48,0.15); }

/* === CHIPS (Break Time / Overtime) === */
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.chip-break {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.chip-ot {
    background: #e8f1ff;
    color: var(--info);
}

[data-theme="dark"] .chip-break { background: rgba(212,175,55,0.12); }
[data-theme="dark"] .chip-ot { background: rgba(0,122,255,0.12); }

.employee-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.employee-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.employee-cell-info { display: flex; flex-direction: column; }
.employee-cell-name { font-weight: 600; font-size: 0.85rem; }
.employee-cell-dept { font-size: 0.72rem; color: var(--text-tertiary); }

/* === LEAVE BALANCE === */
.leave-balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.leave-item {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.leave-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.leave-item-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.leave-item-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.leave-item-count strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.leave-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.leave-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.leave-bar-fill.annual { background: var(--accent); }
.leave-bar-fill.sick { background: var(--success); }
.leave-bar-fill.casual { background: var(--info); }
.leave-bar-fill.other { background: var(--purple); }

/* === NOTIFICATION LIST === */
.notification-list { display: flex; flex-direction: column; gap: 0; }

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    cursor: pointer;
}

.notification-item:last-child { border-bottom: none; }
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--accent-light); }

[data-theme="dark"] .notification-item.unread { background: rgba(212,175,55,0.06); }

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.warning { background: #fff3e0; color: var(--warning); }
.notification-icon.success { background: #e8f8ee; color: var(--success); }
.notification-icon.info { background: #e8f1ff; color: var(--info); }
.notification-icon.danger { background: #ffe8e7; color: var(--danger); }

[data-theme="dark"] .notification-icon.warning { background: rgba(255,149,0,0.15); }
[data-theme="dark"] .notification-icon.success { background: rgba(52,199,89,0.15); }
[data-theme="dark"] .notification-icon.info { background: rgba(0,122,255,0.15); }
[data-theme="dark"] .notification-icon.danger { background: rgba(255,59,48,0.15); }

.notification-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.notification-content { flex: 1; }
.notification-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* === QUICK ACTIONS === */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    text-align: center;
}

.quick-action-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    transform: translateY(-2px);
}

[data-theme="dark"] .quick-action-btn:hover { background: rgba(212,175,55,0.08); }

.quick-action-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.8;
}

.quick-action-btn span {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.quick-action-btn:hover span { color: var(--text-primary); }

/* === RECENT EMPLOYEES === */
.recent-employees { display: flex; flex-direction: column; gap: 10px; }

.recent-employee-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    cursor: pointer;
}

.recent-employee-item:hover { background: var(--bg-hover); }

.recent-emp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
}

.recent-emp-info { flex: 1; }
.recent-emp-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.recent-emp-role { font-size: 0.75rem; color: var(--text-tertiary); }
.recent-emp-status { font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; }

/* === FOOTER === */
.admin-footer {
    padding: 16px 30px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
}

.admin-footer-links { display: flex; gap: 20px; }

.admin-footer-links a { color: var(--text-tertiary); transition: color 0.2s; }
.admin-footer-links a:hover { color: var(--accent); }

/* === DASHBOARD SPECIFIC === */
.welcome-banner {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.welcome-banner h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.welcome-banner p {
    font-size: 0.88rem;
    opacity: 0.9;
}

.welcome-banner-date {
    text-align: right;
}

.welcome-banner-date h3 {
    font-size: 1.6rem;
    font-weight: 700;
}

.welcome-banner-date p {
    font-size: 0.82rem;
    opacity: 0.85;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 992px) {
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content { margin-left: 0; }
    .mobile-menu-toggle { display: flex; }

    .admin-header { padding: 0 16px; }
    .page-content { padding: 20px 16px; }
}

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .header-search { width: 180px; }
    .leave-balance-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr 1fr; }
    .welcome-banner { flex-direction: column; text-align: center; gap: 12px; }
    .welcome-banner-date { text-align: center; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .admin-footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
    .stat-card { padding: 16px 18px; }
    .admin-header { padding: 0 12px; }
    .page-content { padding: 16px 12px; }
    .header-search { width: 120px; }
    .header-profile-name { display: none; }
    .quick-actions { grid-template-columns: 1fr; }
}

/* === FORM STYLES (Employee Registration) === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-label .required { color: var(--danger); margin-left: 2px; }
.form-label .optional { color: var(--text-tertiary); font-weight: 400; font-size: 0.72rem; }

.form-input {
    width: 100%;
    padding: 9px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder { color: var(--text-tertiary); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 20px 0;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

/* Image Upload */
.img-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.img-upload-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.img-upload-preview:hover { border-color: var(--accent); }

.img-upload-preview svg {
    width: 36px;
    height: 36px;
    stroke: var(--text-tertiary);
    fill: none;
    stroke-width: 1.5;
}

.img-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-upload-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
    transition: color 0.2s;
}

.img-upload-label:hover { color: var(--accent-hover); }

.img-upload-input { display: none; }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.open .modal-container {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body .form-actions {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .modal-container { max-width: 100%; margin: 10px; }
    .modal-body { padding: 16px; }
}

/* === EMPLOYEE PORTAL SPECIFIC === */
.action-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
}

.timer-display {
    font-family: -apple-system-body, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timer-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: background 0.3s;
}

.timer-dot.active {
    background: var(--success);
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}

.clock-btn-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.clock-btn {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    border: 4px solid var(--bg-card);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 2;
}

.clock-btn:active {
    transform: scale(0.95);
}

.clock-btn-bg {
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    z-index: 1;
    opacity: 0.15;
    transition: all 0.3s ease;
}

/* Clock In state */
.clock-btn.clocked-out {
    background: linear-gradient(135deg, var(--success), #28a745);
    color: white;
}

.clock-btn.clocked-out:hover {
    box-shadow: 0 15px 30px rgba(52, 199, 89, 0.4);
    transform: translateY(-2px);
}

.clock-btn.clocked-out ~ .clock-btn-bg {
    background: var(--success);
    animation: pulse-bg-success 2s infinite;
}

/* Clock Out state */
.clock-btn.clocked-in {
    background: linear-gradient(135deg, var(--danger), #dc3545);
    color: white;
}

.clock-btn.clocked-in:hover {
    box-shadow: 0 15px 30px rgba(255, 59, 48, 0.4);
    transform: translateY(-2px);
}

.clock-btn.clocked-in ~ .clock-btn-bg {
    background: var(--danger);
    animation: pulse-bg-danger 2s infinite;
}

@keyframes pulse-bg-success {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.25); opacity: 0; }
}

@keyframes pulse-bg-danger {
    0% { transform: scale(1); opacity: 0.3; }
    100% { transform: scale(1.25); opacity: 0; }
}

.clock-btn svg {
    width: 44px;
    height: 44px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    margin-bottom: 8px;
    transition: transform 0.3s;
}

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

.clock-status-text {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 10px;
}

.clock-status-text strong {
    color: var(--text-primary);
}

.shift-info-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--border-light);
    margin-top: 16px;
}

.shift-info-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.employee-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

@media (max-width: 768px) {
    .employee-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* === PROFILE SETTINGS STYLES === */
.tabs-nav button {
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    outline: none;
}
.tabs-nav button:hover {
    color: var(--text-primary) !important;
}
.tabs-nav button.active {
    color: var(--accent) !important;
}
.tabs-nav button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tab-content-panel {
    display: none;
}
.tab-content-panel.active {
    display: block;
}

/* Image Upload Preview Hover Effect */
.img-upload-preview {
    position: relative;
}
.img-upload-preview::after {
    content: 'Change Photo';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}
.img-upload-preview:hover::after {
    opacity: 1;
}

/* Responsive adjustment */
@media (max-width: 992px) {
    .grid-1-2 {
        grid-template-columns: 1fr;
    }
}