/* Drafter and owner screens: tabs, dialogs, daily input, sheet grid, cards. Tokens come from app.css. */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 16px; flex-wrap: wrap; }
.tab { font: inherit; min-height: var(--tap); padding: 0 14px; border: 0; background: transparent; color: var(--secondary); cursor: pointer; border-bottom: 3px solid transparent; font-weight: 500; }
.tab.is-on { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.tab.myrep.is-on { border-bottom-color: var(--myrep); }
.tab.ln.is-on { border-bottom-color: var(--ln); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { font: inherit; min-height: var(--tap); padding: 0 14px; border: 1px solid var(--input); background: #fff; border-radius: var(--radius); cursor: pointer; color: var(--ink); }
.seg button.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg.myrep button.is-on { background: var(--myrep); border-color: var(--myrep); }
.seg.ln button.is-on { background: var(--ln); border-color: var(--ln); }
.req { color: var(--warn); font-size: 12px; font-weight: 600; margin-left: 6px; }
.hint { font-size: 13px; color: var(--secondary); margin: 0; }

dialog.modal { border: 1px solid var(--rule); border-radius: 10px; padding: 0; max-width: min(600px, calc(100vw - 24px)); width: 100%; max-height: calc(100vh - 24px); color: var(--ink); }
dialog.modal::backdrop { background: rgba(23, 33, 46, .45); }
.modal-in { padding: 18px; display: grid; gap: 14px; overflow: auto; max-height: calc(100vh - 26px); }
.modal-in h2 { margin: 0; }
.modal-foot { position: sticky; bottom: 0; background: #fff; padding-top: 4px; }
@media (max-width: 600px) { dialog.modal { margin: auto auto 0; max-width: 100vw; border-radius: 14px 14px 0 0; } }

/* daily input */
.daily { display: grid; gap: 16px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 860px) { .daily { grid-template-columns: 1fr; } }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kpi { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 14px; min-width: 130px; }
.kpi .big { display: block; }
.kpi .lbl { font-size: 12px; color: var(--secondary); }
.picklist { display: grid; gap: 4px; margin-top: 6px; }
.pick { text-align: left; font: inherit; min-height: var(--tap); padding: 6px 10px; border: 1px solid var(--rule-soft); border-radius: var(--radius); background: #fff; cursor: pointer; color: var(--ink); }
.pick:hover { background: var(--ground); }
.pick small { display: block; color: var(--secondary); }
.selected-area { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--radius); background: var(--ground); }
.qc { border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 8px 10px; }
.qc .check { min-height: 32px; }
.status-chip { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; background: var(--ground); white-space: nowrap; }
.st-done, .st-rev-done { background: var(--ok-bg); color: var(--ok); }
.st-progress { background: var(--myrep-tint); color: var(--myrep-ink); }
.st-Revisi, .st-Reroute, .st-not_valid, .st-hold { background: var(--warn-bg); color: var(--warn); }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--secondary); }
dl.kv dd { margin: 0; word-break: break-word; }
.stepline { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0; }
.stepline span { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--ground); }
.log-list { display: grid; gap: 8px; }
.log-item { border: 1px solid var(--rule-soft); border-radius: var(--radius); padding: 8px 10px; display: grid; gap: 4px; background: #fff; }
.log-item .top { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }

/* sheet */
.sheet-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.sheet-bar .grow { flex: 1; min-width: 160px; }
.sheet-bar input, .sheet-bar select { width: auto; min-width: 140px; }
.grid-wrap { overflow: auto; max-height: calc(100vh - 270px); border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
table.xl { border-collapse: separate; border-spacing: 0; font-size: 13.5px; min-width: 100%; }
.xl th { position: sticky; top: 0; z-index: 2; background: #F7F9FA; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule-soft); white-space: nowrap; font-weight: 600; color: var(--secondary); }
.xl td { padding: 0; border-bottom: 1px solid var(--rule-soft); border-right: 1px solid var(--rule-soft); height: 40px; min-width: 70px; max-width: 320px; }
.xl td.c { padding: 8px 10px; cursor: cell; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xl td.c.ro { cursor: default; background: #FAFBFC; color: var(--secondary); }
.xl td.c.n { text-align: right; font-variant-numeric: tabular-nums; }
.xl td.c:hover:not(.ro) { background: #F3F7FC; }
.xl td.sticky, .xl th.sticky { position: sticky; left: 0; z-index: 1; background: #fff; }
.xl th.sticky { z-index: 3; background: #F7F9FA; }
.xl td.rn { text-align: center; color: var(--secondary); min-width: 44px; background: #FAFBFC; }
.xl tr.hl td { background: #FFF8DB; }
.xl td input, .xl td select { border: 2px solid var(--myrep); border-radius: 0; height: 40px; min-height: 40px; padding: 0 8px; }
.xl td.saving { opacity: .6; }
.xl td.err { outline: 2px solid #C0392B; }
.menu-btn { min-width: 36px; min-height: 36px; padding: 0 6px; }
/* batch tabs sit under the rows like Excel's sheet tabs and stay visible at the bottom of the screen while scrolling */
.batchbar { display: flex; gap: 2px; overflow-x: auto; align-items: stretch; margin-top: 10px; padding-bottom: 4px; border-top: 1px solid var(--rule);
  position: sticky; bottom: 0; z-index: 5; background: var(--ground); box-shadow: 0 -4px 10px rgba(23,33,46,.06); }
.batchbar .btab { font: inherit; white-space: nowrap; min-height: var(--tap); padding: 0 14px; border: 0; background: transparent; cursor: pointer; color: var(--secondary); border-top: 3px solid transparent; }
.batchbar .btab.is-on { color: var(--ink); font-weight: 700; background: #fff; border-top-color: var(--myrep); }
.batchbar.ln .btab.is-on { border-top-color: var(--ln); }
.cards { display: none; gap: 8px; }
.card-row { text-align: left; font: inherit; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; padding: 10px 12px; min-height: var(--tap); cursor: pointer; display: grid; gap: 4px; color: var(--ink); }
.card-row .t1 { font-weight: 600; }
.card-row .t2 { font-size: 13px; color: var(--secondary); }
@media (max-width: 720px) { .grid-wrap { display: none; } .cards { display: grid; } .sheet-bar input, .sheet-bar select { width: 100%; } }
.menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(23,33,46,.18); min-width: 170px; padding: 4px; display: grid; }
.menu button { font: inherit; text-align: left; min-height: var(--tap); padding: 0 12px; border: 0; background: transparent; cursor: pointer; border-radius: 4px; color: var(--ink); }
.menu button:hover { background: var(--ground); }
.menu button.danger { color: var(--warn); }
.timeline { display: grid; gap: 8px; max-height: 60vh; overflow: auto; }
.timeline .ev { border-left: 3px solid var(--rule); padding: 2px 0 2px 10px; }
.timeline .ev .meta { font-size: 12px; color: var(--secondary); }
.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pulse { animation: pulse 1.6s ease-out 1; }
@keyframes pulse { from { background: #FFF1A8; } to { background: transparent; } }
.banner { background: var(--myrep-tint); color: var(--myrep-ink); padding: 10px 12px; border-radius: var(--radius); margin-bottom: 10px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.pager { margin-top: 12px; }
#imp-result h3 { margin-top: 20px; }
