/* ============================================
   DIGITECHGLIDE CRM — Design System & Styles
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #3b82f6;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #dbeafe;
    --accent-soft: rgba(59, 130, 246, 0.08);

    --bg-primary: #f8fafc;
    --bg-white: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-white: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --success: #10b981;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    --info: #3b82f6;
    --info-bg: #dbeafe;
    --purple: #8b5cf6;
    --purple-bg: #ede9fe;
    --orange: #f97316;
    --orange-bg: #ffedd5;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

    --sidebar-width: 260px;
    --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

.brand-text h1 {
    color: var(--text-white);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-text span {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--text-white);
}

.nav-link.active {
    background: var(--accent);
    color: var(--text-white);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.85rem;
}

.user-role {
    color: var(--text-muted);
    font-size: 0.72rem;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px 36px 40px;
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================
   PAGE SECTIONS
   ============================================ */
.page {
    animation: fadeIn 0.25s ease;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-icon {
    padding: 8px;
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow var(--transition);
}

.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);
    gap: 12px;
    flex-wrap: wrap;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 22px;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card-icon.blue {
    background: var(--info-bg);
    color: var(--info);
}

.stat-card-icon.orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.stat-card-icon.green {
    background: var(--success-bg);
    color: var(--success);
}

.stat-card-icon.purple {
    background: var(--purple-bg);
    color: var(--purple);
}

.stat-card-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}

/* ============================================
   DASHBOARD GRID
   ============================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
    gap: 18px;
}

.chart-card {
    grid-row: 1 / 3;
}

.activity-card {
    grid-row: 1;
    grid-column: 2;
}

.quick-actions-card {
    grid-row: 2;
    grid-column: 2;
}

.chart-container {
    position: relative;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-container canvas {
    max-height: 280px;
}

.chart-empty-msg {
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.83rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-time {
    color: var(--text-muted);
    font-size: 0.72rem;
    margin-top: 2px;
}

.empty-state-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 16px 0;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition);
}

.quick-action-btn svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.quick-action-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

/* ============================================
   TOOLBAR (Filters & Search)
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    flex: 1;
    min-width: 200px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent);
}

.search-box svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    border: none;
    background: none;
    padding: 10px 0;
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
    outline: none;
    color: var(--text-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-group select,
.summary-controls select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.83rem;
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    appearance: auto;
}

.filter-group select:focus,
.summary-controls select:focus {
    border-color: var(--accent);
}

.view-toggle {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    padding: 9px 14px;
    background: var(--bg-white);
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
    display: flex;
    align-items: center;
}

.view-btn svg {
    width: 18px;
    height: 18px;
}

.view-btn+.view-btn {
    border-left: 1.5px solid var(--border);
}

.view-btn.active {
    background: var(--accent);
    color: white;
}

.view-btn:hover:not(.active) {
    color: var(--accent);
}

/* Ongoing Badge */
.ongoing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--orange-bg);
    color: var(--orange);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
}

.ongoing-badge svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   DATA TABLE
   ============================================ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition);
}

.data-table tbody tr:hover {
    background: var(--accent-soft);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

/* Status Badges */
.badge-not-started {
    background: #f1f5f9;
    color: #64748b;
}

.badge-ongoing {
    background: var(--info-bg);
    color: var(--info);
}

.badge-in-review {
    background: var(--warning-bg);
    color: #b45309;
}

.badge-completed {
    background: var(--success-bg);
    color: #059669;
}

.badge-on-hold {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Priority Badges */
.badge-low {
    background: #f0fdf4;
    color: #16a34a;
}

.badge-medium {
    background: #fff7ed;
    color: #ea580c;
}

.badge-high {
    background: #fef2f2;
    color: #dc2626;
}

.badge-urgent {
    background: #dc2626;
    color: white;
}

/* Service Badges */
.badge-service {
    background: var(--accent-light);
    color: var(--accent);
}

/* Attendance Badges */
.badge-present {
    background: var(--success-bg);
    color: var(--success);
}

.badge-absent {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-wfh {
    background: var(--info-bg);
    color: var(--info);
}

.badge-half-day {
    background: var(--warning-bg);
    color: #b45309;
}

.badge-leave {
    background: var(--purple-bg);
    color: var(--purple);
}

/* ============================================
   AVATARS
   ============================================ */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    color: white;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    font-size: 0.7rem;
}

.avatar-md {
    width: 44px;
    height: 44px;
    font-size: 0.82rem;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.1rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 1.4rem;
}

/* Avatar colors */
.avatar-1 {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.avatar-2 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.avatar-3 {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.avatar-4 {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.avatar-5 {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.avatar-6 {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.avatar-7 {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.avatar-8 {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    border: 2px solid white;
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-more {
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    border: 2px solid white;
}

/* ============================================
   TABLE ACTION BUTTONS
   ============================================ */
.table-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

.action-btn svg {
    width: 15px;
    height: 15px;
}

.action-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.action-btn.delete:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}

/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    flex: 0 0 280px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-dot.not-started {
    background: #94a3b8;
}

.kanban-dot.ongoing {
    background: var(--accent);
}

.kanban-dot.in-review {
    background: var(--warning);
}

.kanban-dot.completed {
    background: var(--success);
}

.kanban-dot.on-hold {
    background: var(--danger);
}

.kanban-count {
    margin-left: auto;
    background: var(--border-light);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
}

.kanban-cards {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
}

.kanban-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 14px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.kanban-card-client {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.kanban-card-deadline {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-deadline svg {
    width: 12px;
    height: 12px;
}

.kanban-card-deadline.overdue {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================
   TEAM GRID
   ============================================ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.team-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition);
    position: relative;
}

.team-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.team-card-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity var(--transition);
}

.team-card:hover .team-card-actions {
    opacity: 1;
}

.team-card .avatar {
    margin-bottom: 14px;
}

.team-card-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.team-card-role {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.team-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    text-align: left;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.team-card-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-card-info-item svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.team-card-projects {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    width: 100%;
}

.team-card-projects-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-align: left;
}

.team-card-project-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.team-card-project-tag {
    padding: 3px 10px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
}

/* ============================================
   ATTENDANCE
   ============================================ */
.attendance-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.date-display input[type="date"] {
    padding: 10px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-white);
    cursor: pointer;
    outline: none;
}

.date-display input[type="date"]:focus {
    border-color: var(--accent);
}

.today-label {
    padding: 5px 12px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

#attendanceTable select {
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.82rem;
    background: var(--bg-white);
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    min-width: 150px;
    transition: border-color var(--transition);
}

#attendanceTable select:focus {
    border-color: var(--accent);
}

.summary-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   CALENDAR
   ============================================ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    padding: 16px;
}

.calendar-header-cell {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 8px 4px;
    text-transform: uppercase;
}

.calendar-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    gap: 2px;
    min-height: 48px;
}

.calendar-cell.empty {
    background: transparent;
}

.calendar-cell-day {
    font-size: 0.82rem;
    font-weight: 700;
}

.calendar-cell-status {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.calendar-cell.present {
    background: var(--success-bg);
    color: var(--success);
}

.calendar-cell.absent {
    background: var(--danger-bg);
    color: var(--danger);
}

.calendar-cell.wfh {
    background: var(--info-bg);
    color: var(--info);
}

.calendar-cell.half-day {
    background: var(--warning-bg);
    color: #b45309;
}

.calendar-cell.leave {
    background: var(--purple-bg);
    color: var(--purple);
}

.calendar-cell.no-record {
    background: var(--border-light);
    color: var(--text-muted);
}

/* ============================================
   REPORTS
   ============================================ */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.report-card.wide {
    grid-column: 1 / -1;
}

.comparison-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.comp-item {
    text-align: center;
}

.comp-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.comp-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
    display: block;
}

.comp-arrow {
    color: var(--text-muted);
}

.comp-arrow svg {
    width: 24px;
    height: 24px;
}

.attendance-rate {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 10px;
}

.rate-circle {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 6px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
}

.rate-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
}

.rate-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.15s ease;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.2s ease;
}

.modal-sm {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    border: none !important;
    background: none !important;
    padding: 6px !important;
}

.modal-close:hover {
    background: var(--bg-primary) !important;
    border-radius: var(--radius) !important;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 24px;
}

/* ============================================
   FORMS
   ============================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-white);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Multi-select checkboxes */
.multi-select {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-white);
    max-height: 120px;
    overflow-y: auto;
}

.multi-select-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 50px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    transition: all var(--transition);
    user-select: none;
}

.multi-select-item:hover {
    border-color: var(--accent);
}

.multi-select-item input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
}

.multi-select-item.selected {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.multi-select-empty {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--sidebar-bg);
    color: var(--text-white);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-xl);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.info {
    border-left: 4px solid var(--accent);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   EMPTY STATES
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
    gap: 12px;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.empty-state span {
    font-size: 0.9rem;
}

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--sidebar-bg);
    z-index: 100;
    padding: 8px 0 env(safe-area-inset-bottom, 8px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 6px 0;
    transition: color var(--transition);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
}

.mobile-nav-link.active {
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .chart-card {
        grid-row: auto;
    }

    .activity-card {
        grid-row: auto;
        grid-column: auto;
    }

    .quick-actions-card {
        grid-row: auto;
        grid-column: auto;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .mobile-nav {
        display: flex;
        justify-content: space-around;
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px 90px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-card-icon {
        width: 40px;
        height: 40px;
    }

    .page-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        min-width: auto;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .filter-group select {
        flex: 1;
        min-width: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 10px;
        border-radius: var(--radius-lg);
    }

    .kanban-board {
        flex-direction: column;
    }

    .kanban-column {
        flex: 0 0 auto;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .team-card-actions {
        opacity: 1;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 80px;
    }

    .toast {
        max-width: 100%;
    }

    .comparison-stat {
        gap: 16px;
    }

    .comp-value {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .attendance-controls {
        flex-wrap: wrap;
    }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(59, 130, 246, 0.15);
    animation: slideUp 0.4s ease;
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
}

.login-brand .brand-icon svg {
    width: 28px;
    height: 28px;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-brand h1 span {
    color: var(--accent);
    font-size: 0.85rem;
    display: block;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 2px;
}

.login-brand p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-top: 8px;
}

.login-error {
    color: var(--danger);
    font-size: 0.82rem;
    text-align: center;
    padding: 8px 12px;
    background: var(--danger-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 12px 18px;
    font-size: 0.9rem;
}

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 20px;
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-primary);
    gap: 16px;
}

.loading-screen p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar logout button */
.logout-btn {
    margin-left: auto;
    border: none !important;
    background: none !important;
    color: var(--text-muted) !important;
    padding: 6px !important;
}

.logout-btn:hover {
    color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-radius: var(--radius) !important;
}

.logout-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.role-hint {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.role-hint p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.role-hint p strong {
    color: var(--text-primary);
}

.role-info-card .data-table td {
    font-size: 0.82rem;
    text-align: center;
}

.role-info-card .data-table td:first-child {
    text-align: left;
    font-weight: 600;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .sidebar,
    .mobile-nav,
    .btn,
    .toast-container,
    .modal-overlay,
    .login-page {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .page {
        display: block !important;
    }

    body {
        background: white;
    }
}