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

:root {
  --bg: #f5f5f0;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --border: #e5e5e0;
  --primary: #1a1a1a;
  --primary-hover: #333;
  --danger: #c0392b;
  --danger-hover: #a93226;
  --accent: #2c5f2d;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --sidebar-width: 240px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* === Login === */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background: var(--bg);
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-md);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.login-header p { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.25rem; }

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.3px; }
.sidebar-brand .subtitle { font-size: 0.7rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 1px; }

.nav-links {
  list-style: none;
  padding: 0.75rem 0;
  flex: 1;
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-links a.active { color: #fff; border-left-color: #fff; background: rgba(255,255,255,0.08); }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logout-btn {
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem;
  transition: color 0.15s;
}
.logout-btn:hover { color: #fff; }

/* === Content === */
.content {
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  min-height: 100vh;
}

/* === Page Header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}

.page-header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }

.header-actions { display: flex; gap: 0.5rem; }

.page-desc { color: var(--text-secondary); font-size: 0.88rem; margin: -1rem 0 1.5rem; }

/* === Stats === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-number { font-size: 2rem; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.stat-label { color: var(--text-secondary); font-size: 0.82rem; margin-top: 0.25rem; }
.stat-link { font-size: 0.78rem; color: var(--accent); display: inline-block; margin-top: 0.75rem; }
.stat-link:hover { text-decoration: underline; }

/* === Quick Actions === */
.quick-actions h2 { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  box-shadow: var(--shadow);
}

.action-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

/* === Tables === */
.table-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: var(--shadow);
}

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

th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }
tr:hover { background: rgba(0,0,0,0.01); }

.actions { display: flex; gap: 0.4rem; align-items: center; }

.inline-form { display: inline; }

.link { color: var(--accent); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* === Forms === */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
  box-shadow: var(--shadow);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--font);
  background: #fff;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

.form-group textarea { resize: vertical; }

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500 !important;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] { width: auto; }

.section-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* === Detail View === */
.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.detail-item {}
.detail-label { display: block; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-secondary); margin-bottom: 0.2rem; }
.detail-value { font-size: 0.95rem; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface);
  color: var(--text);
}

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

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-secondary { background: var(--surface); color: var(--text); }

.btn-full { width: 100%; justify-content: center; padding: 0.65rem; }

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

/* === Alerts === */
.alert {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error { background: #fdf2f2; color: var(--danger); border: 1px solid #f5c6cb; }

/* === Badge === */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state p { color: var(--text-secondary); margin-bottom: 1rem; }

/* === Custom Field Rows === */
.custom-fields-section { margin-top: 0.5rem; }

.custom-field-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.custom-field-row input {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: var(--font);
  background: #fff;
  transition: border-color 0.15s;
}

.custom-field-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

#addFieldBtn { margin-top: 0.25rem; }

/* === Attendance === */
.attendance-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.date-shortcuts { display: flex; gap: 0.35rem; }
.date-nav { display: flex; align-items: center; gap: 0.35rem; }
.date-nav-arrow { min-width: 2rem; text-align: center; }
.date-nav-arrow.disabled { opacity: 0.35; pointer-events: none; }

.date-picker-form input[type="date"] {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font);
  background: var(--surface);
  cursor: pointer;
}
.date-picker-form input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
}

.date-display {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.status-in { background: #e8f5e9; color: #2e7d32; }
.status-out { background: #fff3e0; color: #e65100; }
.status-absent { background: var(--bg); color: var(--text-secondary); }

.text-muted { color: var(--text-secondary); }

/* Attendance Grid */
.att-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.att-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
  transition: box-shadow 0.15s;
}

.att-card:hover { box-shadow: var(--shadow-md); }
.att-checked-in { border-left-color: #2e7d32; }
.att-checked-out { border-left-color: #e65100; }

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

.att-card-name {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.att-card-dept {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.att-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.att-card-hours {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.att-card-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.btn-checkin {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}
.btn-checkin:hover { background: #1b5e20; border-color: #1b5e20; }

.btn-checkout {
  background: #e65100;
  color: #fff;
  border-color: #e65100;
}
.btn-checkout:hover { background: #bf360c; border-color: #bf360c; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.5rem 0;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  padding: 0;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 1rem 1.25rem;
  max-height: 300px;
  overflow-y: auto;
}

.modal-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.modal-log-row:last-child { border-bottom: none; }

.modal-log-num {
  font-size: 0.72rem;
  color: var(--text-secondary);
  min-width: 1.2rem;
}

.modal-log-time {
  font-family: monospace;
  font-size: 0.82rem;
}

.modal-log-in { color: #2e7d32; }
.modal-log-out { color: #e65100; }
.modal-log-arrow { color: var(--text-secondary); margin: 0 0.4rem; }

.mode-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.3rem;
  vertical-align: middle;
  line-height: 1;
}
.mode-face { background: #e3f2fd; color: #1565c0; }
.mode-qr { background: #f3e5f5; color: #7b1fa2; }
.mode-manual { background: #fff3e0; color: #e65100; }
.mode-fingerprint { background: #e8f5e9; color: #2e7d32; }
.mode-system { background: #f5f5f5; color: #616161; }

/* === ID Cards Page === */

/* ── Page layout ─────────────────────────────────────────── */
.id-cards-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ── Filter / sidebar panel ──────────────────────────────── */
.id-cards-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.35rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.04);
  position: sticky;
  top: 1.5rem;
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
}

.filter-panel-title {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text-secondary);
}

.filter-clear-all {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 500;
}
.filter-clear-all:hover { text-decoration: underline; }

.filter-group { margin-bottom: 0.95rem; }

.filter-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.32rem;
  color: var(--text);
  letter-spacing: 0.1px;
}

.filter-input {
  width: 100%;
  padding: 0.48rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.83rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.filter-input:focus {
  outline: none;
  border-color: var(--text);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}
.filter-input::placeholder { color: #bbb; }
select.filter-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6b6b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

.filter-divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 1.1rem 0;
}

.selection-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.selection-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.42rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--text);
  color: #fff;
  transition: background 0.2s;
}

.selection-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  line-height: 1.45;
}

.selection-btn-row {
  display: flex;
  gap: 0.4rem;
}

.btn-full-half {
  flex: 1;
  justify-content: center;
  font-size: 0.78rem;
}

/* Download panel */
.dl-zip-group {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  margin-top: 0.55rem;
}

.dl-zip-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-start;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.44rem 0.75rem;
  border-radius: 7px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.dl-zip-btn:hover { background: var(--surface); border-color: var(--text); }
.dl-zip-btn:disabled { opacity: 0.4; cursor: default; }
.dl-zip-btn svg { flex-shrink: 0; color: var(--text-secondary); }

/* ── Toolbar ─────────────────────────────────────────────── */
.id-cards-main { min-width: 0; }

.id-cards-toolbar {
  display: flex;
  align-items: center;
  margin-bottom: 1.1rem;
  gap: 0.75rem;
}

.id-cards-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.size-toggle {
  display: flex;
  gap: 0;
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
}

.size-btn {
  width: 30px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
}
.size-btn:hover { color: var(--text); }
.size-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
}

/* ── Card grid ───────────────────────────────────────────── */
.id-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.id-cards-grid.size-sm { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.85rem; }
.id-cards-grid.size-lg { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }

/* ── Individual ID card ──────────────────────────────────── */
.id-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  cursor: default;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.04),
    0 3px 10px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.id-card:hover {
  box-shadow:
    0 2px 6px rgba(0,0,0,0.07),
    0 10px 28px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.id-card.selected {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(44,95,45,0.12),
    0 4px 16px rgba(44,95,45,0.1);
}

/* Checkbox */
.id-card-sel {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  z-index: 10;
  cursor: pointer;
}
.id-card-sel input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.card-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.4);
  background: rgba(0,0,0,0.28);
  transition: background 0.12s, border-color 0.12s;
}
.card-check-box svg { opacity: 0; transition: opacity 0.1s; }
.id-card-sel input:checked + .card-check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.id-card-sel input:checked + .card-check-box svg { opacity: 1; }

/* Card header — fixed clipping with proper padding-right for checkbox */
.id-card-header {
  background: var(--primary);
  padding: 0.58rem 2rem 0.58rem 0.9rem; /* right pad = space for checkbox */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 36px;
}
.id-card-brand {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  flex-shrink: 1;
  overflow: hidden;
}
.id-card-company {
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.id-card-tag {
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 0.13rem 0.42rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card body */
.id-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.95rem 0.9rem;
}
.id-card-body-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  flex: 1;
}

/* Avatar with accent ring */
.id-card-avatar {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 4px rgba(44,95,45,0.3);
}

.id-card-details { min-width: 0; }

.id-card-name {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.id-card-role {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 0.17rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.id-card-dept-tag {
  display: inline-block;
  margin-top: 0.36rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  background: rgba(44,95,45,0.07);
  color: #2c5f2d;
  border: 1px solid rgba(44,95,45,0.22);
  border-radius: 3px;
  padding: 0.12rem 0.45rem;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* QR container */
.id-card-qr {
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
}
.id-card-qr canvas,
.id-card-qr img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 2px;
}

/* Card footer */
.id-card-footer {
  padding: 0.5rem 0.9rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.id-card-contacts {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}
.id-card-contact {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Download bar — icon-only */
.id-card-dl-bar {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.id-card-dl-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.12s, color 0.12s;
}
.id-card-dl-btn:hover { background: var(--bg); color: var(--accent); }
.id-card-dl-btn:active { background: var(--border); }
.id-card-dl-btn:disabled { opacity: 0.35; cursor: default; }
.id-card-dl-sep {
  width: 1px;
  background: var(--border);
  margin: 0.35rem 0;
  flex-shrink: 0;
}

/* Capture state */
.card-capturing .id-card-sel,
.card-capturing .id-card-dl-bar { display: none !important; }

/* Size overrides — sm */
.id-cards-grid.size-sm .id-card-header { padding: 0.5rem 1.9rem 0.5rem 0.8rem; min-height: 32px; }
.id-cards-grid.size-sm .id-card-body { padding: 0.75rem 0.8rem; gap: 0.5rem; }
.id-cards-grid.size-sm .id-card-body-left { gap: 0.6rem; }
.id-cards-grid.size-sm .id-card-avatar { width: 36px; height: 36px; font-size: 0.78rem; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px rgba(44,95,45,0.3); }
.id-cards-grid.size-sm .id-card-qr { width: 48px; height: 48px; }
.id-cards-grid.size-sm .id-card-name { font-size: 0.82rem; }
.id-cards-grid.size-sm .id-card-role { font-size: 0.68rem; }
.id-cards-grid.size-sm .id-card-footer { padding: 0.45rem 0.8rem; }

/* Size overrides — lg */
.id-cards-grid.size-lg .id-card-header { padding: 0.65rem 2.2rem 0.65rem 1rem; min-height: 40px; }
.id-cards-grid.size-lg .id-card-body { padding: 1.15rem 1rem; gap: 0.8rem; }
.id-cards-grid.size-lg .id-card-body-left { gap: 1rem; }
.id-cards-grid.size-lg .id-card-avatar { width: 58px; height: 58px; font-size: 1.15rem; }
.id-cards-grid.size-lg .id-card-qr { width: 76px; height: 76px; }
.id-cards-grid.size-lg .id-card-name { font-size: 1.05rem; }
.id-cards-grid.size-lg .id-card-role { font-size: 0.82rem; }
.id-cards-grid.size-lg .id-card-footer { padding: 0.65rem 1rem; }

/* Toast */
.dl-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: #fff;
  padding: 0.62rem 1.1rem;
  border-radius: 10px;
  font-size: 0.81rem;
  font-family: var(--font);
  font-weight: 500;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  max-width: 320px;
  transition: opacity 0.25s, transform 0.25s;
}
.dl-toast.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.dl-toast-success { background: var(--accent); }
.dl-toast-error   { background: var(--danger); }

/* === Job Setup === */
.job-setup-form { display: flex; flex-direction: column; gap: 0; }

.setup-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.setup-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.setup-section-icon {
  width: 36px; height: 36px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.setup-section-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 0.15rem;
}

.setup-section-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.setup-grid {
  display: grid;
  gap: 1rem;
}
.setup-grid-4 { grid-template-columns: repeat(4, 1fr); }

.setup-actions {
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

/* Day toggles */
.day-toggles {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.day-toggle input { display: none; }

.day-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
  transition: all 0.15s;
  user-select: none;
  min-width: 72px;
}

.day-chip-short {
  font-size: 0.82rem;
  font-weight: 600;
}

.day-chip-full {
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.day-toggle input:checked + .day-chip {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.day-toggle input:checked + .day-chip .day-chip-full { color: rgba(255,255,255,.7); }
.day-chip:hover { border-color: var(--primary); }

/* Overtime row */
.overtime-row {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.overtime-row .form-group { margin-bottom: 0; min-width: 160px; }

/* Toggle switch */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}
.toggle-label input { display: none; }

.toggle-switch {
  width: 38px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-label input:checked + .toggle-switch { background: var(--accent); }
.toggle-label input:checked + .toggle-switch::after { transform: translateX(18px); }

/* Holiday add form */
.holiday-add-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.holiday-add-form .form-group { margin-bottom: 0; }

/* Holiday past row */
.holiday-past td { color: var(--text-secondary); }

/* Holiday type select */
.holiday-type-select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  min-width: 110px;
}

.holiday-hours-input {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  width: 80px;
}

/* Holiday type badges */
.holiday-type-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.holiday-full {
  background: rgba(var(--success-rgb, 34,197,94), 0.12);
  color: var(--success, #16a34a);
}
.holiday-half {
  background: rgba(var(--warning-rgb, 245,158,11), 0.12);
  color: var(--warning, #d97706);
}

.holiday-shift-label {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.day-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* === Payroll Setup === */
.payroll-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.input-computed {
  background: var(--bg) !important;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: not-allowed;
}

/* Penalty preview */
.penalty-preview {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.penalty-preview-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.penalty-table {
  width: auto;
  min-width: 320px;
  font-size: 0.82rem;
}
.penalty-table th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}
.penalty-table td,
.penalty-table th {
  padding: 0.35rem 1rem 0.35rem 0;
}

/* Reset modal (extends base .modal-overlay) */
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}

.modal-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.modal-defaults-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  font-size: 0.82rem;
}
.modal-defaults-list li {
  padding: 0.25rem 0;
  color: var(--text-secondary);
}
.modal-defaults-list li strong {
  color: var(--text);
}

.modal-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* === Employee Payroll === */
.payroll-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.payroll-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.payroll-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg);
  border-right: 1px solid var(--border);
  transition: all 0.15s;
}
.payroll-toggle-btn:last-child { border-right: none; }
.payroll-toggle-btn:hover { background: var(--surface); color: var(--text); }
.payroll-toggle-btn.active {
  background: var(--primary);
  color: #fff;
}

.payroll-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.payroll-emp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.payroll-month-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Entry rows inside table cells */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.entry-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
}

.entry-time {
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.entry-in { background: rgba(34,197,94,0.1); color: #16a34a; }
.entry-out { background: rgba(239,68,68,0.1); color: #dc2626; }

.entry-arrow {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.entry-dur {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: 0.2rem;
}

/* Inline icon buttons for edit/delete */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  padding: 0;
}
.btn-icon:hover { background: var(--bg); }
.btn-icon-edit:hover { color: var(--primary); }
.btn-icon-delete:hover { color: #dc2626; }

/* Payroll card grid */
.payroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.payroll-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.payroll-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.payroll-card-date {
  font-weight: 700;
  font-size: 0.88rem;
}

.payroll-card-day {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.4rem;
}

.payroll-card-total {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(var(--primary-rgb, 37,99,235), 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.payroll-card-entries {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.payroll-card-entries .entry-row {
  padding: 0.25rem 0;
}

.entry-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-left: auto;
}

.payroll-card-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  padding: 0.4rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.payroll-card-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(var(--primary-rgb, 37,99,235), 0.04);
}

/* Payroll summary bar */
.payroll-summary-bar {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.85rem;
  overflow: hidden;
  flex-wrap: wrap;
}

.payroll-summary-item {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 1.1rem;
  border-right: 1px solid var(--border);
  min-width: 110px;
}
.payroll-summary-item:last-child { border-right: none; }

.payroll-summary-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.payroll-summary-value {
  font-size: 1rem;
  font-weight: 700;
}

.payroll-val-green { color: #16a34a; }
.payroll-val-blue  { color: var(--primary); }
.payroll-val-red   { color: #dc2626; }

.payroll-summary-net {
  background: var(--bg);
  margin-left: auto;
}
.payroll-summary-net .payroll-summary-value { font-size: 1.15rem; }

/* Salary header + breakdown */
.payroll-salary-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

.payroll-salary-top {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.6rem;
}
.payroll-salary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.payroll-salary-amount {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.payroll-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 1px solid var(--border);
}

.payroll-breakdown-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}
.payroll-breakdown-item:last-child { border-right: none; }

.pb-sign {
  font-weight: 700;
  font-size: 0.9rem;
  width: 0.9rem;
  text-align: center;
  flex-shrink: 0;
}
.pb-label {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}
.pb-value {
  font-weight: 700;
  font-size: 0.85rem;
}

.pb-pos .pb-sign { color: #16a34a; }
.pb-pos .pb-value { color: #16a34a; }
.pb-neg .pb-sign { color: #dc2626; }
.pb-neg .pb-value { color: #dc2626; }

.pb-net {
  margin-left: auto;
  background: var(--bg);
  border-right: none;
  padding: 0.55rem 1.25rem;
}
.pb-net .pb-sign {
  color: var(--text);
  font-size: 1rem;
}
.pb-net .pb-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
}
.pb-net .pb-label {
  color: var(--text);
  font-weight: 600;
}

/* Info chips */
.payroll-chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.payroll-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.payroll-chip strong { color: var(--text); }
.payroll-chip-warn {
  background: rgba(var(--warning-rgb, 245,158,11), 0.1);
  border-color: rgba(var(--warning-rgb, 245,158,11), 0.3);
  color: #b45309;
}

/* Filter chips bar */
.payroll-filter-bar {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}
.payroll-filter-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}
.payroll-filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.payroll-filter-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.payroll-filter-num {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.payroll-filter-num input {
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  text-align: center;
}
.payroll-filter-num-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.payroll-card.filter-hidden {
  display: none;
}

/* Status badges */
.payroll-status {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.status-present  { background: rgba(34,197,94,0.12); color: #16a34a; }
.status-absent   { background: rgba(239,68,68,0.12); color: #dc2626; }
.status-halfday  { background: rgba(245,158,11,0.12); color: #d97706; }
.status-partial  { background: rgba(245,158,11,0.12); color: #d97706; }
.status-off      { background: var(--bg); color: var(--text-secondary); }
.status-notjoined { background: var(--bg); color: var(--text-secondary); font-style: italic; }
.status-makeup   { background: rgba(37,99,235,0.1); color: var(--primary); }
.status-future   { background: transparent; }
.payroll-short-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(239,68,68,0.10);
  color: #dc2626;
  margin-left: 0.25rem;
  white-space: nowrap;
  line-height: 1.4;
}

/* Card dim for not-joined / future */
.payroll-card-dim { opacity: 0.45; }

/* Card header right side */
.payroll-card-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Card footer */
.payroll-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.payroll-card-pay {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.payroll-card-hours {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.payroll-card-amount {
  font-size: 0.85rem;
  font-weight: 700;
}
.amount-positive { color: #16a34a; }
.amount-negative { color: #dc2626; }

.payroll-card-ot {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(var(--primary-rgb, 37,99,235), 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.payroll-card-ot-consumed {
  font-size: 0.7rem;
  font-weight: 600;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.payroll-card-adj {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.payroll-card-actions {
  display: flex;
  gap: 0.15rem;
}

/* Day detail modal table */
.dd-table {
  width: 100%;
  font-size: 0.84rem;
  border-collapse: collapse;
}
.dd-table td {
  padding: 0.3rem 0;
  vertical-align: top;
}
.dd-table td:first-child {
  color: var(--text-secondary);
  padding-right: 1.5rem;
  white-space: nowrap;
}
.dd-table td:last-child { font-weight: 500; text-align: right; }
.dd-sep td {
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}

.dd-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 1rem;
  margin-bottom: 0.35rem;
}
.dd-section-title:first-child { margin-top: 0; }

/* Day detail — hours band */
.dd-band-wrap { margin: 0.75rem 0 0.25rem; }
.dd-band { display: flex; border-radius: 6px; overflow: hidden; height: 26px; }
.dd-band-seg { display: flex; align-items: center; justify-content: center; min-width: 0; }
.dd-band-lbl { font-size: 0.58rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dd-band-red { background: #fecaca; color: #991b1b; }
.dd-band-yellow { background: #fef08a; color: #854d0e; }
.dd-band-amber { background: #fde68a; color: #92400e; }
.dd-band-orange { background: #fed7aa; color: #9a3412; }
.dd-band-green { background: #bbf7d0; color: #166534; }
.dd-band-marker-row { position: relative; height: 20px; margin-top: 2px; }
.dd-band-marker { position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.dd-band-marker-line { width: 2px; height: 10px; background: #111; border-radius: 1px; }
.dd-band-marker-label { font-size: 0.65rem; font-weight: 700; color: #111; white-space: nowrap; margin-top: 1px; }

.dd-row-pos td:first-child { color: var(--text); }
.dd-val-pos { color: var(--success, #16a34a) !important; }
.dd-row-neg td:first-child { color: var(--text); }
.dd-val-neg { color: var(--danger, #dc2626) !important; }
.dd-val-dim { color: var(--text-secondary) !important; font-weight: 400 !important; }
.dd-row-dim td { color: var(--text-secondary); }

.dd-total td {
  padding-top: 0.6rem;
  border-top: 2px solid var(--text);
  font-size: 0.92rem;
}

.dd-running {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  text-align: right;
}

/* === Monthly Adj / EMI Tables === */
.payroll-section-compact {
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.payroll-section-compact .setup-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.monthly-adj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.monthly-adj-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.monthly-adj-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--bg);
  vertical-align: middle;
}
.monthly-adj-table tbody tr:hover {
  background: var(--bg);
}
.monthly-adj-total td {
  font-size: 0.85rem;
  padding-top: 0.5rem;
  border-top: 1.5px solid var(--border);
  border-bottom: none;
}

.badge-loan {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
  background: #e8e3dc;
  color: var(--text);
}
.badge-paid {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #d4edda;
  color: #155724;
}
.badge-adj {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-adj-addition {
  background: #d4edda;
  color: #155724;
}
.badge-adj-deduction {
  background: #f8d7da;
  color: #721c24;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
}

/* Day detail adjustment cards */
.dd-adj-card {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg, #f5f5f0);
  font-size: 0.82rem;
}
.dd-adj-card:last-child { border-bottom: none; }
.dd-adj-note {
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.dd-adj-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dd-adj-actions { margin-left: auto; white-space: nowrap; }

/* === Salary === */
.salary-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.salary-summary-cards .stat-sub {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.salary-emp-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}

.salary-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.salary-item-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.salary-item-row input[type="text"] { flex: 1; }
.salary-item-row input[type="number"] { width: 160px; }

.num-cell { text-align: right; font-variant-numeric: tabular-nums; }
.salary-allow { color: #2e7d32; }
.salary-deduct { color: #c0392b; }
.salary-net { color: var(--text); }

.emp-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Summary bar on edit page */
.salary-summary-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.salary-summary-item { text-align: center; }
.salary-summary-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}
.salary-summary-val {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.salary-summary-op {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  padding: 0 0.25rem;
}

.revision-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: color 0.15s;
}
.revision-link:hover { color: var(--text); }

/* Salary history timeline */
.salary-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
}
.history-card.history-active { border-left-color: var(--accent); }
.history-card.history-future { border-left-color: #1565c0; opacity: 0.85; }

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.history-date-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.history-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.history-date strong { color: var(--text); }

.salary-pct-change {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.pct-up   { background: rgba(34,197,94,0.12); color: #16a34a; }
.pct-down { background: rgba(239,68,68,0.12); color: #dc2626; }

.history-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.history-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.history-amount {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.history-line {
  font-size: 0.82rem;
  margin-bottom: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.history-subtotal {
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.3rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.history-net-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.history-net-amount {
  font-size: 1.3rem;
  font-weight: 700;
}

/* === Loans === */
.loan-type-pill {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.loan-type-salary_advance { background: #e3f2fd; color: #1565c0; }
.loan-type-personal       { background: #f3e5f5; color: #7b1fa2; }
.loan-type-emergency      { background: #fff3e0; color: #e65100; }
.loan-type-other          { background: var(--bg); color: var(--text-secondary); }

.loan-row-closed td { color: var(--text-secondary); }

/* Mini progress bar in table */
.loan-progress-mini {
  width: 60px;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.loan-progress-mini-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.loan-progress-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: 0.35rem;
  font-variant-numeric: tabular-nums;
}

/* Overview grid on detail page */
.loan-overview-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.loan-ov-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}
.loan-ov-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}
.loan-ov-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Progress section */
.loan-progress-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.loan-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}
.loan-progress-pct {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}
.loan-progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: var(--bg);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.6rem;
}
.loan-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.loan-progress-done { background: #2e7d32; }
.loan-progress-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
}

/* Notes box */
.loan-notes-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Payment form */
.loan-payment-form {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.loan-payment-form .form-group { margin-bottom: 0; }

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .content { margin-left: 0; padding: 1rem; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .id-cards-layout { grid-template-columns: 1fr; }
  .id-cards-filter { position: static; }
  .setup-grid-4 { grid-template-columns: 1fr 1fr; }
  .day-toggles { gap: 0.35rem; }
  .day-chip { min-width: 58px; padding: 0.5rem 0.65rem; }
  .holiday-add-form { flex-direction: column; align-items: stretch; }
  .salary-item-row { flex-direction: column; align-items: stretch; }
  .salary-item-row input[type="number"] { width: 100%; }
  .salary-summary-bar { gap: 0.5rem; padding: 0.75rem 1rem; }
  .loan-overview-grid { grid-template-columns: repeat(3, 1fr); }
  .loan-payment-form { flex-direction: column; align-items: stretch; }
}

/* === Password Gate === */
.password-gate-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}

.password-gate-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.password-gate-icon {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.password-gate-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.password-gate-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.password-gate-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

.password-gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.password-gate-form input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font);
  text-align: center;
  transition: border-color 0.2s;
}

.password-gate-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
}

.password-gate-form .btn {
  align-self: center;
  padding: 0.65rem 2.5rem;
}

.password-gate-back {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.password-gate-back:hover {
  color: var(--text);
}

/* === Dashboard Overhaul === */

/* Topbar */
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.dash-topbar-left { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.dash-topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.dash-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px; }
.dash-date {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.dash-clock {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.dash-refresh-indicator {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  cursor: default;
}
.dash-refresh-indicator svg { opacity: 0.5; }

.dash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s;
}
.dash-btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem;
  width: 36px;
  height: 36px;
}
.dash-btn-ghost:hover { background: var(--border); }

/* Hero Metrics */
.dash-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dash-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dash-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.dash-hero-rate::before { background: var(--accent); }
.dash-hero-in::before { background: #2e7d32; }
.dash-hero-out::before { background: #1565c0; }
.dash-hero-absent::before { background: #c0392b; }

.dash-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-hero-rate .dash-hero-icon { background: rgba(44,95,45,0.08); color: var(--accent); }
.dash-hero-in .dash-hero-icon { background: rgba(46,125,50,0.08); color: #2e7d32; }
.dash-hero-out .dash-hero-icon { background: rgba(21,101,192,0.08); color: #1565c0; }
.dash-hero-absent .dash-hero-icon { background: rgba(192,57,43,0.08); color: #c0392b; }

.pulse-green { animation: pulseGlow 2s ease-in-out infinite; }
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0.15); }
  50% { box-shadow: 0 0 0 8px rgba(46,125,50,0); }
}

.dash-hero-body { flex: 1; min-width: 0; }
.dash-hero-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.dash-hero-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
  font-weight: 500;
}
.dash-hero-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  opacity: 0.7;
}

.dash-hero-ring {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  align-self: center;
}
.dash-hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-ring-fill { transition: stroke-dasharray 0.8s ease; }

/* Flash animation for value updates */
@keyframes dashFlash {
  0% { color: var(--accent); }
  100% { color: inherit; }
}
.dash-flash { animation: dashFlash 0.6s ease; }

/* Cards */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.dash-card-header h3 {
  font-size: 0.9rem;
  font-weight: 600;
}
.dash-card-badge {
  font-size: 0.68rem;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.dash-badge-live {
  color: #2e7d32;
  background: rgba(46,125,50,0.08);
  border-color: rgba(46,125,50,0.2);
  animation: pulseLive 2s ease-in-out infinite;
}
@keyframes pulseLive {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Bar Chart */
.dash-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  height: 160px;
  padding-top: 1rem;
}
.dash-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.3rem;
}
.dash-bar {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(to top, var(--accent), rgba(44,95,45,0.6));
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
}
.dash-bar-val {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.dash-bar-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Department Breakdown */
.dash-dept-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 180px;
  overflow-y: auto;
}
.dash-dept-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.dash-dept-info {
  width: 110px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.dash-dept-name {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-dept-count {
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.dash-dept-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.dash-dept-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}
.dash-dept-rate {
  font-size: 0.72rem;
  font-weight: 600;
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* Activity Feed */
.dash-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 250px;
  overflow-y: auto;
}
.dash-feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.dash-feed-item:last-child { border-bottom: none; }

.dash-feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-in { background: #2e7d32; box-shadow: 0 0 0 3px rgba(46,125,50,0.15); }
.dot-out { background: #e65100; box-shadow: 0 0 0 3px rgba(230,81,0,0.12); }

.dash-feed-body { flex: 1; min-width: 0; }
.dash-feed-name {
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.35rem;
}
.dash-feed-action {
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.dash-feed-meta {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.dash-feed-time {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.dash-feed-dept {
  font-size: 0.62rem;
  color: var(--text-secondary);
}

/* Absent List */
.dash-absent-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 250px;
  overflow-y: auto;
}
.dash-absent-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}
.dash-absent-row:last-child { border-bottom: none; }
.dash-absent-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.dash-absent-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-absent-name { font-size: 0.8rem; font-weight: 500; }
.dash-absent-dept { font-size: 0.65rem; color: var(--text-secondary); }
.dash-absent-id {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-family: monospace;
  flex-shrink: 0;
}

/* Quick Row */
.dash-quick-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow);
  align-items: center;
}
.dash-quick-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.dash-quick-num {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dash-quick-label {
  font-size: 0.68rem;
  color: var(--text-secondary);
}
.dash-quick-action {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.dash-quick-action:hover {
  background: var(--accent);
  color: #fff;
}

/* Empty states */
.dash-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
  padding: 2rem 0;
}
.dash-empty-good {
  color: var(--accent);
}

/* Fullscreen mode */
.dash-fullscreen .sidebar { display: none; }
.dash-fullscreen .content {
  margin-left: 0 !important;
  padding: 1.5rem 2rem;
  max-width: 100%;
}

/* Responsive */
@media (max-width: 1200px) {
  .dash-hero { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dash-hero { grid-template-columns: 1fr; }
  .dash-grid-2 { grid-template-columns: 1fr; }
  .dash-hero-ring { display: none; }
  .dash-quick-row { flex-direction: column; }
}

