:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #273449;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
  --warn: #f59e0b;
  --border: #334155;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}
.container { max-width: 720px; margin: 0 auto; padding: 16px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
nav a:hover { color: var(--text); }
.bell-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; position: relative; }
.bell-dot { position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; background: var(--error); border-radius: 50%; }
.notif-panel { position: fixed; right: 12px; top: 60px; width: 300px; max-width: 90vw; max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px; z-index: 20; }
.notif-item { padding: 10px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--surface-2); }
.notif-title { font-weight: 600; font-size: 0.9rem; }
.notif-body { font-size: 0.85rem; color: var(--muted); }
.notif-time { font-size: 0.75rem; color: var(--muted); }

h1 { font-size: 1.4rem; }
h2 { font-size: 1.1rem; margin-top: 24px; }
.muted { color: var(--muted); font-size: 0.9rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 16px 0; }
.auth-card { max-width: 380px; margin: 60px auto; }

label { display: block; margin-bottom: 14px; font-size: 0.9rem; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px; margin-top: 6px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 1rem;
}
textarea { min-height: 80px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.checkbox-row input { width: auto; }

.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; border: none; font-size: 0.95rem; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.flash-stack { margin-bottom: 12px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 0.9rem; }
.flash-success { background: rgba(34,197,94,0.15); color: var(--success); }
.flash-error { background: rgba(239,68,68,0.15); color: var(--error); }
.flash-info { background: rgba(59,130,246,0.15); color: var(--primary); }

.week-list { display: flex; flex-direction: column; gap: 10px; }
.week-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; text-decoration: none; color: var(--text); display: flex; justify-content: space-between; }
.week-card.current { border-color: var(--primary); }
.week-range { font-weight: 600; }

.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; margin-bottom: 12px; }
.status-draft, .status-none { background: var(--surface-2); color: var(--muted); }
.status-submitted { background: rgba(245,158,11,0.15); color: var(--warn); }
.status-approved { background: rgba(34,197,94,0.15); color: var(--success); }
.status-rejected { background: rgba(239,68,68,0.15); color: var(--error); }

.hours-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.hours-table th, .hours-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; font-size: 0.9rem; }
.hours-table input { padding: 6px; }

#sig-pad { width: 100%; max-width: 600px; height: 200px; background: white; border-radius: 8px; touch-action: none; }
.sig-actions { margin: 8px 0; }
.sig-image { max-width: 100%; background: white; border-radius: 6px; padding: 4px; }

.list { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.list-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); font-size: 0.9rem; }
.badge { background: var(--primary); color: white; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; }

@media (max-width: 480px) {
  .list-row { grid-template-columns: 1fr 1fr; }
}
