/* Productivity app — uses the same design tokens as the Steinweg Hub (style.css). */
.page { min-height: 100vh; }
.content { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-head h2 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
.doc-id { font-size: 12px; color: var(--text-tertiary); font-weight: 500; }
.card-actions { display: flex; gap: 10px; align-items: center; }

.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; }

.btn-primary {
  background: var(--steinweg-teal); color: #fff; border: none; border-radius: var(--radius);
  padding: 9px 16px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: var(--transition);
}
.btn-primary:hover { background: var(--steinweg-dark-navy); }
.btn-ghost {
  background: var(--background-alt); color: var(--text-secondary); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: var(--transition);
}
.btn-ghost:hover { background: #E8F4F6; color: var(--steinweg-teal); border-color: var(--steinweg-teal); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border-light); border-radius: var(--radius); }
.prod-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.prod-table thead th {
  background: var(--background-alt); color: var(--text-secondary); font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .03em; padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--border);
}
.prod-table tbody td { padding: 4px 6px; border-bottom: 1px solid var(--border-light); color: var(--text-primary); }
.prod-table tbody tr:last-child td { border-bottom: none; }
.cell-input {
  width: 100%; min-width: 52px; border: 1px solid transparent; background: transparent; font: inherit; font-size: 13px;
  padding: 6px 6px; border-radius: 6px; color: var(--text-primary);
}
.cell-input:hover { background: var(--background-alt); }
.cell-input:focus { outline: none; border-color: var(--steinweg-teal); background: #fff; box-shadow: 0 0 0 3px rgba(0,107,127,.10); }
select.cell-input { min-width: 150px; }
.cell-input.num { min-width: 54px; text-align: right; }
.cargo-sel { min-width: 170px; }
.hold-cell { background: #FAFCFD; }
.total-cell { font-weight: 600; text-align: right; color: var(--steinweg-dark-navy); }
.hrs-cell { font-weight: 600; text-align: right; color: var(--steinweg-teal); }
.hrs-cell.warn { color: var(--danger); }
.row-del { border: none; background: transparent; color: var(--text-tertiary); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.row-del:hover { background: #FEF2F2; color: var(--danger); }

.kpi-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }
.hold-tag { font-size: 11px; font-weight: 600; color: var(--steinweg-gold); margin-left: 6px; }
.note { margin: 12px 2px 0; font-size: 13px; color: var(--danger); background: #FEF2F2; border: 1px solid #FECACA; padding: 9px 12px; border-radius: var(--radius); }
.warn { color: var(--danger); font-weight: 600; }

.checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); }
.link-muted { color: var(--steinweg-teal); font-size: 13px; text-decoration: none; }
.btn-ghost input[type=file] { display: none; }

.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 50; background: var(--text-primary); color: #fff;
  padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.warn { background: var(--warning); }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.sidebar-logo-wrap span { font-weight: 700; color: var(--text-primary); }

@media print {
  .sidebar, .topbar, .card-actions, .row-del, #login { display: none !important; }
  .main-area { margin: 0 !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  body { background: #fff; }
}

/* ---- Gang planning ---- */
.gang-rec {
  background: linear-gradient(135deg, #E8F4F6, #F8FCFF); border: 1px solid #BAE0E6;
  border-left: 4px solid var(--steinweg-gold); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px;
}
.rec-main { font-size: 16px; color: var(--text-primary); }
.rec-main b { color: var(--steinweg-teal); }
.rec-sub { font-size: 13px; color: var(--text-secondary); margin-top: 5px; }
.gang-layout { display: grid; grid-template-columns: minmax(280px, 0.9fr) 1.3fr; gap: 22px; }
@media (max-width: 900px){ .gang-layout { grid-template-columns: 1fr; } }
.mini-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-tertiary); margin-bottom: 10px; }
.scenario-table { width: 100%; }
.scenario-head th { font-size: 10px !important; padding: 6px 8px !important; }
.scenario-row { cursor: pointer; transition: var(--transition); }
.scenario-row td { padding: 8px !important; border-bottom: 1px solid var(--border-light); }
.scenario-row:hover { background: var(--background-alt); }
.scenario-row.sel { background: #E8F4F6; box-shadow: inset 3px 0 0 var(--steinweg-teal); }
.scenario-row.optimal td { font-weight: 600; }
.sweet { color: var(--steinweg-gold); font-weight: 700; font-size: 12px; }
.hint, .balance-note { font-size: 12px; color: var(--text-tertiary); margin-top: 10px; font-style: italic; }
.grow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.glabel { width: 64px; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.gbar { flex: 1; display: flex; height: 30px; border-radius: 6px; overflow: hidden; background: var(--background-alt); }
.gseg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 600; min-width: 22px; border-right: 1px solid rgba(255,255,255,.35); }
.gseg:last-child { border-right: none; }
.gload { width: 54px; text-align: right; font-weight: 600; font-size: 13px; color: var(--steinweg-dark-navy); flex-shrink: 0; }

/* ---- Views / tally / production ---- */
.vessel-tag { margin-left: 14px; font-size: 13px; color: var(--text-tertiary); font-weight: 500; }
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; }
.shift-block { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px; background: #FCFEFF; }
.shift-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.shift-no { font-weight: 700; color: var(--steinweg-teal); font-size: 14px; }
.shift-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 14px; }
.tf { display: flex; flex-direction: column; gap: 3px; }
.tf label { font-size: 11px; color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.tf .cell-input { border: 1px solid var(--border); border-radius: 6px; background: #fff; min-width: 0; }
.net-val { font-weight: 700; color: var(--steinweg-dark-navy); padding: 7px 0; font-size: 14px; }
.holds-wrap { margin-top: 12px; }
.holds-row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
@media (max-width: 1100px){ .holds-row { grid-template-columns: repeat(6, 1fr); } }
.hold-in { display: flex; flex-direction: column; gap: 2px; }
.hold-in span { font-size: 10px; color: var(--text-tertiary); text-align: center; font-weight: 600; }
.hold-in .cell-input { border: 1px solid var(--border); border-radius: 6px; background: #fff; text-align: center; padding: 6px 2px; }
.delays-wrap { margin-top: 12px; }
.delays-wrap summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--steinweg-teal); padding: 4px 0; }
.delays-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 8px; }
.delay-in { display: flex; flex-direction: column; gap: 2px; }
.delay-in span { font-size: 10px; color: var(--text-tertiary); }
.delay-in .cell-input { border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 5px; }
.pbar { display: inline-block; width: 120px; height: 8px; background: var(--background-alt); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.pfill { height: 100%; background: var(--success); border-radius: 5px; }
.ppct { font-size: 12px; color: var(--text-secondary); margin-left: 8px; }

/* ---- Production dashboard ---- */
.dash-charts { display: grid; grid-template-columns: 240px 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 1100px){ .dash-charts { grid-template-columns: 1fr; } }
.chart-box { min-width: 0; }
.donut-wrap { position: relative; width: 200px; height: 200px; margin: 0 auto; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.dc-pct { font-size: 34px; font-weight: 700; color: var(--steinweg-dark-navy); line-height: 1; }
.dc-sub { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.bal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 900px){ .bal-grid { grid-template-columns: 1fr; } }
.bal-open { color: var(--danger); font-weight: 600; }
.bal-done { color: var(--success); font-weight: 600; }
.zero { color: var(--border); }
.matrix-tot td { background: var(--background-alt); border-top: 2px solid var(--border); }
#matrixTable td, #matrixTable th { text-align: right; }
#matrixTable td:first-child, #matrixTable th:first-child { text-align: left; }

/* ---- vs standard badges ---- */
.vs { display: inline-block; padding: 2px 9px; border-radius: 20px; font-weight: 700; font-size: 12px; }
.vs-good { background: var(--success-bg); color: var(--success); }
.vs-mid  { background: var(--warning-bg); color: var(--warning); }
.vs-bad  { background: #FEF2F2; color: var(--danger); }
.vs-na { color: var(--text-tertiary); }

/* ---- berth overview ---- */
.ovbar { display: inline-block; width: 140px; height: 9px; background: var(--background-alt); border-radius: 5px; overflow: hidden; vertical-align: middle; }
.ovfill { height: 100%; border-radius: 5px; }
