@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --ink: #20211c;
  --board: #ecede5;
  --card: #ffffff;
  --line: #d8d6cc;
  --muted: #5c594e;
  --amber: #d98e32;
  --steel: #3e6b8a;
  --indigo: #3a3560;
  --teal: #2e8b7f;
  --red: #b8481f;
  --free-bg: #e4e2d8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--board);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.display { font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.02em; }
.upper { text-transform: uppercase; }

header {
  background: var(--ink);
  color: var(--board);
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
header h1 { margin: 0; font-size: 26px; font-weight: 700; }
header .sub { font-size: 11px; color: #d8d7cc; margin-top: 2px; }

nav.tabs {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: #b8b8ac;
  padding: 9px 14px; font-size: 13px; cursor: pointer;
  border-radius: 8px 8px 0 0; white-space: nowrap;
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
}
nav.tabs button:hover { color: var(--board); }
nav.tabs button.active { background: var(--board); color: var(--ink); font-weight: 700; }

main { max-width: 900px; margin: 0 auto; padding: 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.empty {
  text-align: center; padding: 40px 16px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--line); border-radius: 12px; font-size: 14px;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px; }
thead tr { background: #f4f3ed; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; font-size: 12px; }
th.sticky, td.sticky { position: sticky; left: 0; background: inherit; text-align: left; box-shadow: 2px 0 4px rgba(0,0,0,0.06); }
tbody tr { border-top: 1px solid #eae9e1; }
tbody tr:nth-child(even) { background: #faf9f5; }
tbody tr:nth-child(even) td.sticky { background: #faf9f5; }
tbody tr:hover { background: #f2f1ea; }
tbody tr:hover td.sticky { background: #f2f1ea; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fbfbf7; font-size: 12px; font-weight: 600; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.emp-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.shift-btn {
  width: 42px; height: 32px; border-radius: 6px; border: none;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
}
.shift-btn:disabled { cursor: not-allowed; }

button.primary {
  display: flex; align-items: center; gap: 6px;
  background: var(--indigo); color: white; border: none;
  padding: 9px 16px; border-radius: 7px; font-size: 13px; cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase;
  transition: filter 0.15s, transform 0.1s;
}
button.primary:hover { filter: brightness(1.1); }
button.primary:active { transform: scale(0.97); }
button.teal { background: var(--teal); }
button.ghost {
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  padding: 9px 12px; border-radius: 7px; cursor: pointer;
  transition: background 0.15s;
}
button.ghost:hover { background: #f2f1ea; }
button.icon-btn { background: none; border: none; color: var(--red); cursor: pointer; padding: 4px; transition: transform 0.1s; }
button.icon-btn:active { transform: scale(0.9); }

input[type=text], input[type=date], select {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 13px; font-family: inherit;
  background: var(--card);
}
input[type=text]:focus, input[type=date]:focus, select:focus { outline: 2px solid var(--indigo); outline-offset: 1px; }

.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }

.list-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 6px; }
.legend span.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; }

.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.week-nav .left { display: flex; align-items: center; gap: 8px; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.hint { font-size: 12px; color: var(--ink); font-weight: 500; margin-top: 8px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal-card {
  background: var(--card); border-radius: 16px 16px 0 0; padding: 20px;
  width: 100%; max-width: 480px; box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal-card { border-radius: 16px; }
}
#admin-btn.is-admin { background: #2e8b7f; color: white; border-color: #2e8b7f; }

.shift-btn-sm {
  min-width: 44px; height: 34px; border-radius: 6px; border: none;
  font-size: 11px; font-weight: 600; cursor: pointer; padding: 2px 4px;
  font-family: 'Inter', sans-serif; white-space: nowrap;
  transition: transform 0.1s, filter 0.15s;
}
.shift-btn-sm:hover:not(:disabled) { filter: brightness(0.96); }
.shift-btn-sm:active:not(:disabled) { transform: scale(0.94); }
.shift-btn-sm:disabled { cursor: not-allowed; opacity: 0.6; }

.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 13px; border-radius: 999px; font-size: 12px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 500;
  transition: transform 0.1s, filter 0.15s;
}
.chip:hover { filter: brightness(0.97); }
.chip:active { transform: scale(0.96); }
.chip.active { outline: 2px solid var(--ink); outline-offset: 1px; font-weight: 700; }
