/* Tailwind-first. Only additions for @apply-like patterns and mobile quirks. */

.hidden { display: none !important; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: rgb(203 213 225); cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: #10b981; color: #fff; box-shadow: 0 4px 10px -3px rgba(16,185,129,.6); }

/* Zebra striped table */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.tbl thead th { background: #f8fafc; padding: 10px 12px; text-align: left; font-size: 11px; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e2e8f0; }
.tbl tbody td { padding: 11px 12px; font-size: 13px; color: #1e293b; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:nth-child(even) { background: #fafbfc; }
.tbl tbody tr:hover { background: #f1f5f9; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl-empty { text-align: center; padding: 40px 12px; color: #94a3b8; font-size: 13px; }

/* Form controls */
.inp, .sel, .ta {
  width: 100%; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 13px; background: #fff; color: #1e293b; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus, .sel:focus, .ta:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.ta { min-height: 80px; resize: vertical; }
.lbl { display: block; font-size: 12px; color: #475569; margin-bottom: 4px; font-weight: 500; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all .15s; background: #10b981; color: #fff; }
.btn:hover { background: #059669; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: #fff; color: #475569; border: 1px solid #e2e8f0; }
.btn.sec:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn.danger { background: #ef4444; }
.btn.danger:hover { background: #dc2626; }
.btn.sm { padding: 5px 10px; font-size: 12px; }

/* Role tags — distinct hues for each role number */
.role-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.role-1 { background: #dbeafe; color: #1d4ed8; }
.role-2 { background: #d1fae5; color: #047857; }
.role-3 { background: #ede9fe; color: #6d28d9; }
.role-4 { background: #fce7f3; color: #be185d; }
.role-5 { background: #fef3c7; color: #b45309; }
.role-6 { background: #ccfbf1; color: #0f766e; }
.role-7 { background: #ffedd5; color: #c2410c; }
.role-8 { background: #e0e7ff; color: #4338ca; }
.role-9 { background: #fee2e2; color: #b91c1c; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.fail { background: #fee2e2; color: #b91c1c; }
.badge.warn { background: #fef3c7; color: #b45309; }
.badge.muted { background: #e2e8f0; color: #475569; }
.badge.info { background: #dbeafe; color: #1d4ed8; }
.badge.public { background: #dbeafe; color: #1d4ed8; }
.badge.private { background: #fef3c7; color: #b45309; }

/* KPI cards */
.kpi { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.kpi .n { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.kpi .l { font-size: 12px; color: #64748b; margin-top: 4px; }
.kpi-num { font-variant-numeric: tabular-nums; transition: color .25s; }

/* Toast states */
#toast { background: #1e293b; }
#toast.ok { background: #10b981; }
#toast.err { background: #ef4444; }

/* Script line row in viewer */
.line-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.line-row:nth-child(even) { background: #fafbfc; }
.line-row:last-child { border-bottom: none; }
.line-row .idx { width: 28px; color: #94a3b8; font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 3px; }
.line-row .body { flex: 1; min-width: 0; }
.line-row .txt { color: #1e293b; word-break: break-word; line-height: 1.5; }
.line-row .meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* Misc */
.card { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.page-h { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-h h1 { font-size: 20px; font-weight: 600; color: #0f172a; }
.subtitle { font-size: 13px; color: #64748b; margin-bottom: 14px; }

@media (max-width: 768px) {
  .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl-scroll .tbl { min-width: 600px; }
}
