:root {
  --header: #0b1220;
  --brand: #f97316;        /* Tijara orange */
  --brand-2: #ea580c;
  --brand-soft: #fff7ed;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e6eaf0;
  --surface: #ffffff;
  --ok: #16a34a;
  --err: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,23,42,.12);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 100% -10%, #eef2ff 0, transparent 55%),
              radial-gradient(1000px 500px at -10% 110%, #fff7ed 0, transparent 55%),
              #f6f8fb;
  display: flex; flex-direction: column; min-height: 100%;
}

/* ===== Header ===== */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: linear-gradient(90deg, #0b1220, #131c2e);
  color: #fff; position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 6px 20px -12px rgba(0,0,0,.5);
}
.brand { font-size: 18px; font-weight: 800; letter-spacing: .3px; display: flex; align-items: center; gap: 10px; }
.brand::before {
  content: "T"; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 12px -4px rgba(234,88,12,.6);
}
.brand span { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.nav > span { color: #94a3b8; margin-right: 6px; }
.nav a { color: #cbd5e1; text-decoration: none; padding: 7px 12px; border-radius: 8px; transition: background .15s, color .15s; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav .credits { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.nav form { margin: 0; }
.link { background: none; border: none; color: #cbd5e1; cursor: pointer; font-size: 14px; padding: 7px 10px; border-radius: 8px; }
.link:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ===== Layout ===== */
main { max-width: 1000px; width: 100%; margin: 28px auto; padding: 0 20px; flex: 1; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 440px; }
h2 { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
h2::before {
  content: ""; display: inline-block; width: 4px; height: 16px; border-radius: 3px;
  background: linear-gradient(180deg, #fb923c, #ea580c); margin-right: 10px; vertical-align: -2px;
}

/* ===== Forms ===== */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 14px 0 5px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; word-break: break-all; }

button, a.primary {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 11px 20px; border: none;
  border-radius: 10px; background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; font-size: 14px;
  font-weight: 700; cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px -8px rgba(234,88,12,.7);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
button:hover, a.primary:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 10px 22px -8px rgba(234,88,12,.75); }
button:active, a.primary:active { transform: translateY(0); }
button.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
button.secondary:hover { border-color: var(--brand); color: var(--brand-2); filter: none; }
button.danger { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 6px 16px -8px rgba(220,38,38,.6); }

form.inline { margin: 0; display: flex; gap: 6px; align-items: center; }
form.inline button { margin: 0; padding: 7px 13px; font-size: 13px; }
form.inline input { margin: 0; }

/* ===== Tables ===== */
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data thead th { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; font-size: 11px; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr:last-child td { border-bottom: none; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #475569; }
.muted { color: var(--muted); font-size: 13px; }
.err { color: var(--err); font-weight: 600; background: #fef2f2; border: 1px solid #fecaca; padding: 10px 12px; border-radius: 10px; }

/* ===== Sign-in ===== */
.auth { min-height: calc(100vh - 200px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 32px 30px; box-shadow: var(--shadow); text-align: center;
}
.auth-mark {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; font-size: 28px; font-weight: 800;
  box-shadow: 0 10px 24px -8px rgba(234,88,12,.6);
}
.auth-title { font-size: 20px; font-weight: 800; margin: 0; }
.auth-sub { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }
.auth-card label { text-align: left; }
.auth-card form button { width: 100%; justify-content: center; margin-top: 22px; padding: 12px; }
.auth-card .err { text-align: left; margin-bottom: 4px; }

/* ===== Licenses: KPI strip, badges, filter tabs, payment form ===== */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi.warn b { color: #b45309; } .kpi.bad b { color: var(--err); }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; background: #fff; transition: all .15s; }
.tab:hover { border-color: var(--brand); color: var(--brand-2); }
.tab.on { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; border-color: transparent; }
.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.active { background: #dcfce7; color: #166534; }
.badge.expiring { background: #fef9c3; color: #854d0e; }
.badge.expired { background: #fee2e2; color: #991b1b; }
.badge.perpetual { background: #e0e7ff; color: #3730a3; }
td.center { text-align: center; }
form.payform { margin: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
form.payform input { margin: 0; } form.payform button { margin: 0; padding: 7px 13px; font-size: 13px; }
label.pay { display: flex; align-items: center; gap: 5px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
label.pay input { width: auto; }
