:root {
  --primary: #2563eb;
  --accent: #0f766e;
  --danger: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-800: #1f2937;
  --gray-950: #030712;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--gray-50); color: var(--gray-950); }
a { color: var(--primary); text-decoration: none; }
button, .button, input, select, textarea { min-height: 44px; font: inherit; }
button, .button { border: 1px solid var(--gray-200); background: white; color: var(--gray-800); border-radius: 6px; padding: 10px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.primary, button.primary { background: var(--primary); border-color: var(--primary); color: white; }
.ghost { background: transparent; }
.topbar { height: 64px; display: flex; align-items: center; gap: 20px; padding: 0 24px; background: white; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; color: var(--gray-950); }
.topbar nav { display: flex; gap: 14px; flex: 1; overflow: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a { color: var(--gray-800); }
.logout button { min-height: 36px; padding: 6px 10px; }
.shell { max-width: 1500px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
h1 { font-size: 28px; margin: 0; }
h2 { font-size: 20px; margin: 24px 0 12px; }
.muted { color: var(--gray-500); margin: 6px 0 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.metrics div, .form-panel, .result-panel { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 18px; }
.metrics strong { display: block; font-size: 32px; }
.metrics span { color: var(--gray-500); }
.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.message { padding: 12px 14px; border-radius: 6px; background: white; border: 1px solid var(--gray-200); }
.message.success { border-color: #86efac; background: #f0fdf4; }
.message.error { border-color: #fecaca; background: #fef2f2; }
.message.warning { border-color: #fde68a; background: #fffbeb; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
input, select, textarea { border: 1px solid var(--gray-200); border-radius: 6px; padding: 10px 12px; background: white; }
.form-panel { max-width: 720px; }
.form-panel p { display: grid; gap: 6px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.data-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--gray-200); }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-200); text-align: left; }
.data-table th { background: var(--gray-100); font-weight: 700; }
.compact th, .compact td { padding: 7px 9px; }
.table-scroll { overflow: auto; border: 1px solid var(--gray-200); background: white; max-height: 70vh; scrollbar-width: thin; }
.timesheet-table { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 1800px; }
.timesheet-table th, .timesheet-table td { border-right: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); padding: 6px; text-align: center; white-space: nowrap; }
.timesheet-table th { background: var(--gray-100); position: sticky; top: 0; z-index: 3; }
.timesheet-table .sticky { position: sticky; left: 0; z-index: 2; background: white; }
.timesheet-table th.sticky { z-index: 4; background: var(--gray-100); }
.timesheet-table .num { width: 44px; min-width: 44px; }
.timesheet-table .name { left: 44px; min-width: 220px; text-align: left; }
.timesheet-table .day { min-width: 42px; }
.timesheet-table .cell input { width: 42px; min-height: 32px; padding: 4px; text-align: center; border: 1px solid transparent; background: rgba(255,255,255,.6); }
.timesheet-table .cell input:focus { border-color: var(--primary); outline: none; background: white; }
.savebar { margin-top: 14px; }
.code-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.code-legend span { border: 1px solid var(--gray-200); border-radius: 999px; padding: 7px 10px; }
.status-form { display: flex; gap: 10px; margin-bottom: 12px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.report-grid > div { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 14px; }
.row-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.short-scroll { max-height: 420px; }
.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.profile-photo, .result-panel { background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 16px; }
.profile-photo img, .photo-placeholder { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--gray-100); display: grid; place-items: center; color: var(--gray-500); font-weight: 700; }
.profile-photo dl { display: grid; grid-template-columns: 1fr; gap: 4px; }
.profile-photo dt { color: var(--gray-500); font-size: 13px; }
.profile-photo dd { margin: 0 0 8px; font-weight: 700; }
.wide-form { max-width: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 16px; }
.section-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 18px; margin-top: 22px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.info-grid span { display: block; color: var(--gray-500); font-size: 13px; }
.info-grid strong { display: block; margin-top: 4px; }
.login-page { min-height: 100vh; display: grid; place-items: center; }
.login-panel { width: min(420px, calc(100vw - 32px)); background: white; border: 1px solid var(--gray-200); border-radius: 8px; padding: 24px; }
@media (max-width: 800px) {
  .topbar { align-items: flex-start; height: auto; padding: 14px; flex-wrap: wrap; }
  .shell { padding: 16px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .profile-layout { grid-template-columns: 1fr; }
  .section-split { grid-template-columns: 1fr; }
}
