/* Apple blue · Excel workspaces · modular */
:root {
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: rgba(0, 113, 227, 0.08);
  --blue-soft-2: rgba(0, 113, 227, 0.14);
  --blue-line: rgba(0, 113, 227, 0.2);
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.12);
  --header-bg: #f0f4fa;
  --row-hover: #f5f9ff;
  --row-sel: rgba(0, 113, 227, 0.08);
  --green: #34c759;
  --green-soft: rgba(52, 199, 89, 0.12);
  --orange: #ff9f0a;
  --orange-soft: rgba(255, 159, 10, 0.12);
  --red: #ff3b30;
  --red-soft: rgba(255, 59, 48, 0.1);
  --gray-soft: rgba(142, 142, 147, 0.12);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 45% at 20% -10%, rgba(0,113,227,.09), transparent 55%);
  z-index: 0;
}

a { color: var(--blue); text-decoration: none; }

.shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 64px;
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 20px); }
}

/* Nav */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--line);
  border-radius: 980px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #0a84ff, #0071e3);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.nav-stats { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 980px;
  background: var(--blue-soft);
  color: var(--text-2);
  font-size: 12.5px;
}
.chip strong { color: var(--blue); font-variant-numeric: tabular-nums; }

/* Announcement — soft Apple notice card */
.announce {
  position: relative;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 55%, #f7fbff 100%);
  border: 1px solid rgba(0, 113, 227, 0.14);
  box-shadow: 0 4px 18px rgba(0, 113, 227, 0.06);
}
.announce-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
}
.announce-inner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px 14px 18px;
}
.announce-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
}
.announce-body { flex: 1; min-width: 0; }
.announce-title {
  font-size: 12px;
  font-weight: 650;
  color: var(--blue);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.announce-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Module */
.mod {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.mod-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #fff);
}

.mod-hd h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mod-n {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--blue-soft-2);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.mod-sub {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 3px;
  padding-left: 32px;
}

.mod-tag {
  font-size: 11px;
  font-weight: 650;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 980px;
  padding: 4px 10px;
  white-space: nowrap;
}

.mod-bd { padding: 16px 18px 18px; }

/* Form */
.field { margin-bottom: 12px; }
.lbl {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

.input, .textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  background: #fbfbfd;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.textarea {
  min-height: 96px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
}
.hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 980px;
  padding: 9px 15px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .08s, opacity .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-secondary { background: var(--gray-soft); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
}
.check input { width: 15px; height: 15px; accent-color: var(--blue); }

/* CDK */
.cdk-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: end;
}
@media (max-width: 700px) { .cdk-grid { grid-template-columns: 1fr; } }

.cdk-status { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.cdk-status.ok { color: #248a3d; }
.cdk-status.bad { color: var(--red); }

.note {
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--blue-soft);
  color: #0040a0;
  border: 1px solid var(--blue-line);
}
.note.warn {
  background: var(--orange-soft);
  color: #9a5b00;
  border-color: rgba(255,159,10,.28);
}

/* Progress */
.progress-wrap {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-2);
}
.progress-meta strong {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 8px;
  border-radius: 980px;
  background: rgba(0,0,0,.06);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 980px;
  background: linear-gradient(90deg, #0a84ff, #0071e3);
  transition: width .25s ease;
}
.progress-bar.done {
  background: linear-gradient(90deg, #30d158, #34c759);
}

/* Sheet toolbar + refined table (clean Apple list, not heavy grid) */
.sheet-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.sheet {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  overflow: auto;
  max-height: min(460px, 56vh);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

table.excel {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
  font-size: 13px;
}

table.excel th,
table.excel td {
  padding: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  vertical-align: middle;
  text-align: left;
}

table.excel tbody tr:last-child td { border-bottom: none; }

table.excel th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbfcfe;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

table.excel th .cell,
table.excel td .cell {
  padding: 11px 14px;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}

table.excel tbody tr {
  transition: background .12s ease;
}
table.excel tbody tr:hover td { background: #f7faff; }
table.excel tbody tr.selected td { background: rgba(0, 113, 227, 0.07); }

/* soft status accent via left bar on first cell */
table.excel tbody tr.is-ok td:first-child {
  box-shadow: inset 3px 0 0 #34c759;
}
table.excel tbody tr.is-bad td:first-child {
  box-shadow: inset 3px 0 0 #ff3b30;
}
table.excel tbody tr.is-run td:first-child {
  box-shadow: inset 3px 0 0 #0071e3;
}

table.excel .col-chk { width: 46px; }
table.excel .col-no { width: 56px; }
table.excel .col-status { width: 112px; }
table.excel .col-act { width: 168px; white-space: nowrap; }

table.excel .col-no .cell {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

table.excel code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: #f2f4f7;
  padding: 3px 7px;
  border-radius: 6px;
}

table.excel .msg {
  font-size: 12.5px;
  color: var(--text-2);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.excel .col-act .cell {
  gap: 6px;
  flex-wrap: wrap;
}

.chk { width: 15px; height: 15px; accent-color: var(--blue); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 980px;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}
.tag .dot {
  width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.tag-idle { background: var(--gray-soft); color: #636366; }
.tag-queued, .tag-running { background: var(--blue-soft); color: var(--blue); }
.tag-running .dot { animation: pulse 1.1s infinite; }
.tag-has_gcash, .tag-success { background: var(--green-soft); color: #248a3d; }
.tag-no_gcash, .tag-failed, .tag-cancelled { background: var(--red-soft); color: var(--red); }

@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: .3; }
}

.empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--text-3);
  font-size: 13.5px;
}

.url-mini {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--blue);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-btn { position: relative; overflow: hidden; }
.file-btn input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

.hidden { display: none !important; }

.page-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-3);
}

/* Toast */
.toast-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: rgba(29,29,31,.92);
  color: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 13px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.toast.ok { background: rgba(36,138,61,.95); }
.toast.err { background: rgba(196,30,22,.95); }

/* Admin */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.admin-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.admin-stat .k { font-size: 12px; color: var(--text-2); }
.admin-stat .v {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.login-wrap { max-width: 400px; margin: 64px auto 0; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
table.data th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-3);
  background: #fafafa;
  font-weight: 600;
}
table.data code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--gray-soft);
  padding: 2px 6px;
  border-radius: 4px;
}
