/* RTIH Digital Ecosystem — design system (plain CSS on top of Tailwind CDN utilities) */
:root { --pri: #2563eb; --pri-d: #1d4ed8; --line: #e2e8f0; --ink: #0f172a; }
html { font-size: 14px; }
body { font-family: Inter, system-ui, sans-serif; overflow-x: hidden; }
h1, h2, h3, h4 { color: var(--ink); }
[data-lucide] { flex-shrink: 0; }
svg.lucide { flex-shrink: 0; stroke-width: 1.75; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.card-h h3 { font-weight: 600; font-size: .95rem; }
.card-b { padding: 1rem; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .8rem; border-radius: 8px; font-weight: 500; font-size: .9rem; line-height: 1.25rem; border: 1px solid #cbd5e1; background: #fff; color: #334155; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s; }
.btn:hover { background: #f1f5f9; }
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.btn-primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn-primary:hover { background: var(--pri-d); }
.btn-danger { color: #b91c1c; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .22rem .55rem; font-size: .8rem; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.input { width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: .45rem .65rem; font-size: .9rem; background: #fff; color: var(--ink); outline: none; }
.input:focus { border-color: var(--pri); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
select.input { padding-right: 1.6rem; }
.label { display: block; font-size: .8rem; font-weight: 500; color: #475569; margin-bottom: .25rem; }
.err { color: #b91c1c; font-size: .75rem; margin-top: .2rem; }
.hint { color: #64748b; font-size: .75rem; margin-top: .2rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 500; border: 1px solid; white-space: nowrap; }
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.b-green { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.b-blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.b-amber { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.b-red { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.b-violet { color: #6d28d9; background: #f5f3ff; border-color: #ddd6fe; }
.b-slate { color: #475569; background: #f8fafc; border-color: #e2e8f0; }

.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 500; color: #64748b; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: .55rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.tbl td { padding: .6rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #f8fafc; }

.tab { padding: .55rem .15rem; margin-right: 1.25rem; font-size: .9rem; font-weight: 500; color: #64748b; border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--pri); border-color: var(--pri); }

/* internal shell */
#sidebar { width: 17rem; background: #fff; border-right: 1px solid var(--line); color: #475569; }
#sidebar .sb-mark { display: none; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 8px; color: #64748b; font-size: .95rem; font-weight: 500; padding: .6rem .75rem; }
.nav-item:hover { background: #f1f5f9; color: var(--ink); }
.nav-item.active { background: #eff6ff; color: var(--pri); }
@media (min-width: 1024px) {
  .shell { padding-left: 17rem; }
  .sb-collapsed .shell { padding-left: 4.25rem; }
  .sb-collapsed #sidebar { width: 4.25rem; }
  .sb-collapsed #sidebar .sb-label { display: none; }
  .sb-collapsed #sidebar .sb-mark { display: block; }
  .sb-collapsed #sidebar .nav-item { justify-content: center; }
}
@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sb-open #sidebar { transform: none; }
  .sb-open #sb-backdrop { display: block; }
}

/* portal shell */
.pnav { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem .7rem; border-radius: 8px; font-size: .9rem; font-weight: 500; color: #475569; white-space: nowrap; }
.pnav:hover { background: #f1f5f9; color: var(--ink); }
.pnav.active { background: #eff6ff; color: var(--pri); }
.btab { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; padding: .45rem 0 .35rem; font-size: .72rem; color: #64748b; }
.btab.active { color: var(--pri); }

.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); }
.menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .75rem; font-size: .88rem; color: #334155; text-align: left; }
.menu-item:hover { background: #f1f5f9; }

.fade-in { animation: fade .15s ease-out; }
.slide-in { animation: slide .2s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
@keyframes slide { from { transform: translateX(100%); } }

.kan-col.over { background: #eff6ff; outline: 2px dashed #93c5fd; }
.prose-l p { margin-bottom: .75rem; line-height: 1.65; }
.prose-l ul { list-style: disc; padding-left: 1.2rem; margin-bottom: .75rem; }

.phone { width: 390px; max-width: 100%; height: min(800px, calc(100vh - 110px)); border: 10px solid #0f172a; border-radius: 44px; overflow: hidden; background: #fff; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); position: relative; }
.phone::before { content: ''; position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 90px; height: 22px; background: #0f172a; border-radius: 14px; z-index: 2; }
.phone iframe { width: 100%; height: 100%; border: 0; }
.embed .safe-top { padding-top: 30px; }

#print { display: none; }
@media print {
  body > *:not(#print) { display: none !important; }
  #print { display: block; padding: 12px; }
  #print .tbl th, #print .tbl td { padding: .35rem .5rem; font-size: 11px; }
  @page { margin: 12mm; }
}
