:root {
  --text: #2c3340;
  --muted: #8b93a1;
  --line: #e8eaef;
  --bg: #f6f7fb;
  --white: #fff;
  --indigo: #5b5bd6;
  --indigo-soft: #eef0ff;
  --orange: #f97316;
  --blue: #3b82f6;
  --red: #ef4444;
  --green: #16a34a;
  --emp: 228px;
  --total: 88px;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--white);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 12;
}
.brand { display: flex; align-items: center; gap: 14px; }
.logo { font-weight: 700; font-size: 1.2rem; letter-spacing: -0.04em; color: #3d3d3d; }
.shop {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}
.tabs { display: flex; gap: 0; height: 100%; align-items: stretch; }
.tab {
  border: 0;
  background: transparent;
  color: #6b7280;
  padding: 0 14px;
  border-radius: 0;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); background: #f8f9fc; }
.tab.is-active {
  color: var(--indigo);
  background: transparent;
  border-bottom-color: var(--indigo);
}

.subbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.date-nav { display: flex; align-items: center; gap: 8px; }
.date-label {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  min-width: 190px;
}
.week-pill {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.mode-tabs {
  display: flex;
  background: #f1f3f8;
  border-radius: 10px;
  padding: 3px;
}
.mode-tabs button {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 8px;
  color: #6b7280;
  font-weight: 600;
}
.mode-tabs .is-active { background: var(--white); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.sub-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sel-hint { font-size: 0.8rem; color: var(--indigo); font-weight: 600; min-width: 110px; text-align: right; }

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  display: grid; place-items: center;
  color: #4b5563;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: #f8fafc; }
.icon-btn.wa { color: #128c7e; }
.btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
}
.btn-primary { background: var(--indigo); color: white; border-color: var(--indigo); }
.btn-danger { background: #fef2f2; color: var(--red); border-color: #fecaca; }

#app-shell:not([hidden]) {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.topnav, .subbar, .alerts-bar { flex-shrink: 0; }
.board { flex: 1 1 auto; min-height: 0; height: auto; overflow: auto; background: var(--bg); }
.board:has(.day-board) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.day-chrome { background: var(--white); }
.day-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--white);
}
.day-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.day-track { min-width: 1320px; }
.day-row.day-head,
.day-row.day-head > * { min-height: 32px; }

.grid {
  display: grid;
  min-width: max-content;
  background: var(--white);
}
.cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 86px;
}
.head {
  position: sticky; top: 0; z-index: 4;
  background: #fafbfe;
  min-height: 52px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
}
.head.corner, .emp {
  position: sticky; left: 0; z-index: 5;
  width: var(--emp); min-width: var(--emp);
  background: var(--white);
}
.head.corner { z-index: 6; display: flex; align-items: center; }
.head.total, .total {
  position: sticky; right: 0; z-index: 5;
  width: var(--total); min-width: var(--total);
  background: #fafbfe;
  text-align: center;
}
.head.is-today { color: var(--indigo); background: #f4f5ff; }
.head.day-open { cursor: pointer; }
.head.day-open:hover { background: var(--indigo-soft); color: var(--indigo); }
.open-day-hint { display: block; font-size: 0.65rem; font-weight: 500; color: var(--indigo); opacity: 0; }
.head.day-open:hover .open-day-hint { opacity: 1; }
.day { cursor: pointer; }
.day-editor-banner {
  padding: 4px 12px 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.role-preview { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; margin-top: 4px; }
.optgroup-label { font-size: 0.72rem; color: var(--muted); }
.emp {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  z-index: 3;
}
.emp.selected { background: #f4f5ff; box-shadow: inset 3px 0 0 var(--indigo); }
.emp.unassigned { color: var(--muted); font-style: italic; }
.check {
  width: 16px; height: 16px; accent-color: var(--indigo); flex: none;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  color: white; font-size: 0.7rem; font-weight: 700; flex: none;
}
.emp-meta { min-width: 0; flex: 1; }
.emp-meta strong { display: block; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hours-badge { color: var(--orange); font-size: 0.72rem; font-weight: 700; }

.day {
  padding: 6px;
  min-width: 148px;
  background: var(--white);
}
.day.is-today { background: #fbfbff; }
.day.is-drop { outline: 2px solid var(--indigo); background: #eef2ff; position: relative; }
.day.is-drop::after {
  content: "Mover aquí";
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--indigo);
  text-align: center;
  pointer-events: none;
}
.day.is-drop-copy::after { content: "Copiar aquí"; }
body.is-grid-dragging .cell.day { outline: 1px dashed #cdd3e3; }
body.is-grid-dragging .add-cell { display: block; pointer-events: none; opacity: 0.45; }

.shift {
  display: block; width: 100%;
  border: 0; text-align: left;
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  cursor: grab;
  background: color-mix(in srgb, var(--c, #94a3b8) 32%, white);
  box-shadow: inset 3px 0 0 var(--c, #94a3b8);
  font-size: 0.72rem;
  line-height: 1.25;
}
.shift.off { background: #eceef2; box-shadow: none; color: #5b6472; min-height: 52px; cursor: grab; }
.shift.rest-auto, .leave-chip { cursor: grab; }
.leave-chip { background: color-mix(in srgb, var(--c, #94a3b8) 16%, #eceef2); box-shadow: inset 3px 0 0 var(--c, #94a3b8); min-height: 52px; }
.shift-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.shift-top em { font-style: normal; font-size: 0.68rem; font-weight: 700; opacity: 0.75; }
.shift span { display: block; color: #4b5563; }
.day.is-rest { background: #f6f7fa; }
.shift strong { display: block; font-size: 0.74rem; }
.shift:active { cursor: grabbing; }
.shift { touch-action: none; user-select: none; -webkit-user-drag: none; }
.shift.is-dragging { opacity: 0.35; }
.shift-float {
  position: fixed;
  z-index: 46;
  pointer-events: none;
  margin: 0;
  opacity: 0.95;
  box-shadow: 0 12px 28px rgba(17, 24, 39, .22);
  cursor: grabbing;
}
.shift-float.is-copy { outline: 2px solid var(--indigo); }
body.is-grid-dragging, body.is-grid-dragging .shift { cursor: grabbing; }
.add-cell {
  display: none; width: 100%;
  border: 1px dashed #d5d8e0; background: transparent;
  color: var(--muted); border-radius: 8px; padding: 8px;
}
.day:hover .add-cell { display: block; }

.total { display: grid; place-content: center; font-weight: 700; font-size: 0.85rem; }
.total small { display: block; font-weight: 600; font-size: 0.7rem; }
.delta-low { color: var(--blue); }
.delta-high { color: var(--red); }

.foot, .head.foot {
  position: sticky; bottom: 0; z-index: 4;
  background: #f3f5fa;
  min-height: 48px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #5b6472;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 2px;
}
.foot.corner { left: 0; z-index: 6; align-items: flex-start; padding-left: 14px; }
.foot.total { right: 0; font-size: 0.95rem; color: var(--text); }

.timeline-wrap { position: relative; min-width: 980px; }
.hour-slots {
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / var(--slots) - 1px),
    var(--line) calc(100% / var(--slots) - 1px),
    var(--line) calc(100% / var(--slots))
  );
}
.day-head {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 32px;
  background: #fafbfe;
  box-shadow: 0 1px 0 var(--line);
}
.day-head .head {
  top: auto;
  background: #fafbfe;
  min-height: 32px;
  padding: 4px 10px;
}
.day-head .cell,
.day-head .hours-head,
.day-row.day-head {
  min-height: 32px;
}
.hours-head {
  display: grid;
  grid-template-columns: repeat(var(--slots), 1fr);
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
}
.coverage-slots {
  display: grid;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(100% / var(--coverage-slots) - 1px),
    var(--line) calc(100% / var(--coverage-slots) - 1px),
    var(--line) calc(100% / var(--coverage-slots))
  );
}
.hours-head span {
  text-align: left; font-size: 0.7rem; color: var(--muted);
  font-weight: 600; padding: 6px 0 6px 3px;
  transform: translateX(-1px);
}
.day-row {
  display: grid;
  grid-template-columns: var(--emp) 1fr var(--total);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  min-height: 88px;
}
.day-row > .emp,
.day-row > .timeline,
.day-row > .total { min-height: 88px; }
.day-row.day-head,
.day-row.day-head > * { min-height: 32px; }
.day-row.selected .emp { background: #f4f5ff; box-shadow: inset 3px 0 0 var(--indigo); }
.timeline {
  position: relative;
  align-self: stretch;
  height: 100%;
  touch-action: none;
}
.timeline.is-drop { background: #eef2ff; }
.day-row.is-drop-row { background: #e8ebff; box-shadow: inset 0 0 0 2px var(--indigo); }
.day-row.is-drop-row .emp { background: #e8ebff; }
.block {
  position: absolute; top: 8px; bottom: 8px;
  height: auto;
  border: 0; border-radius: 8px;
  padding: 6px 10px; text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: color-mix(in srgb, var(--c, #94a3b8) 38%, white);
  box-shadow: inset 3px 0 0 var(--c, #94a3b8);
  font-size: 0.72rem; line-height: 1.2;
  cursor: grab;
  touch-action: none;
}
.block.off { background: #edeff3; left: 8px; right: 8px; width: auto !important; }
.hour-counts {
  display: grid;
  grid-template-columns: var(--emp) 1fr var(--total);
  position: sticky;
  bottom: 0;
  z-index: 12;
  background: #f3f5fa;
  border-top: 1px solid var(--line);
}
.hour-counts .corner { position: sticky; left: 0; background: #f3f5fa; z-index: 6; }
.hour-counts .nums {
  display: grid;
  grid-template-columns: repeat(var(--slots), 1fr);
}
.hour-counts .coverage-slots { grid-template-columns: repeat(var(--coverage-slots), 1fr); }
.hour-counts b {
  text-align: center; padding: 6px 0; font-size: 0.78rem;
  font-weight: 700;
}

.month .day { min-width: 86px; min-height: 64px; padding: 4px; }
.month .shift { padding: 4px 5px; font-size: 0.66rem; }

.page { padding: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.card h3 { margin: 0; font-size: 1rem; }
.muted { color: var(--muted); font-size: 0.85rem; }
.row-actions { display: flex; gap: 8px; margin-top: auto; }
.search {
  width: min(420px, 100%);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px;
}

table { width: 100%; border-collapse: collapse; background: var(--white); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.88rem; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; background: #fafbfe; }

.overlay { position: fixed; inset: 0; background: rgba(20,24,40,.45); z-index: 20; }
.modal {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12px; overflow-y: auto;
}
[hidden] { display: none !important; }
.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  background: white; border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
}
.modal-head, .modal-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; gap: 8px; flex-shrink: 0; }
.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); justify-content: flex-end; background: white; }
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 14px 16px; display: grid; gap: 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.78rem; font-weight: 600; }
.field input, .field select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.field input[type="color"] { height: 38px; padding: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wa-groups { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.wa-groups .btn.is-on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.wa-list { display: grid; gap: 8px; }
.wa-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.wa-jump { text-decoration: none; color: inherit; font-weight: 600; }
.wa-bulk { display: grid; gap: 8px; max-height: min(48vh, 420px); overflow: auto; }
.wa-bulk-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(160px, 1.2fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}
.wa-bulk-row input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.wa-bulk-row .ok { color: #15803d; font-size: 0.78rem; }
.wa-bulk-row .miss { color: #b45309; font-size: 0.78rem; }
.wa-queue-now { margin: 0 0 6px; font-size: 1.05rem; }
.wa-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.wa-steps span { font-size: 0.78rem; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); }
.wa-steps span.is-now { background: var(--indigo); color: #fff; border-color: var(--indigo); }
.wa-steps span.is-done { opacity: 0.4; }
.wa-preview {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.82rem;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  max-height: 240px;
  overflow: auto;
  margin: 0;
}

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; }
.toast { background: #1f2937; color: white; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }

.print-sheet { padding: 12px 8px; }
.print-card { break-inside: avoid; margin-bottom: 28px; }
.print-card h1 { margin: 0 0 4px; font-size: 1.3rem; }
.print-card .sub { color: #555; margin-bottom: 12px; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td { border: 1px solid #ddd; padding: 8px 10px; text-align: left; }
.print-table th { background: #f3f4f8; }

.hours-report { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
.hours-report table { min-width: 760px; }
.hours-report th, .hours-report td { text-align: center; vertical-align: top; }
.hours-report th:first-child, .hours-report td:first-child {
  text-align: left; position: sticky; left: 0; background: white; z-index: 1; min-width: 168px;
}
.hours-report thead th:first-child { background: #fafbfe; }
.hours-report .is-current { background: #f4f5fb; }
.hours-cell .delta { display: block; font-weight: 600; }
.hours-cell .planned { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.hours-cell .delta.over { color: #0f9d7a; }
.hours-cell .delta.under { color: var(--red); }
.hours-cell.empty { color: var(--muted); }
.week-jump {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 700;
  color: inherit; cursor: pointer; text-transform: none; letter-spacing: 0;
}

@media print {
  html, body { overflow: visible; height: auto; }
  body { background: white; }
  .topnav, .subbar, .board, .overlay, .modal, .toasts, .alerts-bar, #login { display: none !important; }
  #print-root { display: block !important; }
}

.topnav { display: flex; align-items: center; gap: 20px; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 600; }
body.readonly .admin-only { display: none !important; }
body.readonly .add-cell, body.readonly .handle { display: none !important; }
body.readonly .shift, body.readonly .block { cursor: default; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #eef0ff, #f7f8fb 50%, #fff);
}
.login-card {
  width: min(420px, 92vw);
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 50px rgba(30, 40, 80, .08);
}
.login-card h1 { margin: 8px 0 0; font-size: 1.25rem; }
.login-brand { margin-bottom: 4px; }
.login-hint { margin: 0; font-size: 0.78rem; }
#login-reset { justify-self: start; }
.pass-row { display: flex; gap: 8px; align-items: center; }
.pass-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; }
.pass-code { font-size: 0.9rem; }
.pass-reveal {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 8px 0;
}

.alerts-bar {
  display: grid;
  gap: 6px;
  padding: 10px 16px 12px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}
.alerts-bar .pill {
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
  border: 1px solid var(--line);
}
.alerts-bar .pill.rest { border-left: 3px solid #f59e0b; }
#btn-alerts.is-open { background: #111827; color: white; border-color: #111827; }
.role-legend {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  padding: 6px 12px 0;
  align-items: center;
}
.drag-hint { margin: 4px 4px 10px; font-size: 0.75rem; color: var(--muted); }
.drag-hint kbd {
  font-family: inherit; font-size: 0.7rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; background: white;
}

.emp.over { box-shadow: inset 3px 0 0 var(--red); }
.emp.under { box-shadow: inset 3px 0 0 var(--orange); }
.emp.ok-hours { box-shadow: inset 3px 0 0 var(--green); }
.alert-ico { font-size: 0.72rem; margin-left: 4px; }
.total.over { background: #fef2f2; color: var(--red); }
.total.under { background: #fff7ed; color: #c2410c; }

.block { user-select: none; -webkit-user-drag: none; }
.handle {
  position: absolute; top: 0; bottom: 0; width: 10px;
  background: transparent; cursor: ew-resize;
  z-index: 2;
}
.handle-w { left: 0; }
.handle-e { right: 0; }
.block.dragging { opacity: 0.35; z-index: 3; cursor: grabbing; }
.block-float {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  margin: 0;
  top: auto;
  bottom: auto;
  left: auto;
  right: auto;
  max-width: none;
  min-width: 0;
  min-height: 0;
  opacity: 0.96;
  box-shadow: 0 10px 22px rgba(20, 24, 40, .22);
}
.block-preview-tag {
  position: absolute;
  left: 0;
  top: -18px;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: normal;
  background: #111827;
  color: #fff;
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.block-float.is-copy .block-preview-tag { background: var(--indigo); }
#btn-undo:disabled { opacity: 0.45; cursor: default; }
.day-drag-hint {
  position: fixed;
  z-index: 41;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #111827;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(17, 24, 39, .28);
}
.day-drag-hint.is-copy { background: var(--indigo); }
body.is-day-dragging { cursor: grabbing; }
body.is-day-dragging .block { cursor: grabbing; }
.ghost {
  position: absolute; top: 10px; bottom: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--indigo) 25%, white);
  border: 1px dashed var(--indigo);
  pointer-events: none;
}

.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; }
.section-title { margin: 22px 0 12px; font-size: 1.05rem; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: flex; gap: 4px; align-items: center; font-size: 0.78rem; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.ai-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .ai-layout { grid-template-columns: 1fr; } }
.suggest { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: white; display: grid; gap: 8px; }
.suggest h3 { margin: 0; font-size: 0.95rem; }
.sug-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 0.85rem; }
.sug-item.over { border-left: 4px solid var(--red); }
.sug-item.under { border-left: 4px solid var(--blue); }
.sug-item.rest { border-left: 4px solid #f59e0b; }
.sug-item.cover { border-left: 4px solid var(--indigo); }
.draft-box { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.auth-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.btn-ai { background: #111827; color: white; border-color: #111827; }
.modal-card.wide { width: min(760px, 96vw); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.kpi span { display: block; color: var(--muted); font-size: 0.75rem; }
.kpi strong { font-size: 1.2rem; }

.leave-chip { font-size: 0.72rem; }
.block.leave { z-index: 2; }
.cell.day.on-leave { background: #faf8ff; }
.charts { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.chart-card.span { grid-column: 1 / -1; }
.chart-card h3 { margin: 0; font-size: 0.95rem; }
.chart-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; }
.chart-label { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; }
.chart-val { font-size: 0.78rem; color: var(--muted); text-align: right; }
.meter { position: relative; height: 12px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; }
.meter .goal { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #111827; }
.cover-chart { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.cover-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.cover-bar { width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; }
.cover-col small { font-size: 0.68rem; color: var(--muted); }
.cover-col b { font-size: 0.78rem; }

.team-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100%;
  background: var(--bg);
}
.team-side {
  background: white;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 112px);
}
.team-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.team-side-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.team-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.team-list { overflow: auto; }
.team-person {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}
.team-person span { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 500; }
.team-person:hover { background: #f8fafc; }
.team-person.is-active { background: var(--indigo-soft); }
.team-person.is-active strong { color: var(--indigo); }
.team-main { padding: 20px 24px 32px; }
.team-detail {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
}
.team-detail-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.team-detail-head .row-actions { margin-top: 0; }
.team-detail h2 { margin: 0 0 4px; font-size: 1.25rem; }
.team-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.team-fields span { display: block; color: var(--muted); font-size: 0.75rem; margin-bottom: 2px; }
.avatar.lg { width: 48px; height: 48px; font-size: 0.95rem; }
.team-empty {
  background: white;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 32px;
  text-align: center;
}
@media (max-width: 860px) {
  .team-layout { grid-template-columns: 1fr; }
  .team-side { min-height: 0; max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
}

.drop-ask-back {
  position: fixed;
  inset: 0;
  z-index: 48;
  background: rgba(17, 24, 39, 0.38);
}
.drop-ask {
  position: fixed;
  z-index: 49;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 280px;
  max-width: min(380px, calc(100vw - 24px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(17, 24, 39, .28);
  padding: 16px;
}
.drop-ask p { margin: 0 0 6px; font-size: 0.95rem; font-weight: 700; }
.drop-ask-note { margin: 0 0 12px !important; font-size: 0.8rem !important; font-weight: 500 !important; color: var(--muted); }
.drop-ask-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.drop-ask-actions .btn { flex: 1; min-width: 90px; display: inline-flex; align-items: center; justify-content: center; }
