:root {
  --bg: #020617;
  --bg-elevated: #020617;
  --bg-sidebar: #020617;
  --border-subtle: #111827;
  --border-soft: #1f2937;
  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-soft: #1d4ed8;
  --danger: #ef4444;
  --success: #22c55e;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
}

body {
  background: #000;
  color: var(--text-main);
  min-height: 100vh;
}

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

/* Sidebar */

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.sidebar-logo {
  height: 28px;
  width: auto;
}

.sidebar-title {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-main);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-main);
}

.nav-item.active .nav-dot {
  background: var(--accent);
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.1);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.user-info {
  font-size: 0.8rem;
}

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

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

/* Main */

.main {
  flex: 1;
  background: radial-gradient(circle at top, #020617 0, #000 55%);
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 18px 24px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-left h1 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.topbar-left p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.topbar-date {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.content {
  padding: 8px 24px 24px;
}

.cards-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card {
  background: var(--bg-elevated);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 14px 14px 12px;
}

.stat-card {
  flex: 1;
  min-width: 180px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.flex-2 {
  flex: 2;
}

.flex-1 {
  flex: 1;
}

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

.card-header h2 {
  font-size: 1rem;
}

.badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-live {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

/* Tables */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  padding: 6px 4px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
}

/* Pills */

.pill {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
}

.pill-in {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.pill-out {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* Forms */

.field {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
}

select,
input[type="search"],
input[type="date"],
input[type="email"] {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  padding: 6px 8px;
  background: #020617;
  color: var(--text-main);
  font-size: 0.85rem;
}

select:disabled,
input:disabled {
  opacity: 0.6;
}

.table-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.search-input {
  flex: 1;
}

.date-input {
  max-width: 160px;
}

/* Buttons */

.btn-primary,
.btn-outline,
.btn-block {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-soft);
}

.btn-block {
  width: 100%;
  margin-top: 8px;
}

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

.btn-outline:hover {
  background: rgba(148, 163, 184, 0.1);
}

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

/* Locations */

.location-list {
  list-style: none;
  font-size: 0.9rem;
}

.location-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}

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

.location-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Settings */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

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

.settings-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Views */

.view {
  display: none;
}

.view.active {
  display: block;
}

/* Center card (optional, matches tablet aesthetic) */

.center-card {
  margin-bottom: 18px;
}

/* Responsive */

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main {
    width: 100%;
  }

  .content {
    padding: 8px 12px 20px;
  }
}

/* ---- Employees view layout ---- */
.employee-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 16px;
}

.employee-column {
  flex: 1;
  min-width: 260px;
}

.employee-column-form {
  max-width: 340px;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.form-status {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-text {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-text:hover {
  background: rgba(96, 165, 250, 0.15);
}

.btn-text.btn-danger {
  color: #f97373;
}

.btn-text.btn-danger:hover {
  background: rgba(248, 113, 113, 0.15);
}
/* ================================
   EMPLOYEES PAGE LAYOUT
   ================================ */

.employees-layout {
  display: flex;
  gap: 32px;
  padding: 20px 0;
}

.employees-form-panel {
  flex: 1;
  max-width: 360px;
}

.employees-table-panel {
  flex: 2;
}

.section-title {
  margin-bottom: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.field label {
  font-weight: 500;
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field select {
  background: #0e1220;
  border: 1px solid #2c3244;
  padding: 10px;
  border-radius: 8px;
  color: #fff;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.btn-row {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.form-message {
  margin-top: 12px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.error-message {
  color: #ff6e6e;
}

/* Responsive layout */
@media (max-width: 900px) {
  .employees-layout {
    flex-direction: column;
  }
}

/* ===== Chronex Employees layout ===== */

.employees-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 12px;
}

.employees-form h3 {
  font-size: 1rem;
  margin-bottom: 10px;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.input-group label {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.input-group input[type="text"],
.input-group input[type="email"] {
  border-radius: 8px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.input-group input[type="text"]:focus,
.input-group input[type="email"]:focus {
  outline: none;
  border-color: #2563eb;
}

.input-check label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary,
.btn-secondary,
.btn-outline,
.btn-small,
.btn-danger {
  cursor: pointer;
}

.btn-small {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
}

.btn-small:hover {
  background: rgba(148, 163, 184, 0.15);
}

.btn-danger {
  border-color: #b91c1c;
  color: #fecaca;
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.employees-actions {
  display: flex;
  gap: 6px;
}

/* Status banner */

.alert {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  margin-top: 8px;
  margin-bottom: 4px;
}

.alert-hidden {
  display: none;
}

.alert-info {
  display: block;
  background: #0f172a;
  border: 1px solid #1d4ed8;
  color: #bfdbfe;
}

.alert-success {
  display: block;
  background: #022c22;
  border: 1px solid #15803d;
  color: #bbf7d0;
}

.alert-error {
  display: block;
  background: #450a0a;
  border: 1px solid #b91c1c;
  color: #fecaca;
}

/* ===================== */
/* Modal (Biometric enroll) */
/* ===================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

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

.modal {
  width: 100%;
  max-width: 520px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}

.modal-header, .modal-footer {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-footer {
  border-top: 1px solid var(--border-soft);
  border-bottom: none;
  justify-content: flex-end;
}

.modal-body {
  padding: 14px 16px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
}


@media (max-width: 900px) {
  .employees-layout {
    grid-template-columns: 1fr;
  }
}
