/* ===================================
   Grillfry Payroll System - Styles
   =================================== */

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

:root {
    /* Color Palette */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --secondary: #6b7280;
    --secondary-dark: #4b5563;
    --background: #f8fafc;
    --card: #ffffff;
    --success: #22c55e;
    --success-dark: #16a34a;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --error: #ef4444;
    --error-dark: #dc2626;
    --danger: #dc2626;
    --danger-dark: #b91c1c;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    /* Border Colors */
    --border: #d1d5db;
    --border-light: #e5e7eb;
    --border-focus: #3b82f6;

    /* Sidebar */
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --sidebar-active: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: 150ms ease;
    --transition-fast: 100ms ease;
    --transition-slow: 200ms ease;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ===================================
   App Layout
   =================================== */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===================================
   Sidebar
   =================================== */

.sidebar {
    width: 240px;
    background-color: var(--sidebar-bg);
    color: var(--text-inverse);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--text-inverse);
}

.nav-item.active {
    background-color: var(--sidebar-active);
    color: var(--text-inverse);
    border-left-color: var(--text-inverse);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: var(--spacing-md);
    flex-shrink: 0;
}

/* ===================================
   Main Content
   =================================== */

.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===================================
   Header
   =================================== */

.header {
    background-color: var(--card);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-sm);
    color: var(--text-primary);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.header-date {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius);
    transition: background-color var(--transition);
}

.user-btn:hover {
    background-color: var(--background);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.dropdown-icon {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: var(--spacing-xs);
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    border: 1px solid var(--border-light);
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: background-color var(--transition);
}

.dropdown-item:hover {
    background-color: var(--background);
}

.dropdown-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

/* ===================================
   Content Area
   =================================== */

.content-area {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

/* ===================================
   Cards
   =================================== */

.card {
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
}

/* Payroll Tab - Simplified Layout */
.payroll-container {
    padding: 24px;
    max-width: 1200px;
}

.payroll-header {
    margin-bottom: 24px;
}

.payroll-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.payroll-card {
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.payroll-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.payroll-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.payroll-form-grid .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payroll-form-grid label {
    font-size: 12px;
    color: var(--text-secondary);
}

.payroll-form-grid select,
.payroll-form-grid input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text-primary);
}

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

.card-header-row h3 {
    margin: 0;
}

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

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

.payslips-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.payslips-table td {
    font-size: 14px;
    color: var(--text-primary);
}

.payslips-table tbody tr:hover {
    background: var(--bg-secondary);
}

.payslips-table input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

/* Employee KPI Cards - Compact Smart Cards */
.employee-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.employee-kpi-card {
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employee-kpi-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.employee-kpi-card.status-positive { border-left-color: #10b981; }
.employee-kpi-card.status-warning { border-left-color: #f59e0b; }
.employee-kpi-card.status-negative { border-left-color: #ef4444; }
.employee-kpi-card.status-neutral { border-left-color: #6b7280; }

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

.employee-kpi-avatar, .employee-kpi-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.employee-kpi-avatar-placeholder {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.employee-kpi-info {
    flex: 1;
    min-width: 0;
}

.employee-kpi-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.employee-kpi-meta {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
}

.employee-kpi-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.employee-kpi-stat {
    text-align: center;
    padding: 6px 4px;
    background: var(--bg);
    border-radius: 6px;
}

.employee-kpi-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.employee-kpi-stat-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.employee-kpi-stat-value.positive { color: #10b981; }
.employee-kpi-stat-value.warning { color: #f59e0b; }
.employee-kpi-stat-value.negative { color: #ef4444; }

.employee-kpi-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.employee-kpi-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.employee-kpi-progress-bar.paid { background: #10b981; }
.employee-kpi-progress-bar.loan { background: #ef4444; }

.employee-kpi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Legacy KPI card styles */
.kpi-card {
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon.blue { background-color: #dbeafe; color: var(--primary); }
.kpi-icon.green { background-color: #dcfce7; color: var(--success); }
.kpi-icon.amber { background-color: #fef3c7; color: var(--warning); }
.kpi-icon.gray { background-color: #f3f4f6; color: var(--secondary); }

.kpi-icon svg {
    width: 24px;
    height: 24px;
}

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.kpi-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===================================
   Tables
   =================================== */

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    background-color: #f3f4f6;
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table th:first-child {
    border-radius: var(--radius) 0 0 0;
}

.table th:last-child {
    border-radius: 0 var(--radius) 0 0;
}

.table td {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.table tbody tr {
    transition: background-color var(--transition);
}

.table tbody tr:hover {
    background-color: #f0f9ff;
}

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

/* Table Actions */
.table-actions {
    position: relative;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 20;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
    border: 1px solid var(--border-light);
}

.action-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.action-menu-item {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: none;
    border: none;
    text-align: left;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color var(--transition);
}

.action-menu-item:hover {
    background-color: var(--background);
}

.action-menu-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.action-menu-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.action-menu-item.danger {
    color: var(--error);
}

/* ===================================
   Badges
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge.blue { background-color: #dbeafe; color: #1e40af; }
.badge.green { background-color: #dcfce7; color: #166534; }
.badge.amber { background-color: #fef3c7; color: #92400e; }
.badge.gray { background-color: #f3f4f6; color: #6b7280; }
.badge.red { background-color: #fee2e2; color: #991b1b; }

/* ===================================
   Progress Bars
   =================================== */

.progress-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #4ade80);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* ===================================
   Forms
   =================================== */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--card);
    color: var(--text-primary);
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--error);
}

.form-error {
    font-size: 12px;
    color: var(--error);
    margin-top: var(--spacing-xs);
}

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

/* ===================================
   Buttons
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-inverse);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: var(--background);
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-inverse);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--danger-dark);
}

.btn-success {
    background-color: var(--success);
    color: var(--text-inverse);
}

.btn-success:hover:not(:disabled) {
    background-color: var(--success-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-icon {
    padding: 8px;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

/* ===================================
   Modal
   =================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: min(900px, calc(100vw - 32px));
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition);
}

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

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

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

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

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
}

/* ===================================
   Attendance Edit Modal
   =================================== */
.att-edit-container {
    min-width: 360px;
}

.att-edit-date {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-light);
}

.att-edit-status-section {
    margin-bottom: var(--spacing-lg);
}

.att-edit-status-section label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.att-status-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.att-status-btn {
    flex: 1;
    min-width: 70px;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.att-status-btn:hover {
    border-color: var(--primary);
    background: var(--bg-tertiary);
}

.att-status-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Check-in/out logs display */
.att-edit-logs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.att-log-section {
    flex: 1;
    min-width: 0;
}

.att-log-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
}

.att-log-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.att-log-selfie img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.att-log-time {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.att-log-geo {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.att-log-geo .geo-link {
    color: var(--primary);
    text-decoration: none;
}

.att-log-geo .geo-link:hover {
    text-decoration: underline;
}

.att-edit-times {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.att-time-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.att-time-field label,
.att-hours-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.att-time-field input[type="time"] {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.att-hours-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.att-hours-display {
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary);
}

.att-edit-notes {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.att-edit-notes label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.att-edit-notes input {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.att-edit-actions {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

/* Shift Cards */
.att-shifts-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.att-shift-card {
    background: var(--card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.att-shift-card.open {
    border-left: 4px solid var(--warning);
}

.att-shift-card.closed {
    border-left: 4px solid var(--success);
}

.att-shift-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.att-shift-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.att-shift-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.att-shift-badge.completed {
    background: #dcfce7;
    color: #166534;
}

.att-shift-badge.open {
    background: #fef3c7;
    color: #92400e;
}

.att-shift-body {
    padding: var(--spacing-md);
}

.att-shift-timeline {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.att-shift-in,
.att-shift-out {
    flex: 1;
    min-width: 0;
}

.att-shift-in {
    padding-right: var(--spacing-md);
    border-right: 2px dashed var(--border-light);
}

.att-shift-out {
    padding-left: var(--spacing-md);
}

.att-shift-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.5px;
}

.att-shift-selfie {
    margin-bottom: var(--spacing-xs);
}

.att-shift-selfie img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-light);
}

.att-shift-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.att-shift-geo {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.att-shift-geo a {
    color: var(--primary);
    text-decoration: none;
}

.att-shift-geo a:hover {
    text-decoration: underline;
}

.att-shift-empty {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    padding: var(--spacing-xs) 0;
}

.att-shift-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.att-shift-actions .btn-icon {
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.att-shift-actions .btn-icon:hover {
    background: var(--bg-tertiary);
}

.att-add-shift-btn {
    width: 100%;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-sm);
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.att-add-shift-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-secondary);
}

/* Shift inline form */
.att-shift-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.att-shift-form-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.att-shift-form-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.att-shift-form-field input {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.att-shift-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
    padding: var(--spacing-xs) 0;
}

.att-shift-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.att-shift-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.att-shift-duration strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ===================================
   Toast Notifications
   =================================== */

.toast-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-close svg {
    width: 16px;
    height: 16px;
}

.stat-employee-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.stat-employee-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-employee-item .emp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.emp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

/* Profile Photo in Employee Form */
.profile-photo-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 16px;
}

.profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    font-size: 32px;
    font-weight: 600;
    color: white;
}

.profile-photo-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-photo-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stat-employee-item .emp-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.stat-employee-item .emp-details strong {
    font-size: 14px;
    color: var(--text-primary);
}

.stat-employee-item .emp-details .emp-mobile {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-employee-item .emp-status-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.stat-employee-item .emp-status-badge.green { background: #dcfce7; color: #166534; }
.stat-employee-item .emp-status-badge.warning { background: #fef9c3; color: #854d0e; }
.stat-employee-item .emp-status-badge.error { background: #fee2e2; color: #991b1b; }
.stat-employee-item .emp-status-badge.gray { background: #f3f4f6; color: #6b7280; }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* ===================================
   Attendance Calendar
   =================================== */

.attendance-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.month-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.month-nav-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition);
}

.month-nav-btn:hover {
    background-color: var(--background);
    border-color: var(--primary);
}

.current-month {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.attendance-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: var(--border-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.attendance-header {
    background-color: #f3f4f6;
    padding: var(--spacing-sm);
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.attendance-day {
    background-color: var(--card);
    padding: var(--spacing-sm);
    min-height: 80px;
    cursor: pointer;
    transition: background-color var(--transition);
}

.attendance-day:hover {
    background-color: #f0f9ff;
}

.attendance-day.present {
    background-color: #dcfce7;
}

.attendance-day.half-day {
    background-color: #fef9c3;
}

.attendance-day.absent {
    background-color: #fee2e2;
}

.attendance-day.not-marked {
    background-color: var(--background);
}

.attendance-day.checked-in {
    background-color: #dbeafe;
}

.attendance-day.future {
    background-color: #f3f4f6;
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
}

.attendance-day.half-day .day-status {
    color: var(--warning-dark);
}

.attendance-day.checked-in .day-status {
    color: #1d4ed8;
}

.day-number {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.day-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.attendance-day.present .day-status {
    color: var(--success-dark);
}

.attendance-day.absent .day-status {
    color: var(--error);
}

/* Salary-payment coverage overlay — used on the Attendance calendar and
   inside the Payment form's day picker. Purple = already paid; the cell
   shows a ✓ and is non-clickable. */
.attendance-day.paid {
    background-color: #e0e7ff;
    cursor: not-allowed;
}
.attendance-day.paid .day-status {
    color: #4338ca;
    font-weight: 600;
}
.attendance-day.selectable {
    cursor: pointer;
}
.attendance-day.selectable:hover {
    background-color: #bbf7d0;
}
.attendance-day.selected {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.attendance-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.attendance-message svg {
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.attendance-message p {
    font-size: 16px;
}

.attendance-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

.today-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.today-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

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

.status-badge.half-day {
    background: var(--warning);
    color: white;
}

.status-badge.absent {
    background: var(--error);
    color: white;
}

.status-text {
    color: var(--text-muted);
    font-size: 14px;
}

.today-stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    color: white;
}

.today-stats-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.today-date-display {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 16px;
    font-weight: 500;
    opacity: 0.95;
}

.today-date-display svg {
    opacity: 0.9;
}

.today-stats-badges {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.today-stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: var(--spacing-md) var(--spacing-lg);
    min-width: 120px;
    flex: 1;
}

.today-stat-card .stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.today-stat-card .stat-info {
    display: flex;
    flex-direction: column;
}

.today-stat-card .stat-count {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.today-stat-card .stat-label {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.today-stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.today-stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.today-stat-card.present .stat-icon { background: rgba(34, 197, 94, 0.3); }
.today-stat-card.halfday .stat-icon { background: rgba(234, 179, 8, 0.3); }
.today-stat-card.absent .stat-icon { background: rgba(239, 68, 68, 0.3); }
.today-stat-card.notmarked .stat-icon { background: rgba(156, 163, 175, 0.3); }

.attendance-day.today {
    border: 2px solid var(--primary);
}

.bulk-attendance-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.bulk-attendance-section h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.bulk-form {
    background: var(--background);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
}

.bulk-row {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
    flex-wrap: wrap;
}

.bulk-field {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.bulk-field label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.bulk-field select[multiple] {
    height: 100px;
}

.bulk-controls {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: var(--spacing-md);
}

.bulk-date-branch {
    display: flex;
    gap: var(--spacing-md);
}

.bulk-status-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

.bulk-employee-list {
    max-height: 300px;
    overflow-y: auto;
    background: var(--background);
    border-radius: var(--radius);
}

.bulk-table {
    width: 100%;
}

.bulk-table th,
.bulk-table td {
    padding: var(--spacing-sm);
}

.bulk-table tbody tr {
    transition: background 0.2s;
}

.bulk-table tbody tr.updated {
    background: #dcfce7;
}

.bulk-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.bulk-summary {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.bulk-summary .summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius);
    min-width: 80px;
}

.bulk-summary .summary-count {
    font-size: 24px;
    font-weight: 600;
}

.bulk-summary .summary-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.bulk-summary .summary-item.success {
    background: #dcfce7;
    color: var(--success-dark);
}

.bulk-summary .summary-item.warning {
    background: #fef9c3;
    color: var(--warning-dark);
}

.bulk-summary .summary-item.danger {
    background: #fee2e2;
    color: var(--error);
}

/* ── Face Attendance Logs ─────────────────────────────────────── */
.att-tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}
.att-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.2s;
}
.att-tab:hover { color: var(--text-primary); }
.att-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.face-logs-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.face-logs-filters label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.face-logs-filters select,
.face-logs-filters input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.face-logs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.face-log-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.face-log-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.face-log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border-color);
}
.face-log-header img,
.face-log-header .emp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.face-log-header .emp-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}
.face-log-emp-info {
    flex: 1;
    min-width: 0;
}
.face-log-emp-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.face-log-emp-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
    margin-top: 2px;
}
.face-log-shift-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #ede9fe;
    color: #6d28d9;
}

.face-log-body {
    display: flex;
    gap: 0;
    padding: 12px 16px;
}
.face-log-check {
    flex: 1;
    min-width: 0;
    text-align: center;
}
.face-log-check + .face-log-check {
    border-left: 1px solid var(--border-color);
    padding-left: 12px;
}
.face-log-check-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.face-log-selfie {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 2px solid var(--border-color);
}
.face-log-no-selfie {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: #f3f4f6;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 20px;
}
.face-log-time {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.face-log-geo {
    font-size: 11px;
    color: #2563eb;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}
.face-log-geo:hover { text-decoration: underline; }
.face-log-geo svg { flex-shrink: 0; }

.face-log-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}
.face-log-duration {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}
.face-log-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.face-logs-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}
.face-logs-empty svg {
    margin-bottom: 12px;
    opacity: 0.4;
}
.face-logs-empty p {
    font-size: 14px;
    margin: 0;
}

.face-log-selfie-sm {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 1px solid var(--success);
}

.btn-outline-success.active {
    background: var(--success);
    color: white;
}

.btn-outline-warning {
    background: transparent;
    color: var(--warning);
    border: 1px solid var(--warning);
}

.btn-outline-warning.active {
    background: var(--warning);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

.btn-outline-danger.active {
    background: var(--error);
    color: white;
}

.bulk-employee-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}

.bulk-employee-card.updated {
    border-color: var(--success);
    background: #f0fdf4;
}

.emp-info {
    display: flex;
    flex-direction: column;
}

.emp-name {
    font-weight: 500;
    color: var(--text-primary);
}

.emp-mobile {
    font-size: 12px;
    color: var(--text-muted);
}

.emp-status-btns {
    display: flex;
    gap: 4px;
}

.emp-status-btns .btn-sm {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 14px;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
    border-color: var(--warning);
}

.btn-warning:hover {
    background-color: var(--warning-dark);
    border-color: var(--warning-dark);
}

.btn-success {
    background-color: var(--success);
    color: white;
    border-color: var(--success);
}

.btn-success:hover {
    background-color: var(--success-dark);
    border-color: var(--success-dark);
}

.attendance-summary {
    display: flex;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--background);
    border-radius: var(--radius);
}

.summary-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.summary-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.summary-dot.present { background-color: var(--success); }
.summary-dot.absent { background-color: var(--error); }

.summary-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   Section Header
   =================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   Empty State
   =================================== */

.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    color: var(--text-secondary);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--spacing-md);
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===================================
   Stats Row
   =================================== */

.stats-row {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.stat-item {
    flex: 1;
    background-color: var(--card);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-item-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--spacing-xs);
}

/* ===================================
   Activity Feed
   =================================== */

.activity-feed {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.blue { background-color: #dbeafe; color: var(--primary); }
.activity-icon.green { background-color: #dcfce7; color: var(--success); }
.activity-icon.amber { background-color: #fef3c7; color: var(--warning); }

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-primary);
}

.activity-text strong {
    font-weight: 600;
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===================================
   Loan Card
   =================================== */

.loan-card {
    background-color: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.loan-card.completed {
    opacity: 0.7;
}

.loan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.loan-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.loan-actions .badge {
    margin-right: var(--spacing-sm);
}

.loan-employee {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.loan-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: var(--text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.loan-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.loan-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.loan-info .deduction-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    margin-left: 8px;
}

.loan-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-light);
}

.loan-detail-item {
    text-align: center;
}

.loan-detail-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.loan-detail-value.remaining {
    color: var(--error);
}

.loan-detail-value.repaid {
    color: var(--success);
}

.loan-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Loan Detail Modal */
.loan-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.loan-detail-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
}

.loan-detail-info h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.loan-detail-info .loan-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.loan-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.loan-detail-stat {
    background: var(--background);
    padding: var(--spacing-md);
    border-radius: var(--radius);
    text-align: center;
}

.loan-detail-stat .stat-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.loan-detail-stat .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Repayment List */
.repayment-section {
    margin-top: var(--spacing-lg);
}

.repayment-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.repayment-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 250px;
    overflow-y: auto;
}

.repayment-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--background);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.repayment-item .repayment-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.repayment-item .repayment-info {
    flex: 1;
}

.repayment-item .repayment-info strong {
    font-size: 14px;
    display: block;
}

.repayment-item .repayment-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.repayment-item .repayment-amount {
    font-size: 16px;
    font-weight: 600;
    color: var(--success);
}

.repayment-item .repayment-delete {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.repayment-item .repayment-delete:hover {
    opacity: 1;
}

/* Add Repayment Form */
.add-repayment-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.add-repayment-form .form-group.full-width {
    grid-column: 1 / -1;
}

.add-repayment-form .btn {
    margin-top: var(--spacing-sm);
}

/* ===================================
   Sales Table
   =================================== */

.sales-table th {
    text-align: left;
}

.sales-table td {
    font-size: 14px;
}

.sales-table .amount {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===================================
   Settings
   =================================== */

.settings-section {
    margin-bottom: var(--spacing-xl);
}

.settings-section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-light);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.settings-value {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .loan-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

.employee-form-page {
    max-width: 1000px;
    margin: 0 auto;
}

.employee-form {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.linked-warning {
    background: #fff7ed;
    border: 1px solid #f97316;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    color: #9a3412;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.linked-warning svg {
    flex-shrink: 0;
}

.linked-locked {
    opacity: 0.7;
    pointer-events: none;
}

.linked-info {
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    color: #1e40af;
}

.employee-form .form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

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

.employee-form .form-group-full {
    grid-column: 1 / -1;
}

.form-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.form-section h3 {
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.documents-list {
    margin-bottom: var(--spacing-md);
}

.document-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.document-name {
    font-weight: 500;
}

.document-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.document-link:hover {
    text-decoration: underline;
}

.document-size {
    color: var(--text-muted);
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.form-hint {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 12px;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 13px;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: 1px solid var(--danger);
}

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-direction: column;
    }

    .attendance-grid {
        font-size: 12px;
    }

    .attendance-day {
        min-height: 60px;
        padding: var(--spacing-xs);
    }

    .loan-details {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: var(--spacing-md);
        max-width: calc(100% - var(--spacing-lg) * 2);
    }

    .toast-container {
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-date {
        display: none;
    }

    .user-name {
        display: none;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .table {
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* ===================================
   Utility Classes
   =================================== */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }

.hidden { display: none !important; }

/* ===================================
   Login Screen
   =================================== */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-screen.hidden {
    display: none;
}

.login-container {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-xl);
    width: 100%;
    max-width: 400px;
    margin: var(--spacing-md);
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.login-logo {
    margin-bottom: var(--spacing-md);
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    transition: border-color var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.otp-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.login-btn {
    background: var(--primary);
    color: var(--text-inverse);
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.login-btn:hover {
    background: var(--primary-dark);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-footer {
    margin-top: var(--spacing-md);
    text-align: center;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.login-footer a:hover {
    text-decoration: underline;
}

.back-to-login {
    font-size: 14px;
    color: var(--text-secondary);
}

.inactive-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.loan-card.inactive {
    border-color: #fecaca;
    background: #fef2f2;
}

.loan-card.inactive .loan-actions button {
    pointer-events: none;
    opacity: 0.4;
}

/* RBAC / Users & Roles */
.rbac-view .badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}
.rbac-roles-grid .card {
    transition: box-shadow 0.2s;
}
.rbac-roles-grid .card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.rbac-tab {
    cursor: pointer;
    transition: background 0.2s;
}

/* ── Utility Classes (extracted from inline styles) ──────────────────────── */

.flex-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-header .section-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.back-btn:hover {
    background: var(--border-color);
}

.branch-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.branch-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.all-branches-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: 600;
}

.perm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.perm-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid var(--border-color);
}

.perm-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.perm-select {
    width: 100%;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.inline-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.inline-badge.blue { background: #3b82f6; color: white; }
.inline-badge.green { background: #10b981; color: white; }
.inline-badge.amber { background: #f59e0b; color: white; }
.inline-badge.red { background: #ef4444; color: white; }
.inline-badge.gray { background: #94a3b8; color: white; }

.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
}

.linked-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    background: #dbeafe;
    color: #1e40af;
}

.linked-badge:hover {
    background: #bfdbfe;
}

.muted-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-sm {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.face-id-section .face-id-status {
    padding: 8px 0;
}

.face-id-status .spinner-sm {
    display: block;
    margin: 8px auto;
}

#faceIdActions .btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#faceEnrollLinkResult input[readonly] {
    font-family: monospace;
}
