/* ============================================
   herewetoss People Portal — Stage 1 CSS
   Functional, clean, replaceable.
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-secondary: #404e41;
    --color-tertiary: #85482c;
    --color-bg-primary: #efebe0;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f5f3ec;
    --color-text-primary: #2c2c2c;
    --color-text-secondary: #555;
    --color-text-muted: #888;
    --color-border: #d8d4c8;
    --color-border-strong: #bbb;
    --color-success: #2ecc71;
    --color-warning: #f39c12;
    --color-danger: #e74c3c;
    --color-info: #3498db;
    --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --sidebar-width: 240px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.5;
    font-size: 15px;
}

a { color: var(--color-tertiary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- App Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-secondary);
    color: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    padding: var(--space-6) 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 var(--space-6) var(--space-6);
    border-bottom: 1px solid rgba(239,235,224,0.15);
    margin-bottom: var(--space-4);
}
.sidebar-logo strong { display: block; font-size: 18px; font-weight: 600; color: var(--color-bg-primary); }
.sidebar-logo span { font-size: 12px; color: rgba(239,235,224,0.6); }

.sidebar-nav { list-style: none; flex: 1; }
.sidebar-nav li a {
    display: block;
    padding: 10px var(--space-6);
    color: rgba(239,235,224,0.75);
    font-size: 14px;
    font-weight: 400;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav li a:hover {
    background: rgba(239,235,224,0.08);
    color: var(--color-bg-primary);
    font-weight: 500;
    text-decoration: none;
}
.sidebar-nav li a.active {
    background: rgba(239,235,224,0.12);
    color: var(--color-bg-primary);
    font-weight: 600;
    border-left-color: var(--color-tertiary);
}

.sidebar-divider {
    height: 1px;
    background: rgba(239,235,224,0.15);
    margin: var(--space-3) var(--space-6);
}

.sidebar-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(239,235,224,0.15);
    font-size: 13px;
}
.sidebar-footer a {
    color: var(--color-bg-primary);
    font-weight: 500;
}
.sidebar-footer a:hover { color: rgba(239,235,224,0.6); text-decoration: none; }
.user-chip { display: block; margin-bottom: var(--space-1); font-weight: 400; color: rgba(239,235,224,0.6); }
.logout-link { font-size: 12px; }

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: var(--space-8) var(--space-10);
}

.page-header { margin-bottom: var(--space-6); }
.page-header h1 { font-size: 24px; font-weight: 600; color: var(--color-secondary); }
.page-header p { color: var(--color-text-secondary); margin-top: var(--space-1); font-size: 14px; }
.page-header-actions { margin-top: var(--space-3); }

/* --- Stat Cards --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}
.stat-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
}
.stat-label {
    display: block;
    font-size: 12px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 600;
    color: var(--color-tertiary);
    margin: var(--space-1) 0;
}
.stat-sub { font-size: 13px; color: var(--color-text-secondary); }

/* --- Cards --- */
.card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}
.card h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-4);
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}
.badge-approved, .badge-annual { background: #d4edda; color: #155724; }
.badge-pending, .badge-personal { background: #fff3cd; color: #856404; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-admin { background: #f8d7da; color: #721c24; }
.badge-employee { background: #d1ecf1; color: #0c5460; }
.badge-sick { background: #d1ecf1; color: #0c5460; }
.badge-unpaid { background: #e2e3e5; color: #383d41; }
.badge-info { background: #cce5ff; color: #004085; }

/* --- Lists --- */
.out-list, .notice-list { list-style: none; }
.out-list li, .notice-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.out-list li:last-child, .notice-list li:last-child { border-bottom: none; }

.notice-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-tertiary);
    flex-shrink: 0;
}
.notice-list li div p { margin-top: 2px; font-size: 13px; }

/* --- Tables --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    font-size: 12px;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-2) var(--space-3);
    border-bottom: 2px solid var(--color-border);
    font-weight: 600;
}
.data-table td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.data-table tr:hover { background: var(--color-bg-tertiary); }
.data-table th a { color: var(--color-secondary); font-weight: 600; white-space: nowrap; }
.data-table th a:hover { color: var(--color-tertiary); }
.data-table th a:hover .sort-arrow { color: var(--color-tertiary); }
.sort-arrow { color: var(--color-tertiary); font-weight: 700; }

/* --- Forms --- */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--space-1);
    color: var(--color-text-secondary);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-tertiary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}
.form-group input.readonly,
.form-group input[readonly] {
    background: var(--color-bg-light);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}
.form-group textarea { resize: vertical; min-height: 80px; }

.form-group .error-text {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: var(--space-1);
}
.form-group input.input-error,
.form-group select.input-error {
    border-color: var(--color-danger);
}

/* Standalone form controls (used alongside form-group inputs) */
input.form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    outline: none;
    border-color: var(--color-tertiary);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}
input.form-control[readonly] {
    background: var(--color-bg-light);
    color: var(--color-text-secondary);
    cursor: not-allowed;
}

/* Content header (used in invite/auth_error pages) */
.content-header {
    margin-bottom: 1.5rem;
}

/* Section divider */
.section-divider {
    margin: 32px 0 24px;
    border-top: 1px solid var(--color-border);
    padding-top: 24px;
}

/* Filter bar */
.filter-bar {
    margin-left: 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Status badges */
.status-active { color: var(--color-secondary); font-weight: 600; }
.status-inactive { color: var(--color-text-muted); }
.status-pending { color: #d48806; font-weight: 600; }

/* btn-success (same as btn-primary but with success green) */
.btn-success {
    background: #2e7d32;
    color: #fff;
}
.btn-success:hover { background: #1b5e20; color: #fff; }

/* badge-active */
.badge-active { background: rgba(64, 78, 65, 0.12); color: var(--color-secondary); font-weight: 500; }

/* Info box */
.info-box {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    font-size: 14px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
    text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--color-secondary);
    color: var(--color-bg-primary);
}
.btn-primary:hover { background: #354d37; }
.btn-primary:disabled {
    background: #bbb;
    cursor: not-allowed;
}

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

.btn-ghost {
    background: transparent;
    color: var(--color-secondary);
    padding: 10px 12px;
}
.btn-ghost:hover { background: rgba(64, 78, 65, 0.06); }

.btn-tertiary {
    background: var(--color-tertiary);
    color: var(--color-bg-primary);
}
.btn-tertiary:hover { background: #6d3b24; }

.btn-danger {
    background: var(--color-tertiary);
    color: #fff;
}
.btn-danger:hover { background: #6d3b24; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }

.btn-group {
    display: flex;
    gap: var(--space-2);
}

/* --- Alerts --- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: var(--space-4);
}
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #cce5ff; color: #004085; border: 1px solid #b8daff; }

/* --- Leave Balance Bars --- */
.balance-bar-container { margin-bottom: var(--space-4); }
.balance-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: var(--space-1);
}
.balance-bar-label span:last-child { color: var(--color-text-muted); }
.balance-bar {
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.balance-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--color-tertiary);
    transition: width 0.3s ease;
}

/* --- Document Cards --- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}
.doc-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.doc-card-title { font-weight: 600; font-size: 15px; }
.doc-card-meta { font-size: 12px; color: var(--color-text-muted); }
.doc-card .btn { margin-top: auto; align-self: flex-start; }

/* --- Employee Cards (Team Directory) --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
}
.employee-card {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-5);
    text-align: center;
}
.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--color-secondary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: var(--space-3);
}
.avatar-circle.role-admin { background: var(--color-tertiary); }
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}
.profile-header .avatar-circle {
    width: 64px;
    height: 64px;
    font-size: 24px;
    margin-bottom: 0;
}
.profile-header h2 { font-size: 20px; margin-bottom: 4px; }
.profile-header p { color: var(--color-text-secondary); margin-bottom: 6px; }
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}
.info-item label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}
.info-item span { font-size: 15px; font-weight: 500; }
.employee-card-name { font-weight: 600; font-size: 15px; }
.employee-card-role { font-size: 13px; color: var(--color-text-secondary); }
.employee-card-dept { font-size: 12px; color: var(--color-text-muted); }

/* --- Payslip List --- */
.payslip-list { list-style: none; }
.payslip-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}
.payslip-item:last-child { border-bottom: none; }
.payslip-item-label { font-weight: 500; }
.payslip-item .badge-latest {
    background: var(--color-tertiary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-left: var(--space-2);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    color: var(--color-text-muted);
}
.empty-state p { font-size: 15px; margin-bottom: var(--space-3); }
.empty-state .btn { margin-top: var(--space-2); }

/* --- Modal / Confirmation Dialog --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    width: 90%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h3 { font-size: 18px; margin-bottom: var(--space-3); }
.modal p { font-size: 14px; color: var(--color-text-secondary); margin-bottom: var(--space-5); }
.modal .btn-group { justify-content: flex-end; }

/* --- Loading Spinner --- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-tertiary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utility --- */
.text-muted { color: var(--color-text-muted); }
.text-xs { font-size: 12px; }
.text-sm { font-size: 13px; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* --- Login Page --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-secondary);
}
.login-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-10);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: var(--space-1);
}
.login-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: var(--space-6);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -var(--sidebar-width);
        transition: left 0.25s;
    }
    .sidebar.open { left: 0; }

    .main-content {
        margin-left: 0;
        padding: var(--space-5) var(--space-4);
    }

    .stat-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .doc-grid { grid-template-columns: 1fr; }
    .team-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .login-card { padding: var(--space-6); }
}

@media (max-width: 480px) {
    .data-table { font-size: 13px; }
    .data-table th, .data-table td { padding: var(--space-2); }
    .stat-number { font-size: 28px; }
}

/* --- Calendar Styles --- */
.calendar-wrapper {
    overflow-x: auto;
    padding: var(--space-2) 0;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: var(--space-2);
}

.cal-day-name {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: var(--space-2);
}
.cal-day-name.sat, .cal-day-name.sun { color: var(--color-secondary); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    min-height: 64px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    font-size: 13px;
}

.calendar-day.empty {
    background: var(--color-bg-tertiary);
    border-color: transparent;
}

.calendar-day .day-number {
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-text-primary);
}

.calendar-day.today {
    border: 2px solid var(--color-tertiary);
}

.calendar-day .today-circle {
    width: 28px;
    height: 28px;
    background: var(--color-tertiary);
    color: #fff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.calendar-day .day-label {
    font-size: 10px;
    margin-top: var(--space-1);
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.calendar-day.holiday {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}
.calendar-day .holiday-label {
    background: var(--color-secondary);
    color: #fff;
}

.calendar-day.off-sat,
.calendar-day.sunday {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}
.calendar-day.off-sat .day-number,
.calendar-day.sunday .day-number {
    color: var(--color-secondary);
    font-weight: 700;
}

.calendar-day.working-sat {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}
.calendar-day.working-sat .day-number {
    color: var(--color-text-primary);
}
.calendar-day .working-sat-label {
    background: rgba(64, 78, 65, 0.15);
    color: var(--color-secondary);
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
}

.calendar-day.leave-approved {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}

.calendar-day.leave-pending {
    background: rgba(64, 78, 65, 0.04);
    border-color: rgba(64, 78, 65, 0.15);
}

.calendar-day .leave-label {
    background: var(--color-secondary);
    color: #fff;
}
.calendar-day.leave-pending .leave-label {
    background: rgba(64, 78, 65, 0.6);
    color: #fff;
}

/* Overlap: if a day is both leave and something else */
.calendar-day.leave-approved.holiday {
    background: linear-gradient(135deg, rgba(64,78,65,0.08) 50%, rgba(64,78,65,0.08) 50%);
}
.calendar-day.leave-pending.holiday {
    background: linear-gradient(135deg, rgba(64,78,65,0.04) 50%, rgba(64,78,65,0.08) 50%);
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--color-border);
}

.legend-box.working {
    background: #ffffff;
    border-color: var(--color-border);
}
.legend-box.off-sat,
.legend-box.sunday {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}
.legend-box.holiday {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}
.legend-box.leave-approved {
    background: rgba(64, 78, 65, 0.08);
    border-color: rgba(64, 78, 65, 0.25);
}
.legend-box.leave-pending {
    background: rgba(64, 78, 65, 0.04);
    border-color: rgba(64, 78, 65, 0.15);
}

/* Admin Calendar with Employee Colors */
.admin-calendar .calendar-day {
    min-height: 70px;
}

.admin-calendar .leave-employee-label {
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #fff;
    margin-top: var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

/* Calendar Navigation */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.calendar-nav h2 {
    text-align: center;
    color: var(--color-tertiary);
}

/* Day Leaves Chips */
.calendar-day .day-leaves {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: var(--space-1);
    width: 100%;
}

.calendar-day .day-leave-chip {
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--color-info);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============================================
   Meeting Pages
   ============================================ */

/* --- Meeting Status Badges --- */
.meeting-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}
.meeting-badge-done { background: #d4edda; color: #155724; }
.meeting-badge-processing { background: #fff3cd; color: #856404; }
.meeting-badge-failed { background: #f8d7da; color: #721c24; }

/* --- Clickable Table Rows --- */
.clickable-row {
    cursor: pointer;
    transition: background 0.15s;
}
.clickable-row:hover {
    background: var(--color-bg-tertiary) !important;
}
.clickable-row td:first-child {
    font-weight: 500;
    color: var(--color-tertiary);
}

/* --- Meeting List Select --- */
.meeting-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--color-tertiary);
    cursor: pointer;
}

/* --- Meeting Card Section --- */
.meeting-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}
.meeting-section-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--color-secondary);
}
.meeting-section-header .section-icon {
    font-size: 18px;
}

/* --- Action Items List --- */
.action-items-list {
    list-style: none;
    counter-reset: action-counter;
    padding: 0;
    margin: 0;
}
.action-items-list li {
    counter-increment: action-counter;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-primary);
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}
.action-items-list li:last-child {
    border-bottom: none;
}
.action-items-list li::before {
    content: counter(action-counter);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    background: rgba(64, 78, 65, 0.1);
    color: var(--color-secondary);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

/* --- Key Decisions List --- */
.decisions-list {
    list-style: disc;
    padding-left: var(--space-4);
    margin: 0;
}
.decisions-list li {
    padding: var(--space-2) 0;
    font-size: 14px;
    color: var(--color-text-primary);
}

/* --- Sticky Audio Player --- */
.audio-player-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    padding: var(--space-3) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.audio-player-inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    max-width: 800px;
    width: 100%;
}
.audio-player-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    font-family: var(--font-body);
}
.audio-player-bar audio {
    flex: 1;
    height: 36px;
    outline: none;
}
.speed-controls {
    display: flex;
    gap: 3px;
    margin-left: var(--space-2);
}
.speed-btn {
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: var(--font-body);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.15s;
}
.speed-btn:hover {
    background: var(--color-border);
}
.speed-btn.active {
    background: var(--color-tertiary);
    color: #fff;
    border-color: var(--color-tertiary);
    font-weight: 600;
}

/* --- Transcript --- */
.transcript-toggle {
    cursor: pointer;
    user-select: none;
}
.transcript-toggle:hover {
    background: var(--color-bg-tertiary);
}
.transcript-body {
    border-top: 1px solid var(--color-border);
    padding: var(--space-5);
}
.transcript-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text-primary);
    line-height: 1.8;
    margin: 0;
}
.transcript-text a.timestamp-link {
    color: var(--color-tertiary);
    text-decoration: none;
    font-weight: 600;
}
.transcript-text a.timestamp-link:hover {
    text-decoration: underline;
}

/* --- Upload Progress Steps --- */
.upload-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-5);
}
.upload-step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 13px;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    transition: color 0.3s;
}
.upload-step.active {
    color: var(--color-tertiary);
    font-weight: 600;
}
.upload-step.done {
    color: var(--color-secondary);
    font-weight: 500;
}
.upload-step-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    transition: background 0.3s;
}
.upload-step.active .upload-step-dot {
    background: var(--color-tertiary);
    animation: pulse 1.2s ease-in-out infinite;
}
.upload-step.done .upload-step-dot {
    background: var(--color-secondary);
}
.upload-step-arrow {
    color: var(--color-border);
    font-size: 12px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-5);
    font-family: var(--font-body);
}
.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
}
.pagination a {
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}
.pagination a:hover {
    background: var(--color-bg-tertiary);
    text-decoration: none;
}
.pagination .active {
    background: var(--color-secondary);
    color: #fff;
    border: 1px solid var(--color-secondary);
}
.pagination .disabled {
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    background: var(--color-bg-tertiary);
    cursor: not-allowed;
}

/* --- Meeting Alert Banner --- */
.meeting-alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: var(--space-5);
    font-family: var(--font-body);
}
.meeting-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.meeting-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--color-border);
    padding: var(--space-8);
    text-align: center;
    border-radius: var(--radius);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    background: var(--color-bg-tertiary);
}
.drop-zone:hover {
    border-color: var(--color-tertiary);
    background: rgba(133, 72, 44, 0.04);
}
.drop-zone.active {
    border-color: var(--color-secondary);
    background: rgba(64, 78, 65, 0.06);
}
.drop-zone .drop-icon {
    font-size: 2.5em;
    margin-bottom: var(--space-2);
}
.drop-zone .drop-label {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-bottom: var(--space-1);
}
.drop-zone .drop-formats {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* --- Bulk Delete Bar --- */
.bulk-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 13px;
    color: var(--color-text-secondary);
}
.bulk-bar.visible {
    display: flex;
}

/* Audio player body padding */
.has-audio-player {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    .audio-player-bar {
        left: 0;
    }
    .speed-controls {
        display: none;
    }
}

/* Inactive user row styling */
.inactive-user {
    background-color: var(--bg-secondary) !important;
    opacity: 0.7;
}

.inactive-user td {
    color: var(--color-text-muted) !important;
}

/* Custom button classes requested by user */
.btn-accent {
    background: var(--color-accent);
    color: white;
}
.btn-accent:hover {
    background: var(--color-accent-hover, #d97706);
}

.btn-success {
    background: var(--color-success, #10b981);
    color: white;
}
.btn-success:hover {
    background: #059669;
}
