/* People App — Dark Theme (BambooHR-inspired) */

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --bg-input: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: rgba(255, 255, 255, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    margin: 0;
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 24px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.header-nav {
    display: flex;
    gap: 4px;
    align-items: center;
}

.header-btn {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent);
}

.header-btn.active {
    background: rgba(59, 130, 246, 0.4);
}

/* Mobile menu */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 768px) {
    .hamburger { display: block; }
    .header-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        padding: 16px;
        gap: 8px;
    }
    .header-nav.open { display: flex; }
    .header-btn { width: 100%; text-align: center; }
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

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

/* Summary cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: border-color 0.2s;
}
.summary-card:hover { border-color: var(--accent); }

.summary-card .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.summary-card .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td { background: rgba(255, 255, 255, 0.03); }

/* Forms */
.form-group { margin-bottom: 14px; }

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    color: white;
}

.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-active, .badge-success, .badge-approved { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-pending, .badge-warning, .badge-in_progress, .badge-not_started { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-draft { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.badge-expired, .badge-danger, .badge-denied, .badge-cancelled { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-terminated { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-on_leave { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.badge-archived { background: rgba(107, 114, 128, 0.2); color: #6b7280; }
.badge-completed { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-confidential { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.badge-restricted { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-internal { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.badge-public { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.badge-self, .badge-manager, .badge-peer { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }

/* Flash messages */
.flash {
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.flash-success { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.flash-error { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); }
.flash-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); }
.flash-info { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }

.flash-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* Page layout */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.page-header h1 { margin: 0; font-size: 1.4rem; }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control { width: auto; min-width: 160px; }

/* Detail page */
.detail-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px 20px;
}

.detail-label { color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; }

@media (max-width: 640px) {
    .detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
    .detail-label { margin-top: 10px; }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    overflow-x: auto;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: white; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

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

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

.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* Who's out / list items */
.whos-out-list { display: flex; flex-direction: column; }

.whos-out-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

/* Leave balance */
.balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.balance-card { padding: 8px 0; }

.balance-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.balance-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

/* Timeline */
.timeline { padding-left: 20px; }

.timeline-item {
    position: relative;
    padding: 0 0 20px 20px;
    border-left: 2px solid var(--border);
}

.timeline-item:last-child { border-left-color: transparent; }

.timeline-dot {
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-secondary);
}

/* Org chart */
.org-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: auto;
    padding: 20px 0;
}

.org-node-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.org-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: white;
    min-width: 140px;
    text-align: center;
    transition: border-color 0.2s;
}

.org-node:hover { border-color: var(--accent); }

.org-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.org-name { font-weight: 600; font-size: 0.9rem; }
.org-title { color: var(--text-secondary); font-size: 0.8rem; }

.org-children {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    position: relative;
}

.org-children::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 20px;
    border-left: 2px solid var(--border);
    transform: translateX(-50%);
}

/* Quick links */
.quick-link {
    display: block;
    padding: 10px 0;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    transition: color 0.15s;
}

.quick-link:hover { color: white; }
.quick-link:last-child { border-bottom: none; }

/* Rating stars */
.rating-group { display: flex; gap: 4px; }

.rating-label {
    cursor: pointer;
}

.rating-label input { display: none; }

.rating-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    font-weight: 600;
    transition: all 0.15s;
}

.rating-label input:checked + .rating-star {
    background: var(--accent);
    border-color: var(--accent);
}

.rating-label:hover .rating-star {
    border-color: var(--accent);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-top: 40px;
}

/* Auth pages */
.auth-container { max-width: 420px; margin: 60px auto; padding: 0 20px; }

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.auth-card h1 { text-align: center; margin-bottom: 20px; }

/* Dropdown menu */
.dropdown { position: relative; display: inline-block; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #2d2d44;
    min-width: 160px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
    margin-top: 4px;
}

.dropdown-content a {
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    transition: background 0.15s;
    font-size: 0.9rem;
}

.dropdown-content a:hover { background: rgba(255,255,255,0.08); }
.dropdown:hover .dropdown-content { display: block; }

/* Department list — show employee count */
.dept-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive grid */
@media (max-width: 768px) {
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Utility */
.text-muted { color: var(--text-secondary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
