/* Page-level layout and tables. */
.grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(170px,1fr)); gap:12px; }
.stat b { display:block; font-size:22px; }
.toolbar { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.bank-section { margin-bottom:24px; }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:7px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:500; font-size:12px; text-transform:uppercase; }

/* ---- Programacion: status strip, 3-step wizard, purchase cards */
.strip { margin-bottom:14px; display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:10px; }
.strip-card { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:4px; }
.strip-card.watch-on { border-color:#1d6b4f; background:linear-gradient(180deg,#12392b33,transparent 70%),var(--panel); }
.strip-card.watch-off { border-color:#7a2a26; }
.strip-title { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.msg.warn { background:#3a2c0a; border:1px solid #7a5a12; color:var(--amber); padding:8px 12px; border-radius:8px; }

.wizard { display:flex; flex-direction:column; gap:16px; padding:16px; }
.wz-step { display:flex; flex-direction:column; gap:10px; padding-top:12px; border-top:1px solid var(--line); }
.wz-step:first-of-type { border-top:0; padding-top:0; }
.wz-head { display:flex; gap:12px; align-items:center; }
.wz-head h3 { font-size:15px; }
.wz-num { flex:none; width:26px; height:26px; border-radius:50%; background:var(--accent); color:#031018; font-weight:800; display:grid; place-items:center; font-size:13px; }
.tiles { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; }
.tile { flex-direction:column; align-items:flex-start; gap:4px; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--text); cursor:pointer; position:relative; }
.tile:hover { border-color:var(--accent); }
.tile.on { border-color:var(--accent); background:#10304d55; box-shadow:0 0 0 1px var(--accent); }
.tile input[type=radio] { position:absolute; opacity:0; pointer-events:none; }
.tile b { font-size:14px; }
.tile-sub { font-size:12px; color:var(--muted); font-weight:400; }
.tile-sub.watch-on { color:var(--open); }
.tile-sub.watch-off { color:#ff8f88; }
.watch-line { font-size:12px; }
.pick-actions { display:flex; gap:6px; }
.pick-list { display:flex; flex-direction:column; gap:6px; }
.pick-row { flex-direction:row; align-items:center; gap:12px; padding:8px 12px; border:1px solid var(--line); border-radius:10px; background:var(--card); color:var(--text); flex-wrap:wrap; }
.pick-who { display:flex; flex-direction:column; flex:1 1 180px; min-width:0; }
.pick-amount { display:flex; align-items:center; gap:6px; }
.pick-row input.amount { width:8em; }
.avatar.sm { width:30px; height:30px; font-size:12px; }
.wz-sentence { padding:12px 14px; border-radius:10px; background:#10304d55; border:1px solid #1b4f80; }
.wz-total { font-weight:700; color:var(--accent); }

.sched-group { margin-top:18px; }
.sched-group h2, .sched-group summary { display:flex; align-items:center; gap:8px; }
.count { font-size:12px; background:var(--card2); border:1px solid var(--line); border-radius:999px; padding:1px 9px; color:var(--muted); font-weight:600; }
.sched-list { display:flex; flex-direction:column; gap:8px; margin:8px 0; }
.sched-card { display:grid; grid-template-columns:minmax(200px,1.2fr) minmax(200px,1.6fr) auto; gap:8px 16px; align-items:center; background:var(--panel); border:1px solid var(--line); border-left:4px solid var(--line); border-radius:10px; padding:10px 14px; }
.sched-card.running { border-left-color:var(--amber); }
.sched-card.waiting { border-left-color:var(--accent); }
.sched-card.done { border-left-color:var(--open); }
.sched-card.uncertain { border-left-color:var(--amber); background:#3a2c0a33; }
.sched-card.failed { border-left-color:var(--bad); }
.sc-line { color:var(--text); margin-top:2px; }
.sc-state { display:flex; flex-direction:column; gap:3px; align-items:flex-start; }
.sc-detail { max-width:46ch; overflow-wrap:anywhere; }
.sc-actions { display:flex; gap:6px; justify-content:flex-end; }
@media (max-width:760px) { .sched-card { grid-template-columns:1fr; } .sc-actions { justify-content:flex-start; } }
.admin-box { margin-top:24px; }
.admin-box > summary { cursor:pointer; }

/* ---- opening status bar, "how it works", who watches */
.page-title p { margin:2px 0 10px; }
.mech-status { gap:6px; }
.mech-status.open { border-color:#1d6b4f; background:linear-gradient(180deg,#12392b55,transparent 80%),var(--panel); }
.mech-status.closed { border-color:#7a2a26; background:linear-gradient(180deg,#3a1b1a44,transparent 80%),var(--panel); }
.opening-chip { display:inline-flex; align-items:center; gap:8px; padding:3px 12px 3px 9px; border-radius:999px; font-weight:800; font-size:13px; border:1px solid var(--line); background:#1b2430; color:var(--muted); }
.opening-chip .dot { width:9px; height:9px; border-radius:50%; background:currentColor; }
.opening-chip.open { background:#12392b; color:var(--open); border-color:#1d6b4f; }
.opening-chip.open .dot { box-shadow:0 0 0 0 #2fd18b88; animation:pulse 1.8s infinite; }
.opening-chip.closed { background:#3a1b1a; color:#ff8f88; border-color:#7a2a26; }
@keyframes pulse { 0% { box-shadow:0 0 0 0 #2fd18b99; } 70% { box-shadow:0 0 0 8px #2fd18b00; } 100% { box-shadow:0 0 0 0 #2fd18b00; } }
@media (prefers-reduced-motion:reduce) { .opening-chip.open .dot { animation:none; } }
.opening-detail { font-size:12px; min-height:1.3em; }
.strip-watch { display:flex; gap:8px; align-items:center; flex-wrap:wrap; font-size:12px; }
.who-watches { font-size:12px; }
.announce-row { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin-top:4px; padding-top:8px; border-top:1px dashed var(--line); }

.how { margin-bottom:14px; }
.how > summary { cursor:pointer; }
.how-steps { list-style:none; margin:10px 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; }
.how-step { display:flex; gap:10px; align-items:flex-start; }
.how-note { margin-top:10px; font-size:12px; }
.watcher-box { display:flex; flex-direction:column; gap:6px; padding:10px 12px; border:1px solid #1b4f80; background:#10304d33; border-radius:10px; }

/* ---- exact time: type hh:mm or open the native clock (all 60 minute values) */
.time-pair { display:flex; gap:16px; flex-wrap:wrap; align-items:start; }
.when-exact { margin-top:8px; }

/* ---- day preset segmented control */
.seg { display:inline-flex; gap:0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.seg-btn { background:var(--card); border:0; border-right:1px solid var(--line); color:var(--muted); padding:7px 14px; cursor:pointer; font:inherit; }
.seg-btn:last-child { border-right:0; }
.seg-btn.on { background:var(--accent); color:#031018; font-weight:700; }
.mini { font-size:12px; margin-top:4px; }
.tiles-3 { grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); }
.ok-box { border-color:#1d6b4f; background:#12392b33; }

/* ---- quick buy-now-all */
.quick-buy { border-color:#7a2a26; background:linear-gradient(180deg,#3a1b1a33,transparent 70%),var(--panel); }
.qb-row { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.qb-controls { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

/* ---- Programacion: purchases and global watcher are separate tabs */
.program-panel { min-width:0; }
.watch-settings > .section-lead { border-color:#1b4f80; background:linear-gradient(135deg,#10304d66,transparent 70%),var(--panel); }
.section-lead h2, .section-lead h3 { margin:0 0 5px; }
.announce-panel { margin-bottom:18px; }
.announce-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-top:8px; }
.announce-card { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.watch-config-list > h2 { margin-top:18px; }
.purchase-defaults { margin-top:20px; }
.purchase-defaults > p { margin-bottom:10px; }
.default-row { display:grid; grid-template-columns:minmax(120px,180px) minmax(260px,1fr); gap:12px; align-items:start; padding-top:10px; border-top:1px solid var(--line); }
.default-row > b { padding-top:10px; }
.default-row .card { margin:0; background:var(--card); }
@media (max-width:650px) { .default-row { grid-template-columns:1fr; } .default-row > b { padding-top:0; } }

/* ---- administrator: global optional-menu visibility */
.module-settings { border-color:#35506e; }
.module-settings > p { margin:5px 0 12px; }
.module-grid { display:flex; flex-wrap:wrap; gap:10px 18px; margin-bottom:12px; }
.module-grid .switch { min-width:130px; color:var(--text); }
