/**
 * ABRASIR Control — لوحة ترخيص عبر الأثير
 * dark glass · برتقالي #f58220 · متجاوب بالكامل
 */
@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap");

:root {
  color-scheme: dark;
  --bg-0: #07080c;
  --bg-1: #0e1118;
  --glass: rgba(22, 28, 40, 0.62);
  --glass-strong: rgba(18, 24, 36, 0.88);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-soft: rgba(255, 255, 255, 0.06);
  --fg: #f5f7fb;
  --muted: rgba(245, 247, 251, 0.58);
  --muted-2: rgba(245, 247, 251, 0.38);
  --accent: #f58220;
  --accent-2: #ffb060;
  --accent-deep: #d46a12;
  --live: #3ddc84;
  --danger: #ff5c5c;
  --warn: #ffcc66;
  --line: rgba(255, 255, 255, 0.1);
  --font: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --side-w: 248px;
  --pad: clamp(0.75rem, 2.2vw, 1.15rem);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(920px 480px at 50% -14%, rgba(245, 130, 32, 0.2), transparent 56%),
    radial-gradient(620px 380px at 100% 0%, rgba(61, 220, 132, 0.06), transparent 50%),
    radial-gradient(700px 420px at 0% 90%, rgba(90, 120, 255, 0.05), transparent 52%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-0) 58%, #05060a 100%);
  background-attachment: fixed;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-2);
}

img {
  max-width: 100%;
  height: auto;
}

/* —— Glass —— */
.glass {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* —— Login —— */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--pad) + var(--safe-t)) var(--pad) calc(var(--pad) + var(--safe-b));
  position: relative;
}

.login-wrap::before {
  content: "";
  position: absolute;
  inset: 12% 8% auto;
  height: 42%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(245, 130, 32, 0.18), transparent 62%);
  filter: blur(8px);
}

.login-card {
  width: min(420px, 100%);
  padding: 1.7rem 1.45rem 1.55rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 1.05rem;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 14px 32px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.login-mark img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.login-card h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 800;
}

.sub {
  margin: 0.4rem 0 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.login-card label {
  display: block;
  text-align: right;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(245, 130, 32, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.15);
}

.btn,
button.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.72rem 1.05rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #111;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
  white-space: nowrap;
  touch-action: manipulation;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #111;
}

.btn.ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--glass-border);
}

.btn.danger {
  background: linear-gradient(135deg, #e85a3a, #c43a2a);
  color: #fff;
}

.btn.danger.ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 92, 92, 0.35);
}

.btn.block {
  width: 100%;
  margin-top: 1rem;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.err {
  margin: 0.85rem 0 0;
  color: #ffb4b4;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.25);
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.86rem;
  text-align: right;
}

/* —— Shell —— */
#app-view {
  display: none;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: var(--safe-b);
}

#app-view.is-open,
body[data-page]:not([data-page="login"]) #app-view {
  display: grid;
}

.app-top {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 40;
  margin: var(--pad) var(--pad) 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(14, 17, 24, 0.82);
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.brand-mark img {
  width: 78%;
  height: 78%;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  flex: 1;
}

.brand-copy h1 {
  margin: 0.1rem 0 0;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  font-weight: 800;
  line-height: 1.25;
}

.brand-tag {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.air-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(245, 130, 32, 0.35);
  background: rgba(245, 130, 32, 0.12);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  flex: 0 0 auto;
}

.air-pill .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.2);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.side {
  margin: 0.75rem 0 var(--pad) var(--pad);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-radius: var(--radius);
  min-height: calc(100dvh - 7rem);
  position: sticky;
  top: calc(4.6rem + var(--safe-t));
  align-self: start;
  max-height: calc(100dvh - 5.5rem);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav {
  width: 100%;
  text-align: right;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.nav:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.04);
}

.nav.is-on {
  background: rgba(245, 130, 32, 0.12);
  color: var(--accent);
  border-color: rgba(245, 130, 32, 0.35);
}

.side-foot {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--glass-border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.side-foot #admin-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  margin: 0.75rem var(--pad) var(--pad) 0;
  padding: 0;
  min-width: 0;
}

.view {
  padding: clamp(0.95rem, 2vw, 1.25rem);
  border-radius: var(--radius);
  animation: view-in 0.28s var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.view h2 {
  margin: 0;
  font-size: clamp(1.05rem, 2.4vw, 1.2rem);
  font-weight: 800;
}

.view h3 {
  margin: 1.25rem 0 0.65rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 800;
}

.view-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 52rem;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.toolbar {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  align-items: center;
  width: min(100%, 420px);
}

.toolbar .search {
  min-width: 0;
  flex: 1 1 180px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0.35rem;
}

.kpi {
  padding: 0.95rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background:
    linear-gradient(160deg, rgba(245, 130, 32, 0.08), transparent 55%),
    rgba(0, 0, 0, 0.22);
  min-width: 0;
}

.kpi b {
  display: block;
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.kpi span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  margin-top: 0.75rem;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 640px;
}

#logs-table {
  min-width: 560px;
}

#clients-table {
  min-width: 720px;
}

#pending-table,
#devices-table {
  min-width: 860px;
}

th,
td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--glass-border-soft);
  text-align: right;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 800;
  background: rgba(0, 0, 0, 0.28);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

code,
.mono {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-word;
}

.empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  margin-top: 1rem;
}

.grid-form > label {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  min-width: 0;
}

.grid-form > label > input,
.grid-form > label > select,
.grid-form > label > textarea {
  margin-top: 0.4rem;
}

.grid-form .full {
  grid-column: 1 / -1;
}

.grid-form small {
  display: block;
  font-weight: 600;
  color: var(--muted-2);
  margin-top: 0.15rem;
  line-height: 1.4;
}

fieldset.full,
.features-fieldset {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.9rem 1rem;
  background: rgba(0, 0, 0, 0.16);
  min-width: 0;
}

fieldset legend {
  padding: 0 0.35rem;
  color: var(--accent-2);
  font-weight: 800;
  font-size: 0.86rem;
}

.features-lead {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  font-weight: 600;
}

.features-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.features-box {
  display: grid;
  gap: 0.85rem;
}

.feature-group {
  border: 1px solid var(--glass-border-soft);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem 0.8rem 0.9rem;
  min-width: 0;
}

.feature-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.feature-group-head h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--accent-2);
}

.feature-group-head p {
  margin: 0.2rem 0 0;
  color: var(--muted-2);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
}

.feature-group-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.feature-group-actions .btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  border-radius: 9px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 0.5rem;
}

.features label {
  margin: 0;
  color: var(--fg);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 700;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem 0.5rem;
  align-items: start;
  cursor: pointer;
  min-width: 0;
}

.features label input {
  margin-top: 0.15rem;
  grid-row: 1 / span 2;
  accent-color: var(--accent);
}

.features label .feat-title {
  font-weight: 800;
  line-height: 1.35;
}

.features label .feat-hint {
  grid-column: 2;
  color: var(--muted-2);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--fg) !important;
  font-weight: 700 !important;
  line-height: 1.45;
}

.check input {
  width: auto;
  margin-top: 0.2rem;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.chip {
  background: rgba(0, 0, 0, 0.28);
  color: var(--fg);
  border: 1px solid var(--glass-border);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.chip:hover {
  border-color: rgba(245, 130, 32, 0.45);
  color: var(--accent-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.badge.ok {
  color: var(--live);
  border-color: rgba(61, 220, 132, 0.4);
  background: rgba(61, 220, 132, 0.08);
}

.badge.warn {
  color: var(--warn);
  border-color: rgba(255, 204, 102, 0.4);
  background: rgba(255, 204, 102, 0.08);
}

.badge.bad {
  color: var(--danger);
  border-color: rgba(255, 92, 92, 0.4);
  background: rgba(255, 92, 92, 0.08);
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.table-actions .btn {
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  border-radius: 10px;
}

.toast {
  position: fixed;
  bottom: calc(1rem + var(--safe-b));
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  max-width: min(92vw, 420px);
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  z-index: 50;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Tablet —— */
@media (max-width: 1100px) {
  :root {
    --side-w: 220px;
  }

  .brand-tag {
    display: none;
  }
}

/* —— Compact / mobile shell —— */
@media (max-width: 900px) {
  #app-view.is-open {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    padding-bottom: calc(4.75rem + var(--safe-b));
  }

  .app-top {
    margin: var(--pad) var(--pad) 0;
    padding: 0.7rem 0.8rem;
  }

  .air-pill {
    padding: 0.32rem 0.55rem;
    font-size: 0.7rem;
  }

  .side {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
    z-index: 45;
    margin: 0;
    max-height: none;
    min-height: 0;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding: 0.55rem 0.65rem calc(0.55rem + var(--safe-b));
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.45);
  }

  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.4rem;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .nav {
    width: auto;
    flex: 1 0 auto;
    text-align: center;
    padding: 0.65rem 0.75rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .side-foot {
    margin-top: 0;
    padding-top: 0.45rem;
    border-top: 1px solid var(--glass-border-soft);
  }

  .side-foot .btn {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
  }

  .main {
    margin: 0.65rem var(--pad) var(--pad);
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .toolbar {
    width: 100%;
  }

  .toolbar .btn {
    flex: 1 1 auto;
  }

  .actions .btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 0;
    white-space: normal;
    text-align: center;
  }

  .feature-group-head {
    align-items: center;
  }

  .feature-group-actions {
    width: 100%;
  }

  .feature-group-actions .btn {
    flex: 1;
  }

  .features-toolbar .btn {
    flex: 1 1 auto;
  }
}

/* —— Phone: stacked table cards —— */
@media (max-width: 640px) {
  .login-card {
    padding: 1.35rem 1.1rem 1.25rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  #logs-table,
  #clients-table,
  #pending-table,
  #devices-table {
    min-width: 0;
  }

  table thead {
    display: none;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  table tbody {
    display: grid;
    gap: 0.65rem;
  }

  table tbody tr {
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.22);
    padding: 0.55rem 0.7rem;
  }

  table tbody tr:hover td {
    background: transparent;
  }

  table td {
    border: 0;
    padding: 0.35rem 0;
    display: grid;
    grid-template-columns: minmax(5.5rem, 34%) minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
  }

  table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 800;
    font-size: 0.75rem;
  }

  table td:empty {
    display: none;
  }

  table td.table-actions,
  table td.empty {
    display: flex;
    grid-template-columns: none;
  }

  table td.table-actions::before,
  table td.empty::before {
    display: none;
  }

  table td.empty {
    justify-content: center;
    padding: 1.25rem 0.5rem;
  }

  table td.table-actions {
    padding-top: 0.55rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--glass-border-soft);
  }

  table td.table-actions .btn {
    flex: 1;
  }

  .actions .btn {
    flex: 1 1 100%;
  }

  .toast {
    border-radius: 16px;
    bottom: calc(5.4rem + var(--safe-b));
  }
}

@media (max-width: 380px) {
  .kpis {
    grid-template-columns: 1fr;
  }

  .nav {
    font-size: 0.78rem;
    padding: 0.6rem 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.callout {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  line-height: 1.5;
}

.callout.warn {
  border-color: rgba(255, 204, 102, 0.45);
  background: rgba(255, 204, 102, 0.08);
  color: var(--warn);
}

tr.row-alert td {
  background: rgba(255, 120, 100, 0.08);
}
