*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; direction: ltr;
  -webkit-font-smoothing: antialiased; user-select: none; vertical-align: middle;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f1f5f9; color: #1e293b; height: 100vh; overflow: hidden;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app { display: flex; height: 100vh; }

.sidebar {
  width: 220px; min-width: 220px; flex-shrink: 0; background: #1e1b4b;
  display: flex; flex-direction: column; padding: 0 0 16px; overflow: hidden;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px;
  color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 8px;
}
.sidebar-logo-text { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 20px;
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 14px; font-weight: 500; cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.nav-item.active { background: rgba(99,102,241,0.35); color: #fff; }

.main { flex: 1; overflow-y: auto; padding: 30px 36px; }
.main-content { width: 100%; max-width: 960px; margin: 0 auto; }

.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.page-title {
  flex: 1; font-size: 22px; font-weight: 700; color: #1e293b;
  display: flex; align-items: center; gap: 10px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; color: #1e293b; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: #f8fafc; }
.btn-icon { padding: 6px 8px; border-radius: 6px; font-size: 15px; }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }

/* ── Card ────────────────────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07); overflow: hidden;
}
.card-pad { padding: 18px 20px; }

/* ── Inputs ──────────────────────────────────────────────────────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
select, textarea {
  padding: 9px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s; background: #fff;
}
input:focus, select:focus, textarea:focus {
  border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
textarea { resize: vertical; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: #475569; }
.field input, .field select, .field textarea { width: 100%; }

/* ── Table ───────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.05em;
  background: #f8fafc; border-bottom: 1px solid #f1f5f9;
}
td { padding: 11px 14px; font-size: 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbff; }

/* ── Badges / misc ───────────────────────────────────────────────────────── */
.muted { color: #94a3b8; font-size: 13px; }
.loading { display: flex; align-items: center; justify-content: center; height: 200px; color: #94a3b8; font-size: 16px; }
.empty-state { text-align: center; padding: 56px 20px; color: #94a3b8; }
.empty-state .es-icon { font-size: 44px; margin-bottom: 12px; color: #cbd5e1; }

.color-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; right: 28px; padding: 12px 20px;
  border-radius: 10px; font-size: 14px; font-weight: 500; color: #fff;
  z-index: 200; box-shadow: 0 4px 20px rgba(0,0,0,0.2); animation: slideUp 0.2s ease;
}
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,15,30,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: #fff; border-radius: 14px; width: 460px; max-width: calc(100vw - 40px);
  max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.2s ease;
}
.modal-header { display: flex; align-items: center; padding: 20px 24px 16px; border-bottom: 1px solid #f1f5f9; }
.modal-title { font-size: 17px; font-weight: 700; flex: 1; }
.modal-close { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-close:hover { background: #f1f5f9; color: #475569; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f1f5f9; display: flex; justify-content: flex-end; gap: 10px; }

/* ── Day view ────────────────────────────────────────────────────────────── */
.date-nav {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 5px 8px;
}
.date-nav .date-label { font-size: 15px; font-weight: 600; min-width: 210px; text-align: center; }
.date-nav .date-label small { display: block; font-size: 12px; font-weight: 500; color: #94a3b8; }
.date-nav button { background: none; border: none; cursor: pointer; color: #475569; padding: 6px; border-radius: 7px; display: flex; }
.date-nav button:hover { background: #f1f5f9; color: #1e293b; }
.today-pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: #eef2ff; color: #4f46e5; border: none; cursor: pointer; }
.today-pill:hover { background: #e0e7ff; }

.entry-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.entry-head { display: flex; align-items: center; gap: 10px; }
.entry-name { font-size: 15px; font-weight: 700; flex: 1; }
.entry-hours { display: flex; align-items: center; gap: 8px; }
.entry-hours label { font-size: 12px; font-weight: 600; color: #64748b; }
.entry-hours input { width: 84px; text-align: right; }
.entry-card textarea { min-height: 68px; }
.save-flash { font-size: 12px; color: #10b981; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.save-flash.show { opacity: 1; }
.day-total { font-size: 13px; color: #64748b; font-weight: 600; }

/* ── Month export ────────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar select { min-width: 120px; }
.copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 720px) { .copy-grid { grid-template-columns: 1fr; } }
.copy-box { display: flex; flex-direction: column; gap: 8px; }
.copy-box-head { display: flex; align-items: center; gap: 8px; }
.copy-box-head .cb-title { font-size: 13px; font-weight: 700; flex: 1; }
.copy-box textarea {
  width: 100%; min-height: 260px; font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 13px; line-height: 1.55; white-space: pre; background: #fbfcfe; color: #334155;
}
.mono-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%); padding: 24px;
}
.auth-logo-mark { font-size: 50px; margin-bottom: 8px; color: rgba(255,255,255,0.92); }
.auth-brand { font-size: 28px; font-weight: 800; color: #fff; letter-spacing: -0.5px; margin-bottom: 28px; }
.auth-card { background: #fff; border-radius: 16px; padding: 32px 36px; width: 100%; max-width: 400px; box-shadow: 0 24px 64px rgba(0,0,0,0.35); }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; color: #1e293b; }
.auth-hint { font-size: 14px; color: #64748b; margin-bottom: 20px; line-height: 1.5; }
.auth-card .field { margin-bottom: 14px; }
.auth-error { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.auth-submit { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 8px; }

/* ── Settings ────────────────────────────────────────────────────────────── */
.settings-section { margin-bottom: 22px; }
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.settings-section .sub { font-size: 13px; color: #94a3b8; margin-bottom: 14px; }
.day-toggle { display: flex; gap: 6px; flex-wrap: wrap; }
.day-toggle button {
  width: 42px; height: 38px; border-radius: 9px; border: 1px solid #e2e8f0;
  background: #fff; color: #64748b; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.12s;
}
.day-toggle button.on { background: #6366f1; border-color: #6366f1; color: #fff; }
.switch-row { display: flex; align-items: center; gap: 12px; }
.toggle { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .track { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; transition: background 0.15s; cursor: pointer; }
.toggle .track::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle input:checked + .track { background: #6366f1; }
.toggle input:checked + .track::before { transform: translateX(18px); }
