/* DCONNECT Auto Scheduler — Data Hub */
:root {
  --yellow: #FFCC00; --yellow-2: #ffe680; --yellow-3: #fff8d6;
  --red: #D40511; --red-2: #fde8e9;
  --ink: #1a1a1a; --muted: #6b7280; --line: #e5e7eb; --line-2: #f0f1f3;
  --bg: #f5f6f7; --card: #ffffff;
  --green: #16a34a; --green-2: #e6f6ec; --amber: #d97706; --amber-2: #fff3dc;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 "DejaVu Sans", Verdana, system-ui, -apple-system, "Segoe UI", sans-serif; }
/* the side gutter follows the screen: 92px on a wide monitor, 16px on a phone */
:root { --gutter: clamp(16px, 8vw - 14px, 92px); }   /* 92px from 1,325px up, 16px at 375px */
body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
a { color: var(--red); text-decoration: none; }
b, strong { font-weight: 700; }
button, input, select { font: inherit; color: inherit; }

/* ── header ── */
.top { background: var(--yellow); min-height: 80px; display: flex; align-items: center;
  padding: 0 var(--gutter); justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 900; font-style: italic; font-size: 30px; color: var(--red);
  letter-spacing: -1px; }
.brand .sep { width: 1px; height: 26px; background: rgba(0,0,0,.25); }
.brand .app { font-weight: 800; font-style: italic; font-size: 14px; letter-spacing: .08em; }
.chips { display: flex; gap: 16px; align-items: center; }
.chip { background: rgba(255,255,255,.55); border-radius: 22px; padding: 10px 18px;
  font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip .av { width: 24px; height: 24px; border-radius: 50%; background: var(--red);
  color: #fff; font-size: 10px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 800; }

/* ── page ── */
.page { padding: 36px var(--gutter) 60px; max-width: 1920px; margin: 0 auto; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0 0 6px; font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
.sub { color: var(--muted); font-size: 14px; margin: 0; }
.kicker { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--muted);
  text-transform: uppercase; margin: 0 0 8px; text-align: right; }
.select { background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 14px; font-weight: 700; font-size: 14px; display: inline-flex;
  align-items: center; gap: 10px; }
.select input, .select select { border: 0; background: transparent; font-weight: 700;
  outline: none; max-width: 100%; min-width: 0; }
.select { max-width: 100%; }
/* the tabs never wrap; on a narrow screen they slide sideways instead */
.tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin: 26px 0 26px;
  overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 16px 12px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent;
  margin-bottom: -1px; white-space: nowrap; flex: 0 0 auto; }
.tab.on { color: var(--ink); border-color: var(--red); }

.section { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px;
  gap: 10px 18px; flex-wrap: wrap; }
.section .tools { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; }
.section h2 { margin: 0; font-size: 13px; letter-spacing: .12em; font-weight: 800;
  text-transform: uppercase; padding-left: 12px; border-left: 4px solid var(--red); line-height: 1.2; }
.section h2.y { border-color: var(--yellow); }
.section .hint { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; background: var(--line-2); border-radius: 10px;
  padding: 2px 9px; font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 8px; }

/* ── tiles ── */
/* as many columns as there are tiles: seven on the Summary, five on the
   month plan — a fixed seven left two empty columns on the right there */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow); }
.tile .lbl { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px;
  color: #374151; }
.tile .big { font-size: 30px; font-weight: 800; margin: 8px 0 6px; letter-spacing: -.5px; white-space: nowrap; }
.tile .sub { font-size: 12px; }
.tile .big.green { color: var(--green); } .tile .big.red { color: var(--red); }
.tile .big.amber { color: var(--amber); }

/* ── tables ── */
/* a table wider than the screen scrolls sideways inside its card rather
   than being cut off — every card scrolls, so a phone reaches every column */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: right; font-size: 12.5px; border-top: 1px solid var(--line-2);
  white-space: nowrap; }
th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; border-top: 0; background: var(--card); vertical-align: bottom; }
th:first-child, td:first-child { text-align: left; }
td:first-child { font-weight: 700; }
tr.group td { background: var(--yellow-3); font-weight: 800; font-size: 11.5px; letter-spacing: .06em;
  text-transform: uppercase; text-align: left; padding: 7px 10px; }
tr.total td { background: var(--line-2); font-weight: 700; }
.bands th { border-top: 0; padding: 6px 10px; font-size: 10.5px; }
.band-att { background: #fdeceb; color: #9a1a20; } .band-vol { background: #fff3c4; color: #7a5a00; }
.band-mp { background: #e4f4ea; color: #1b5e33; } .band-ot { background: #e6effc; color: #1f3f7a; }
.bad { color: var(--red); font-weight: 700; } .warn { color: var(--amber); font-weight: 700; }
.good { color: var(--green); font-weight: 700; } .dim { color: var(--muted); }
.eye { display: inline-flex; width: 26px; height: 26px; border: 1px solid var(--line);
  border-radius: 6px; align-items: center; justify-content: center; background: var(--card);
  cursor: pointer; color: #374151; }
.eye:hover { border-color: var(--ink); }
.legend { display: flex; gap: 6px 18px; font-size: 12px; color: var(--muted); align-items: center; flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px;
  vertical-align: middle; }

/* ── cards (inputs) ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 20px; }
.icard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 18px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.icard .ico { width: 54px; height: 54px; border-radius: 50%; background: var(--red);
  color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.icard h3 { margin: 0; font-size: 17px; flex: 1; }   /* the title takes the slack; the cards carry no description now */
/* the description takes the slack, so "Last uploaded" and the buttons sit on
   one line across the row however many lines a card's title wraps to */
.icard .last { background: var(--line-2); border-radius: 6px; padding: 8px 10px; font-size: 12px;
  color: var(--muted); margin: 14px 0 12px; }
.icard .last b { color: var(--ink); }
.icard .btns { display: flex; gap: 8px; }
/* the two buttons share the card's width; at the natural padding the pair
   was wider than the card and Upload data hung past its right edge */
.icard .btns .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 11px 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 8px; padding: 11px 16px;
  font-weight: 700; font-size: 13px; border: 1px solid var(--line); background: var(--card);
  cursor: pointer; white-space: nowrap; }
.btn.y { background: var(--yellow); border-color: var(--yellow); }
.btn.r { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 8px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.out { display: flex; align-items: center; gap: 22px; padding: 22px 24px; flex-wrap: wrap; }
.out .ico { width: 72px; height: 72px; border-radius: 12px; background: var(--yellow);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.out h3 { margin: 0 0 6px; font-size: 22px; }
.out .meta { color: var(--muted); font-size: 13px; }
.out .btns { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-block; border-radius: 10px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.pill.ok { background: var(--green-2); color: var(--green); }
.pill.fail { background: var(--red-2); color: var(--red); }
.pill.run { background: var(--amber-2); color: var(--amber); }
.empty { padding: 26px; color: var(--muted); text-align: center; }
footer { margin-top: 36px; font-size: 12px; color: var(--muted); display: flex; gap: 6px 18px; flex-wrap: wrap; }
.alert { background: var(--red-2); color: #7a0d13; border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; }

/* ── modal ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none;
  align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 50; overflow: auto; }
.overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 16px; width: min(1360px, 100%);
  box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; align-items: center; gap: 18px; padding: 24px 32px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.modal-head .ico { width: 50px; height: 50px; border-radius: 50%; background: var(--red);
  color: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.modal-head h2 { margin: 0; font-size: 22px; } .modal-head .meta { color: var(--muted); font-size: 13px; }
.modal-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--line-2); border-radius: 8px; padding: 3px; flex-wrap: wrap; max-width: 100%; }
.seg a, .seg span { padding: 7px 14px; border-radius: 6px; font-weight: 700; font-size: 13px;
  color: var(--muted); }
.seg .on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.x { width: 40px; height: 40px; border-radius: 50%; background: var(--line-2); border: 0;
  cursor: pointer; font-size: 18px; }
.modal-body { padding: 22px 32px 28px; }
.strip { display: grid; grid-template-columns: 1.1fr 1fr 1fr .9fr; gap: 12px; margin-bottom: 20px; }
.strip.six { grid-template-columns: repeat(6, 1fr); }
.strip .box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.strip .box.att { background: #fdf3f3; } .strip .box.vol { background: #fff9e0; }
.strip .box.mp { background: #eef8f1; } .strip .box.ot { background: #eef3fb; }
.strip .t { font-size: 10.5px; letter-spacing: .08em; font-weight: 800; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; }
.strip .kv { display: flex; gap: 8px 18px; flex-wrap: wrap; }
/* labels sit at the top and values at the bottom of one shared row, so a
   label that wraps ("Absence %", "Spare MH") no longer pushes its value
   below its neighbours' */
.strip .kv div { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; }
.strip .kv b { display: block; font-size: 15px; color: var(--ink); margin-top: auto; padding-top: 2px; }
.bar { display: inline-block; width: 90px; height: 6px; border-radius: 3px; background: var(--line);
  vertical-align: middle; margin-right: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); }
.bar i.mid { background: var(--yellow); } .bar i.full { background: var(--green); }
.tag { display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.tag.vol { background: var(--yellow-2); } .tag.fix { background: var(--line-2); color: var(--muted); }
.modal-foot { display: flex; align-items: center; gap: 12px; padding: 16px 32px 24px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.modal-foot .btns { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
/* a long file name wraps inside its card instead of stretching it */
.modal-body .card > div { min-width: 0; overflow-wrap: anywhere; }
label.card { overflow: hidden; }
input[type=file] { max-width: 100%; }
/* the Apply button sits on the same line as Cancel and Upload & validate */
.apply-row { margin-top: -46px; display: flex; justify-content: flex-end; }
/* a row of controls (pickers, inputs, a button) that wraps when it must */
.row-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-wrap.end { align-items: flex-end; }

/* ── user menu ── */
.menu { position: relative; }
.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: 52px; width: 260px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.15); z-index: 40; overflow: hidden; }
.menu-body a, .menu-body button { display: block; width: 100%; text-align: left; padding: 11px 16px; color: var(--ink);
  font-weight: 700; font-size: 13px; background: none; border: 0; cursor: pointer; }
.menu-body a:hover, .menu-body button:hover { background: var(--line-2); }
.menu-body button { color: var(--red); }

/* ── narrower screens ──
   Nothing above changes meaning here; these rules only re-flow what a
   1,400px monitor lays out side by side so a tablet or a phone shows it
   cleanly. Three widths: a small laptop or tablet (≤1100), a tablet held
   upright or a large phone (≤760), and a phone (≤520). */
@media (max-width: 1100px) {
  .top { min-height: 68px; }
  h1 { font-size: 28px; }
  .tile { padding: 14px 14px; }
  .tile .big { font-size: 26px; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .strip.six { grid-template-columns: repeat(3, 1fr); }
  .modal-head, .modal-body { padding-left: 22px; padding-right: 22px; }
  .modal-foot { padding-left: 22px; padding-right: 22px; }
}

@media (max-width: 760px) {
  /* header: brand on the left, the two chips on the right, both smaller */
  .top { min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
  .logo { font-size: 22px; letter-spacing: -.5px; }
  .brand { gap: 10px; }
  .brand .sep { height: 20px; }
  .brand .app { font-size: 11px; letter-spacing: .06em; }
  .chips { gap: 8px; }
  .chip { padding: 7px 12px; font-size: 12px; }
  .chip .av { width: 20px; height: 20px; font-size: 9px; }
  .menu-body { width: min(260px, calc(100vw - 32px)); }

  .page { padding-top: 20px; padding-bottom: 40px; }
  .head { flex-direction: column; align-items: stretch; gap: 12px; }
  .head > div:last-child:empty { display: none; }
  h1 { font-size: 26px; margin-bottom: 4px; }
  .sub { font-size: 13px; }
  .kicker { text-align: left; margin-bottom: 6px; }
  .tabs { margin: 18px 0; }
  .tab { padding: 8px 12px 10px; }
  .section { margin: 18px 0 10px; }
  .section h2 { font-size: 12px; }

  /* tiles two abreast; the numbers a little smaller so they never clip */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px 12px; }
  .tile .lbl { font-size: 12px; }
  .tile .big { font-size: 24px; margin: 6px 0 4px; }
  .tile .sub { font-size: 11px; }
  .tile .sub b { font-size: 13px !important; }

  th, td { padding: 6px 8px; font-size: 12px; }
  .cards { gap: 12px; }
  .icard { padding: 18px 16px 16px; }
  .icard .ico { width: 44px; height: 44px; margin-bottom: 14px; }
  .icard h3 { font-size: 16px; }
  .out { padding: 16px; gap: 14px; }
  .out .ico { width: 52px; height: 52px; }
  .out h3 { font-size: 18px; }
  .out > div:nth-child(2) { flex: 1 1 160px; min-width: 0; }
  .out .btns { margin-left: 0; width: 100%; }
  .out .btns .btn { flex: 1 1 auto; justify-content: center; }
  .btn { padding: 10px 12px; }
  .empty { padding: 20px 14px; }

  /* a modal fills the screen edge to edge; the close button keeps its
     corner while the pickers and shift switches drop to their own line */
  .overlay { padding: 0; }
  .modal { min-height: 100%; border-radius: 0; width: 100%; }
  .modal-head { position: relative; padding: 16px 56px 14px 16px; gap: 12px; }
  .modal-head .ico { width: 40px; height: 40px; }
  .modal-head h2 { font-size: 18px; }
  .modal-head .meta { font-size: 12px; }
  .modal-head .right { flex-basis: 100%; margin-left: 0; gap: 8px; }
  .modal-head .right .select { flex: 1 1 140px; }
  .modal-head .right .select select, .modal-head .right .select input { width: 100%; }
  .modal-head .x { position: absolute; top: 14px; right: 12px; width: 36px; height: 36px; }
  .modal-body { padding: 16px 16px 20px; }
  .modal-foot { padding: 14px 16px 18px; }
  .modal-foot .btns { margin-left: 0; width: 100%; }
  .modal-foot .btns .btn { flex: 1 1 auto; justify-content: center; }
  .apply-row { margin-top: 10px; }
  .apply-row .btn { width: 100%; justify-content: center; }
  .strip { gap: 8px; }
  .strip.six { grid-template-columns: repeat(2, 1fr); }
  .strip .box { padding: 8px 10px; }
  .seg a, .seg span { padding: 6px 10px; font-size: 12px; }
  .rg { max-height: 70vh !important; }
  .row-wrap > * { max-width: 100%; }
  footer { margin-top: 28px; }
}

@media (max-width: 520px) {
  .top { padding-top: 6px; padding-bottom: 6px; }
  .brand .sep, .brand .app { display: none; }
  .chip { padding: 6px 10px; }
  /* the site chip keeps only its pin on a phone; the name is in the menu */
  .chips > span.chip:first-child { display: none; }
  h1 { font-size: 24px; }
  .strip { grid-template-columns: 1fr; }
  .strip.six { grid-template-columns: repeat(2, 1fr); }
  .tile .big { font-size: 22px; }
  .modal-head .right .select { flex-basis: 100%; }
  .modal-head .right .seg { width: 100%; }
  .modal-head .right .seg a, .modal-head .right .seg span { flex: 1 1 auto; text-align: center; }
  .split-form { flex-direction: column; align-items: stretch; }
}
