/* Portal Klienta — builds on the landing page's "Signal Freight" tokens and components (site.css). */

.pnl { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.pnl .site-header { margin-bottom: 0; }
/* Landing ghost buttons are links; as <button> they need the UA background cleared. */
.btn--ghost { background-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header */
.pnl-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pnl-brand__sep { width: 1px; height: 28px; background: rgba(255,255,255,0.16); }
.pnl-brand__label { font-size: 13px; letter-spacing: 0.04em; color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-menu { display: flex; align-items: center; gap: 32px; }
.pnl-nav { display: flex; align-items: center; gap: 24px; }
.pnl-nav__link { color: #C9CFDB; font-size: 15px; font-weight: 500; padding: 10px 2px; border-bottom: 2px solid transparent; }
.pnl-nav__link:hover { color: var(--white); border-bottom-color: rgba(255,176,32,0.5); }
.pnl-nav__link[aria-current="page"] { color: var(--white); border-bottom-color: var(--amber); }
.pnl-user { display: flex; align-items: center; gap: 16px; padding-left: 24px; border-left: 1px solid rgba(255,255,255,0.12); }
.pnl-user__who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; color: var(--white); }
.pnl-user__who:hover { color: var(--amber-hover); }
.pnl-user__name { font-size: 14px; font-weight: 600; }
.pnl-user__org { font-size: 12px; color: var(--steel-2); }
.pnl-user form { margin: 0; }
@media (max-width: 900px) {
  .pnl-menu {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 16px; padding: 8px var(--gutter) 24px;
    background: var(--ink); border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .pnl-menu.is-open { display: flex; }
  .pnl-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .pnl-nav__link { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .pnl-nav__link[aria-current="page"] { border-bottom-color: rgba(255,255,255,0.06); color: var(--amber); }
  .pnl-user { padding-left: 0; border-left: 0; justify-content: space-between; }
  .pnl-user__who { align-items: flex-start; }
}

/* Main area */
.pnl-main { flex: 1; }
.pnl-main > .container { padding-top: 48px; padding-bottom: 72px; }
.pnl-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; padding-bottom: 8px; }
.pnl-head .h3 { color: var(--ink); }
.pnl-head__lead { max-width: 640px; font-size: 16px; line-height: 1.6; color: var(--slate); }
.pnl-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page__back { align-self: flex-start; }

.pnl-foot { background: var(--ink-deep); color: var(--steel-2); font-size: 13px; border-top: 1px solid rgba(255,255,255,0.06); }
.pnl-foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; }
.pnl-foot strong { color: var(--steel); font-weight: 600; }
.pnl-foot a { color: var(--steel); text-decoration: underline; text-underline-offset: 2px; }
.pnl-foot a:hover { color: var(--white); }

/* Cards & layout */
.card { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 28px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--card-line); }
.card--flush { padding: 0; gap: 0; overflow: hidden; }
.card--flush > .card__head { padding: 22px 24px 18px; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.card__aside { display: flex; align-items: center; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; align-items: start; }
@media (min-width: 1100px) { .grid-2--wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); } }
@media (max-width: 600px) { .card { padding: 22px 18px; } .card--flush { padding: 0; } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 16px; }
@media (max-width: 480px) { .stat { padding: 18px; } .stat__value { font-size: 30px; } }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--white); border: 1px solid var(--card-line); border-top: 3px solid var(--ink); }
.stat--ok { border-top-color: #0F9F8C; }
.stat--warn { border-top-color: var(--amber); }
.stat--error { border-top-color: #B42318; }
.stat__label { font-size: 12px; letter-spacing: 0.06em; color: #5A6273; }
.stat__value { font-family: var(--font-display); font-weight: 700; font-size: 36px; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.stat__hint { font-size: 13px; color: var(--slate-2); }

/* Badges & notices */
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 500; letter-spacing: 0.03em; white-space: nowrap; }
.badge--ok { background: #E3F5F1; color: #0F6B5E; }
.badge--warn { background: #FFF4DC; color: #7A4D00; }
.badge--error { background: #FDE8E7; color: #B42318; }
.badge--info { background: #E6EEFB; color: #1D4F91; }
.badge--neutral { background: #ECEDE8; color: var(--slate); }
.notice { padding: 14px 18px; border-radius: var(--radius); font-size: 15px; line-height: 1.5; border: 1px solid transparent; }
.notice--ok { background: #E3F5F1; color: #0F6B5E; border-color: #BFE6DE; }
.notice--warn { background: #FFF4DC; color: #5E3D00; border-color: #F2D49B; }
.notice--error { background: #FDE8E7; color: #8F1B12; border-color: #F5C2BE; }
.notice--info { background: #E6EEFB; color: #1D4F91; border-color: #C6D7F2; }
.empty { padding: 28px 24px; color: var(--slate-2); font-size: 15px; }
.card:not(.card--flush) .empty { padding: 4px 0; }
.empty a { color: var(--ink); text-decoration: underline; }
.muted-dark { font-size: 14px; color: var(--slate-2); }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 16px; text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: #5A6273; background: #FAFAF8; border-top: 1px solid var(--card-line); border-bottom: 1px solid var(--card-line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid #ECEDE8; color: #2A3140; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFAF8; }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 24px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.mono { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }
.table a { color: var(--ink); }
.table a:hover { text-decoration: underline; }
@media (max-width: 700px) { .table .wide { display: none; } }

/* Filters & pager */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; padding: 20px 24px; }
.field select {
  min-height: 44px; min-width: 180px; padding: 0 36px 0 12px; border-radius: var(--radius); border: 1px solid var(--field-line);
  font: inherit; font-size: 15px; color: var(--ink); background: #FAFAF8; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230A0F1A' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.field select:focus { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--ink); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--card-line); font-size: 14px; color: var(--slate); }

/* Definition list, timeline, code */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; font-size: 15px; }
.dl dt { color: #5A6273; }
.dl dd { margin: 0; color: var(--ink); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.dl a { color: var(--ink); text-decoration: underline; }
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0 0 20px 24px; border-left: 2px solid var(--card-line); margin-left: 6px; }
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid #B42318; }
.timeline li.is-ok::before { border-color: #0F9F8C; background: #0F9F8C; }
.timeline span { font-size: 12px; color: #5A6273; }
.timeline p { font-size: 15px; color: #2A3140; }
.code { margin: 0; padding: 18px; border-radius: var(--radius); background: var(--ink); color: #DCE1EA; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; overflow-x: auto; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #0F6B5E; }

/* Splash (login, errors) */
.pnl--splash { background: var(--ink); }
.splash { flex: 1; display: flex; align-items: center; }
.splash > .container { padding-top: 64px; padding-bottom: 96px; }
.splash__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; align-items: center; }
@media (min-width: 1024px) { .splash__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 80px; } }
.splash__copy { max-width: 620px; }
.login { flex: none; width: 100%; max-width: 480px; justify-self: end; box-shadow: 0 40px 80px -30px rgba(0,0,0,0.7); }
.login .btn { width: 100%; }
.login__note { display: flex; gap: 12px; padding-top: 20px; border-top: 1px solid var(--card-line); font-size: 14px; line-height: 1.55; color: #2A3140; }
.login__note svg { flex: none; margin-top: 2px; color: var(--amber-text); }
.login__note a { color: var(--ink); text-decoration: underline; }
@media (max-width: 1023px) { .login { justify-self: stretch; max-width: none; } }
