/* ===== Declaros — portal (customer app + admin) ===== */
/* Builds on assets/styles.css design tokens + .btn family. */

body.portal {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,140,255,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(63,224,198,0.06), transparent 55%),
    var(--bg);
}

.portal__bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  background: rgba(6,9,15,0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.portal__bar .container { display: flex; align-items: center; gap: 16px; width: 100%; }
.portal__spacer { flex: 1; }
.portal__who { color: var(--muted); font-size: .9rem; }
.portal__who strong { color: var(--text); font-weight: 600; }
.portal__avatar { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__name { font-weight: 600; letter-spacing: -0.01em; }
.brand__mark svg { width: 26px; height: 26px; }
.tag {
  font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 3px 9px; font-weight: 600;
}
.tag--admin { color: var(--accent-2); }

main.portal__main { padding: 38px 0 90px; }

/* ----- Auth screens ----- */
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 64px); padding: 40px 0; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 30px;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.8);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: .95rem; margin-bottom: 22px; }
.auth-tabs { display: flex; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 9px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .9rem;
  font-family: inherit; transition: background .2s var(--ease), color .2s var(--ease);
}
.auth-tabs button.is-active { background: var(--surface-2); color: var(--text); }

/* ----- Forms ----- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 11px 13px; transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(63,224,198,0.15);
}
.textarea { resize: vertical; min-height: 84px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px){ .row { grid-template-columns: 1fr; } }
.btn--block { width: 100%; }
.btn--danger { background: transparent; border-color: rgba(240,90,90,0.4); color: #ff8a8a; }
.btn--danger:hover { border-color: #ff8a8a; }

.form-note { font-size: .88rem; min-height: 1.2em; margin-top: 4px; }
.form-note.err { color: #f0b94d; }
.form-note.ok { color: var(--accent); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }

.gbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 12px 18px; border-radius: 999px; cursor: pointer;
  font-weight: 600; font-size: .95rem; font-family: inherit;
  background: #fff; color: #1f2330; border: 1px solid #fff;
  transition: transform .18s var(--ease), box-shadow .2s var(--ease);
}
.gbtn:hover { transform: translateY(-1px); box-shadow: 0 12px 30px -14px rgba(255,255,255,0.5); }
.gbtn svg { width: 18px; height: 18px; }

/* ----- Cards / panels ----- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 22px;
}
.panel + .panel { margin-top: 22px; }
.panel__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel__head h2 { font-size: 1.15rem; }
.panel__head .panel__spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px){ .grid-2 { grid-template-columns: 1fr; } }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.stat-card .n { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; }
.stat-card .l { color: var(--muted); font-size: .82rem; }

/* ----- Tables ----- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 640px; }
table.tbl th, table.tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl th { color: var(--muted-2); font-weight: 600; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: rgba(255,255,255,0.02); }
.lane { font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--accent); font-weight: 600; }

/* ----- Status badges ----- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .76rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); text-transform: capitalize;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--draft     { color: var(--muted); }
.badge--filed     { color: var(--accent-2); border-color: rgba(91,140,255,0.4); }
.badge--query     { color: #f0b94d; border-color: rgba(240,185,77,0.4); }
.badge--cleared   { color: var(--accent); border-color: rgba(63,224,198,0.4); }
.badge--cancelled { color: var(--muted-2); border-color: var(--line); }

/* ----- Tabs (admin) ----- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 12px 16px; font-weight: 600; font-size: .92rem; font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.is-active { color: var(--text); border-bottom-color: var(--accent); }
.tab-count { font-size: .72rem; color: var(--muted-2); margin-left: 6px; }

/* ----- Misc ----- */
.empty { padding: 34px; text-align: center; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn--xs { --p: 6px 12px; font-size: .8rem; }
.inline-select {
  font: inherit; font-size: .85rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px;
}
.hide { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-size: .9rem; z-index: 50;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.8); opacity: 0; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { border-color: rgba(240,185,77,0.5); color: #f0b94d; }
.back-link { color: var(--muted); font-size: .88rem; }
.back-link:hover { color: var(--accent); }
.detail-line { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.detail-line:last-child { border-bottom: 0; }
.detail-line .k { color: var(--muted); }
.history { list-style: none; padding: 0; margin: 10px 0 0; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.history li:last-child { border-bottom: 0; }
.history .when { color: var(--muted-2); font-size: .78rem; }
