/*!
 * aqs-design.css — Wspólny system wizualny Aikwarium (K2b)
 * Źródło projektu: aquasmart-mockup-v2.html (kanon zatwierdzony przez PM).
 * Zasady produkcyjne:
 *   1) Wszystko działa TYLKO wewnątrz kontenera .aqs-ui (opt-in, brak wycieku na motyw/wp-admin).
 *   2) Brak globalnych resetów (*, html, body) — nie walczymy ze stylami WordPressa.
 *   3) Namespace klas: aqs-. Fonty systemowe (bez zależności zewnętrznych).
 * Wersja: 1.0.0
 */

/* ---------- TOKENY (na kontenerze, nie na :root — zero globalnego śladu) ---------- */
.aqs-ui {
  --c-abyss:   #071b2a;
  --c-depth:   #0b2a3d;
  --c-deep-2:  #103b54;
  --c-water:   #0e8fb3;
  --c-cyan:    #38c5dd;
  --c-cyan-soft:#d9f6fb;
  --c-algae:   #1f9a73;
  --c-algae-2: #0f6b51;
  --c-surface: #edf8fb;
  --c-surface-2:#f7fbfc;
  --c-sand:    #f3f0e8;
  --c-foam:    #ffffff;
  --c-slate:   #4c6472;
  --c-muted:   #718693;
  --c-warn:    #d97706;
  --c-danger:  #b42318;
  --c-border:  #c8dde7;
  --c-border-2:#e3eef3;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow-card: 0 14px 34px rgba(7,27,42,.09), 0 2px 8px rgba(7,27,42,.05);
  --shadow-card-soft: 0 8px 22px rgba(7,27,42,.07);
  --shadow-nav: 0 8px 26px rgba(7,27,42,.22);
  --aqs-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --aqs-font-mono: "SF Mono", "Fira Code", Consolas, "Liberation Mono", monospace;

  font-family: var(--aqs-font);
  color: var(--c-depth);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -.005em;
}

/* Box-sizing tylko w obrębie systemu (bezpieczne dla WP) */
.aqs-ui, .aqs-ui *, .aqs-ui *::before, .aqs-ui *::after { box-sizing: border-box; }

/* ---------- PAGE HEADER ---------- */
.aqs-ui .aqs-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 26px; flex-wrap: wrap; gap: 14px;
}
.aqs-ui .aqs-page-header__title {
  font-size: 26px; font-weight: 820; color: var(--c-depth);
  line-height: 1.16; letter-spacing: -.04em;
}
.aqs-ui .aqs-page-header__sub { font-size: 13px; color: var(--c-slate); margin-top: 6px; }

/* ---------- BADGE (kategorie) ---------- */
.aqs-ui .aqs-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .25px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.aqs-ui .aqs-badge--biotop { background: #dbeafe; color: #1e40af; }
.aqs-ui .aqs-badge--flora  { background: #d1fae5; color: #065f46; }
.aqs-ui .aqs-badge--fauna  { background: #fef3c7; color: #92400e; }
.aqs-ui .aqs-badge--equip  { background: #ede9fe; color: #5b21b6; }

/* ---------- TABS ---------- */
.aqs-ui .aqs-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--c-border);
  margin-bottom: 24px; overflow-x: auto; padding-bottom: 2px;
}
.aqs-ui .aqs-tab {
  position: relative; padding: 12px 18px; font-size: 13px; font-weight: 750;
  color: var(--c-slate); cursor: pointer; border: none; border-radius: 12px 12px 0 0;
  white-space: nowrap; background: transparent; font-family: var(--aqs-font);
  transition: color .15s, background .15s;
}
.aqs-ui .aqs-tab:hover { color: var(--c-water); background: rgba(14,143,179,.06); }
.aqs-ui .aqs-tab.is-active { color: var(--c-water); background: #fff; }
.aqs-ui .aqs-tab.is-active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: -3px;
  height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--c-water), var(--c-cyan));
}

/* ---------- CARD ---------- */
.aqs-ui .aqs-card {
  background: rgba(255,255,255,.88); border: 1px solid rgba(200,221,231,.72);
  border-radius: var(--r-xl); box-shadow: var(--shadow-card);
  padding: 22px 26px; margin-bottom: 22px; backdrop-filter: blur(8px);
}
.aqs-ui .aqs-card__title {
  font-size: 12px; font-weight: 850; text-transform: uppercase;
  letter-spacing: .9px; color: var(--c-slate); margin-bottom: 16px;
}

/* ---------- ASSISTANT BOX (spina się z K2a) ---------- */
.aqs-ui .aqs-assistant {
  position: relative; border-radius: 18px; padding: 18px 22px 18px 58px;
  margin-bottom: 22px; border: 1px solid; box-shadow: var(--shadow-card-soft);
}
.aqs-ui .aqs-assistant::before {
  content: "✦"; position: absolute; left: 18px; top: 18px; width: 28px; height: 28px;
  border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: #fff;
}
.aqs-ui .aqs-assistant--green  { background: linear-gradient(135deg, #ecfdf5, #f7fffb); border-color: rgba(31,154,115,.36); color: #124734; }
.aqs-ui .aqs-assistant--green::before { background: linear-gradient(135deg, #1f9a73, #29c091); }
.aqs-ui .aqs-assistant--orange { background: linear-gradient(135deg, #fff7ed, #fffcf5); border-color: rgba(217,119,6,.34); color: #78350f; }
.aqs-ui .aqs-assistant--orange::before { background: linear-gradient(135deg, #d97706, #f59e0b); }
.aqs-ui .aqs-assistant--red    { background: linear-gradient(135deg, #fef2f2, #fffafa); border-color: rgba(180,35,24,.32); color: #7f1d1d; }
.aqs-ui .aqs-assistant--red::before { background: linear-gradient(135deg, #b42318, #ef4444); }
.aqs-ui .aqs-assistant__label { font-size: 11px; font-weight: 850; letter-spacing: .9px; text-transform: uppercase; opacity: .72; margin-bottom: 7px; }
.aqs-ui .aqs-assistant__text  { font-size: 14px; line-height: 1.65; }

/* ---------- DATA TABLE ---------- */
.aqs-ui .aqs-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.aqs-ui .aqs-table th {
  text-align: left; padding: 11px 14px; font-size: 11px; font-weight: 850;
  letter-spacing: .65px; text-transform: uppercase; color: var(--c-slate);
  border-bottom: 1px solid var(--c-border); background: linear-gradient(180deg, #edf8fb, #e7f2f7);
}
.aqs-ui .aqs-table th:first-child { border-top-left-radius: 12px; }
.aqs-ui .aqs-table th:last-child { border-top-right-radius: 12px; }
.aqs-ui .aqs-table td { padding: 12px 14px; border-bottom: 1px solid var(--c-border-2); color: var(--c-depth); vertical-align: middle; }
.aqs-ui .aqs-table tbody tr:nth-child(even) td { background: rgba(237,248,251,.46); }
.aqs-ui .aqs-table tbody tr:hover td { background: rgba(56,197,221,.10); }
.aqs-ui .aqs-table tr:last-child td { border-bottom: none; }
.aqs-ui .aqs-table td.aqs-num { font-family: var(--aqs-font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.aqs-ui .aqs-val-ok   { color: #087b5d; font-weight: 800; }
.aqs-ui .aqs-val-warn { color: var(--c-warn); font-weight: 800; }
.aqs-ui .aqs-val-bad  { color: var(--c-danger); font-weight: 800; }

/* ---------- BUTTONS ---------- */
.aqs-ui .aqs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 11px; font-size: 13px; font-weight: 650;
  cursor: pointer; border: 1px solid transparent; font-family: var(--aqs-font);
  transition: box-shadow .18s, transform .12s, background .18s, border-color .18s, color .18s;
  text-decoration: none; white-space: nowrap;
}
.aqs-ui .aqs-btn:hover { transform: translateY(-1px); }
.aqs-ui .aqs-btn:active { transform: translateY(0) scale(.98); }
.aqs-ui .aqs-btn--primary { background: linear-gradient(135deg, var(--c-water), var(--c-cyan)); color: #fff; box-shadow: 0 10px 20px rgba(14,143,179,.22); }
.aqs-ui .aqs-btn--primary:hover { box-shadow: 0 14px 26px rgba(14,143,179,.30); }
.aqs-ui .aqs-btn--secondary { background: #fff; color: var(--c-water); border-color: var(--c-border); }
.aqs-ui .aqs-btn--secondary:hover { background: var(--c-cyan-soft); border-color: rgba(14,143,179,.36); }
.aqs-ui .aqs-btn--danger { background: #fff6f6; color: var(--c-danger); border-color: #f3b8b8; }
.aqs-ui .aqs-btn--danger:hover { background: #fee2e2; }
.aqs-ui .aqs-btn--sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }

/* ---------- FORM ---------- */
.aqs-ui .aqs-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.aqs-ui .aqs-field { display: flex; flex-direction: column; gap: 6px; }
.aqs-ui .aqs-field > label { font-size: 12px; font-weight: 800; color: var(--c-slate); }
.aqs-ui .aqs-field input,
.aqs-ui .aqs-field select,
.aqs-ui .aqs-field textarea {
  padding: 11px 13px; border: 1.5px solid var(--c-border); border-radius: 11px;
  font-size: 14px; font-family: var(--aqs-font); color: var(--c-depth);
  background: #fff; outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
}
.aqs-ui .aqs-field input:focus,
.aqs-ui .aqs-field select:focus,
.aqs-ui .aqs-field textarea:focus { border-color: var(--c-water); box-shadow: 0 0 0 4px rgba(14,143,179,.12); }
.aqs-ui .aqs-hint { font-size: 11px; color: var(--c-muted); }

/* ---------- REDFIELD (kalkulator N:P) ---------- */
.aqs-ui .aqs-redfield {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 36px;
  text-align: center;
}
.aqs-ui .aqs-redfield .aqs-card__title { margin-bottom: 10px; text-align: center; }
.aqs-ui .aqs-redfield__intro { font-size: 13px; color: var(--c-slate); margin: 0 auto 4px; line-height: 1.55; max-width: 480px; text-align: center; }
.aqs-ui .aqs-redfield__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
  align-items: end;
  margin-top: 22px;
}
.aqs-ui .aqs-redfield__form .aqs-field { min-width: 0; text-align: center; }
.aqs-ui .aqs-redfield__form .aqs-field label { margin-bottom: 2px; text-align: center; }
.aqs-ui .aqs-redfield__form .aqs-field input { padding: 12px 14px; text-align: center; }
/* przycisk w osobnym wierszu pełnej szerokości pod polami */
.aqs-ui .aqs-redfield__actions { grid-column: 1 / -1; margin-top: 6px; text-align: center; }
.aqs-ui .aqs-redfield__actions .aqs-btn { width: auto; padding: 11px 30px; font-size: 14px; }
/* pole wyniku wyśrodkowane — assistant box bez ikony z boku w tym kontekście */
.aqs-ui .aqs-redfield #aqs-rf-result { margin-top: 22px; margin-bottom: 0; padding-left: 22px; text-align: center; }
.aqs-ui .aqs-redfield #aqs-rf-result::before { display: none; }
.aqs-ui .aqs-redfield #aqs-rf-result .aqs-assistant__label { text-align: center; }
.aqs-ui .aqs-redfield #aqs-rf-result .aqs-assistant__text { text-align: center; }
@media (max-width: 560px) {
  .aqs-ui .aqs-redfield { padding: 24px 22px; }
  .aqs-ui .aqs-redfield__form { grid-template-columns: 1fr; }
}
.aqs-ui .aqs-scale {
  position: relative; display: flex; border-radius: 999px; overflow: visible;
  margin: 34px 0 12px; height: 18px;
  box-shadow: inset 0 0 0 1px rgba(7,27,42,.12), 0 8px 18px rgba(7,27,42,.10);
}
.aqs-ui .aqs-scale__seg { flex: 1; height: 100%; }
.aqs-ui .aqs-scale__seg:first-child { border-radius: 999px 0 0 999px; }
.aqs-ui .aqs-scale__seg:last-child { border-radius: 0 999px 999px 0; }
.aqs-ui .aqs-scale__seg--red1 { background: linear-gradient(90deg, #dc2626, #ef4444); }
.aqs-ui .aqs-scale__seg--ora1 { background: linear-gradient(90deg, #f97316, #f59e0b); }
.aqs-ui .aqs-scale__seg--grn  { background: linear-gradient(90deg, #1f9a73, #36c08f); flex: 2; }
.aqs-ui .aqs-scale__seg--ora2 { background: linear-gradient(90deg, #f59e0b, #f97316); }
.aqs-ui .aqs-scale__seg--red2 { background: linear-gradient(90deg, #ef4444, #dc2626); }
.aqs-ui .aqs-scale-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--c-muted); font-family: var(--aqs-font-mono); }
.aqs-ui .aqs-rr {
  background: rgba(255,255,255,.92); border: 1px solid rgba(200,221,231,.72);
  border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow-card); margin-top: 22px;
}
.aqs-ui .aqs-rr__number { font-size: 54px; font-weight: 900; color: var(--c-algae); line-height: .95; font-family: var(--aqs-font-mono); letter-spacing: -3px; }
.aqs-ui .aqs-rr__label { font-size: 13px; color: var(--c-muted); margin-top: 6px; }
.aqs-ui .aqs-rr__ratio { font-size: 21px; font-weight: 850; color: var(--c-water); margin-top: 12px; }

/* ---------- LINK BADGES (ikony sklepowe) ---------- */
.aqs-ui .aqs-link-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 850;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(255,255,255,.55);
}
.aqs-ui .aqs-link-badge--external { background: #dbeafe; color: #1d4ed8; }
.aqs-ui .aqs-link-badge--internal { background: #d1fae5; color: #047857; }

/* ---------- LEGEND ---------- */
.aqs-ui .aqs-legend {
  display: flex; gap: 16px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(237,248,251,.88));
  border-radius: 16px; margin-bottom: 22px; flex-wrap: wrap;
  border: 1px solid var(--c-border); box-shadow: var(--shadow-card-soft);
}
.aqs-ui .aqs-legend__item {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--c-slate);
  padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.64);
}

/* ---------- RECORD ID ---------- */
.aqs-ui .aqs-record-id {
  font-family: var(--aqs-font-mono); font-size: 11px; background: var(--c-cyan-soft);
  padding: 3px 7px; border-radius: 7px; color: #0b6983; font-weight: 800;
}
.aqs-ui small { color: var(--c-muted); }

/* ---------- DIVIDER ---------- */
.aqs-ui .aqs-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--c-border), transparent); margin: 22px 0; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .aqs-ui .aqs-form-row { grid-template-columns: 1fr; }
  .aqs-ui .aqs-page-header { flex-direction: column; }
}

/* ---------- DOSTĘPNOŚĆ ---------- */
@media (prefers-reduced-motion: reduce) {
  .aqs-ui * { transition: none !important; }
}
.aqs-ui .aqs-btn:focus-visible,
.aqs-ui .aqs-tab:focus-visible,
.aqs-ui .aqs-field input:focus-visible,
.aqs-ui .aqs-field select:focus-visible,
.aqs-ui .aqs-field textarea:focus-visible {
  outline: 2px solid var(--c-cyan); outline-offset: 2px;
}

/* ============================================================
   PORTAL SHELL — [aqs_portal_menu] (@since 1.1.0)
   Kafelki wyboru modułów. Wszystko w kontenerze .aqs-ui.
   ============================================================ */
.aqs-ui.aqs-portal { max-width: 880px; margin: 0 auto; padding: 4px 0 8px; }

.aqs-ui .aqs-portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.aqs-ui .aqs-portal-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 22px;
  background: var(--c-foam);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card-soft);
  text-decoration: none;
  color: var(--c-depth);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.aqs-ui .aqs-portal-tile:hover,
.aqs-ui .aqs-portal-tile:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: var(--c-water);
  outline: none;
}
.aqs-ui .aqs-portal-tile__icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 4px;
}
.aqs-ui .aqs-portal-tile__label {
  font-size: 16px;
  font-weight: 650;
  color: var(--c-deep-2);
  letter-spacing: -.01em;
}
.aqs-ui .aqs-portal-tile__desc {
  font-size: 13px;
  color: var(--c-slate);
  line-height: 1.45;
}

/* Widok gościa */
.aqs-ui .aqs-portal-guest { margin-top: 20px; }
.aqs-ui .aqs-portal-btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--r-md);
  font-weight: 600;
  text-decoration: none;
  transition: background .16s ease, box-shadow .16s ease;
}
.aqs-ui .aqs-portal-btn--primary {
  background: var(--c-water);
  color: var(--c-foam);
  box-shadow: var(--shadow-card-soft);
}
.aqs-ui .aqs-portal-btn--primary:hover { background: var(--c-deep-2); }
.aqs-ui .aqs-portal-guest__hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--c-muted);
}
.aqs-ui .aqs-portal-guest__hint a { color: var(--c-water); text-decoration: none; font-weight: 600; }
.aqs-ui .aqs-portal-guest__hint a:hover { text-decoration: underline; }
