/* Catálogos ---------------------------------------------------------------- */

/* Fuente Poppins incluida (SIL Open Font License) */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/poppins-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/poppins-latin-700-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  /* Colores de la marca (logo Jim Solutions) */
  --navy: #051630;
  --cyan: #04c8ff;
  --blue: #1e6bff;
  --violet: #8554ff;
  --grad: linear-gradient(120deg, #0fb4ff 0%, #2563ff 48%, #7b52ff 100%);
  --grad-soft: linear-gradient(120deg, rgba(15, 180, 255, .16), rgba(37, 99, 255, .16) 50%, rgba(123, 82, 255, .16));
  --accent: #3b82ff;
  --accent-text: #6fb2ff;
  --glow: 0 8px 24px -8px rgba(37, 99, 255, .7);

  --bg: #050e1c;
  --card: #0a172b;
  --card-2: #0e1e37;
  --input: #071326;
  --hover: #122746;
  --border: #172a47;
  --border-strong: #22395f;
  --text: #eaf1ff;
  --muted: #93a5c4;
  --faint: #5e7194;
  --primary-bg: #2563ff;
  --primary-fg: #ffffff;
  --green: #34d399;
  --amber: #f5b84a;
  --red: #f26b6b;
  --ring: rgba(59, 130, 255, .32);
  --overlay: rgba(2, 8, 20, .72);
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
  --page-glow: radial-gradient(900px 520px at 8% -12%, rgba(30, 107, 255, .20), transparent 62%),
               radial-gradient(760px 460px at 96% -8%, rgba(133, 84, 255, .16), transparent 60%),
               radial-gradient(700px 400px at 50% 110%, rgba(4, 200, 255, .06), transparent 60%);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --accent: #1e6bff;
  --accent-text: #1b5fe6;
  --glow: 0 8px 22px -10px rgba(37, 99, 255, .65);
  --bg: #f2f6fd;
  --card: #ffffff;
  --card-2: #f6f9ff;
  --input: #ffffff;
  --hover: #ebf1fd;
  --border: #dde6f4;
  --border-strong: #c9d6ec;
  --text: #051630;
  --muted: #52658a;
  --faint: #8a9bba;
  --green: #12a36a;
  --amber: #b97a12;
  --red: #d64545;
  --ring: rgba(30, 107, 255, .2);
  --overlay: rgba(5, 22, 48, .35);
  --shadow: 0 18px 50px rgba(5, 22, 48, .14);
  --page-glow: radial-gradient(900px 520px at 8% -12%, rgba(30, 107, 255, .12), transparent 62%),
               radial-gradient(760px 460px at 96% -8%, rgba(133, 84, 255, .10), transparent 60%);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--page-glow), var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: rgba(37, 99, 255, .45); color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.container { max-width: 1340px; margin: 0 auto; padding: 0 28px; }

/* ---- Topbar ---------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 86px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo { display: inline-flex; align-items: flex-start; font-weight: 700; letter-spacing: .14em; font-size: 20px; line-height: 1; }
.logo sup { font-size: 8px; letter-spacing: .08em; font-weight: 600; margin-left: 3px; margin-top: -2px; }
.brand .app { color: var(--muted); font-size: 16px; border-left: 1px solid var(--border-strong); padding-left: 14px; line-height: 26px; }
.brand-logo { display: inline-flex; }
.brand-logo img { height: 46px; width: auto; display: block; }
.logo-on-light { display: none !important; }
[data-theme="light"] .logo-on-dark { display: none !important; }
[data-theme="light"] .logo-on-light { display: block !important; }
.auth .brand-logo img { height: 60px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--border-strong); border-radius: 999px; background: transparent; cursor: pointer; }
.user-chip:hover { background: var(--hover); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-size: 12px; font-weight: 600; }
.user-chip .i { color: var(--muted); width: 14px; height: 14px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); background: transparent; cursor: pointer; }
.icon-btn:hover { background: var(--hover); }

/* ---- Botones -------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--card-2); cursor: pointer; text-decoration: none; white-space: nowrap; font-size: 14.5px; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; border: 0; font-weight: 500; box-shadow: var(--glow); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.1); }
.btn-primary:disabled { box-shadow: none; filter: saturate(.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--hover); }
.btn-danger { color: var(--red); }
.btn-danger.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Formularios ---------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 14.5px; color: var(--text); }
.field small { color: var(--faint); font-size: 12.5px; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--input); outline: none; transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 90px; padding: 10px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238da1c4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.select option { background: var(--card); color: var(--text); }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 92px; }
.input-suffix em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--faint); font-size: 14px; pointer-events: none; }
.input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.input[type=number]::-webkit-inner-spin-button, .input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; color: var(--text); }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; transition: background .15s, border-color .15s; }
.check input:checked + .box { background: var(--grad); border-color: transparent; }
.check input:checked + .box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--primary-fg); border-bottom: 2px solid var(--primary-fg); transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible + .box { box-shadow: 0 0 0 3px var(--ring); }
.form-error { color: var(--red); font-size: 13.5px; min-height: 1em; }

/* ---- Tarjetas y página --------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.page-head { margin: 18px 0 24px; }
.page-head h1 { font-size: 32px; font-weight: 500; letter-spacing: -.01em; margin: 0; }
.page-head h1 .count, .products-head h2 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 400; margin-left: 4px; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.summary { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.summary span { display: inline-flex; align-items: center; gap: 7px; }

.create { padding: 22px 16px 22px; margin-bottom: 32px; }
.create-grid { display: grid; grid-template-columns: minmax(200px, 1.4fr) minmax(150px, .85fr) minmax(190px, 1fr) auto minmax(180px, 1fr); gap: 14px; align-items: end; }
.create .f-multi { height: 42px; }
.create-foot { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.created-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 14px; animation: fadein .25s ease; }
.created-link code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text); background: var(--card-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.created-link .ok { color: var(--green); display: inline-flex; align-items: center; gap: 6px; }

/* ---- Barra de filtros ---------------------------------------------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid var(--border-strong); border-radius: 12px; }
.tab { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--grad-soft); border-color: rgba(59, 130, 255, .45); color: var(--text); }
.tab .n { font-size: 12px; color: var(--faint); }
.toolbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar-right .select { width: auto; min-width: 170px; height: 40px; font-weight: 400; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 36px; height: 40px; width: 260px; }

/* ---- Lista de sesiones ---------------------------------------------- */
.list { overflow: hidden; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 16px; border-top: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--card-2); box-shadow: inset 3px 0 0 var(--accent); }
.row-main { min-width: 0; flex: 1; }
.row-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-title .name { font-weight: 600; font-size: 16px; }
.row-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.row-meta b { color: var(--text); font-weight: 500; }
.row-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.row-actions .select { width: 208px; height: 40px; }
.row-actions .who { color: var(--muted); font-size: 14px; padding: 0 6px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chev { color: var(--faint); margin-left: 2px; }
.progress { height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 10px; max-width: 280px; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .3s; }
.progress.done span { background: linear-gradient(90deg, var(--green), #2dd4bf); }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty .i { width: 28px; height: 28px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-weight: 500; font-size: 16px; margin-bottom: 4px; }

/* ---- Badges ---------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; color: var(--text); white-space: nowrap; }
.badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge.st-enviado i { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.badge.st-borrador i { background: var(--amber); }
.badge.st-sin_iniciar { color: var(--muted); }
.badge.st-sin_iniciar i { background: transparent; border: 1.5px solid var(--faint); width: 7px; height: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---- Detalle de sesión --------------------------------------------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-top: 8px; font-size: 14.5px; }
.back:hover { color: var(--accent-text); }
.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin: 14px 0 22px; flex-wrap: wrap; }
.detail-head h1 { font-size: 30px; font-weight: 500; margin: 0; letter-spacing: -.01em; }
.title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-head .meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 280px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 30; display: none; }
.menu.open { display: block; animation: pop .14s ease; }
.menu a, .menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: 8px; background: none; border: 0; text-align: left; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .t { display: block; font-weight: 500; }
.menu .d { display: block; color: var(--muted); font-size: 13px; }
.menu .i { margin-top: 3px; }

.stats { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.6fr; gap: 14px; margin-bottom: 18px; }
.stat { padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 13.5px; }
.stat .v { font-size: 26px; font-weight: 500; margin-top: 2px; }
.stat .v small { font-size: 15px; color: var(--faint); font-weight: 400; }
.stat .num { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .progress { max-width: none; }
.contact dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: 14px; }
.contact dt { color: var(--muted); }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.contact dd a, .created-link a.btn-ghost:hover { color: var(--accent-text); }
.notes { padding: 14px 18px; margin-bottom: 18px; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
.notes b { color: var(--text); font-weight: 500; }

.products-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 16px 12px; flex-wrap: wrap; }
.products-head h2 { margin: 0; font-size: 19px; font-weight: 500; }

.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font-weight: 400; color: var(--faint); font-size: 13px; padding: 8px 16px; border-top: 1px solid var(--border); white-space: nowrap; }
.ptable td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; font-size: 14.5px; }
.ptable tbody tr { cursor: pointer; transition: background .12s; }
.ptable tbody tr:hover { background: var(--card-2); }
.ptable .num { color: var(--faint); width: 40px; }
.ptable .right { text-align: right; }
.pcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--card-2); border: 1px solid var(--border); flex: none; display: grid; place-items: center; color: var(--faint); }
.pname { font-weight: 500; }
.psku { color: var(--faint); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text); white-space: nowrap; }
.price-old { color: var(--faint); text-decoration: line-through; font-size: 13px; display: block; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.warn { color: var(--amber); }
.incomplete { color: var(--amber); font-size: 13px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.incomplete .i { width: 14px; height: 14px; }

/* ---- Modal & panel lateral ----------------------------------------- */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadein .15s ease; backdrop-filter: blur(2px); }
.modal { width: 100%; max-width: 460px; background: var(--card); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; animation: pop .18s ease; max-height: calc(100vh - 40px); overflow: auto; }
.modal h3 { margin: 0 0 4px; font-size: 20px; font-weight: 500; }
.modal p.lead { margin: 0 0 18px; color: var(--muted); font-size: 14.5px; }
.modal form { display: flex; flex-direction: column; gap: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer { width: 100%; max-width: 620px; height: 100%; background: var(--card); border-left: 1px solid var(--border-strong); box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slidein .2s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.drawer-head .pos { color: var(--muted); font-size: 14px; }
.drawer-head .nav { display: flex; gap: 6px; }
.drawer-body { padding: 20px 22px 30px; overflow: auto; flex: 1; }
.gallery .main { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; border: 1px solid var(--border); background: var(--card-2); object-fit: contain; display: block; }
.gallery .noimg { width: 100%; aspect-ratio: 16 / 7; border-radius: 12px; border: 1px dashed var(--border-strong); display: grid; place-items: center; color: var(--faint); text-align: center; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.gallery .thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; }
.gallery .thumbs button.active { border-color: var(--accent); }
.gallery .thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; display: block; }
.gallery .thumbs a { margin-left: auto; font-size: 13.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.gallery .thumbs a:hover { color: var(--text); }
.p-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin: 20px 0 14px; }
.p-title h2 { margin: 0; font-size: 23px; font-weight: 500; line-height: 1.25; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.fact { background: var(--card); padding: 12px 14px; min-width: 0; }
.fact .k { color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; align-items: center; min-height: 22px; }
.fact .v { margin-top: 2px; font-size: 15.5px; overflow-wrap: anywhere; }
.fact.wide { grid-column: 1 / -1; }
.block { margin-top: 18px; }
.block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.block-head .k { color: var(--muted); font-size: 13.5px; }
.block .txt { white-space: pre-wrap; background: var(--card-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; overflow-wrap: anywhere; }
.copy-mini { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 2px 4px; border-radius: 6px; color: var(--faint); cursor: pointer; font-size: 12.5px; }
.copy-mini:hover { color: var(--text); background: var(--hover); }
.copy-mini .i { width: 13px; height: 13px; }
.stamp { margin-top: 22px; color: var(--faint); font-size: 13px; }

/* ---- Pantallas de acceso ------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth .card { width: 100%; max-width: 400px; padding: 30px 28px; }
.auth .logo { font-size: 24px; }
.auth h1 { font-size: 22px; font-weight: 500; margin: 22px 0 4px; }
.auth p { color: var(--muted); margin: 0 0 20px; font-size: 14.5px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .btn-primary { height: 44px; margin-top: 4px; }

/* ---- Toast ---------------------------------------------------------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--grad); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14.5px; display: inline-flex; gap: 8px; align-items: center; animation: toastin .2s ease; }
.toast.error { background: var(--red); color: #fff; }

.loading { display: grid; place-items: center; min-height: 50vh; color: var(--faint); }
.spinner { width: 22px; height: 22px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 1100px) {
  .create-grid { grid-template-columns: 1fr 1fr 1fr; }
  .create .f-multi { grid-column: span 2; order: 6; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .container { padding: 0 16px; }
  .topbar { height: auto; padding: 18px 0; flex-wrap: wrap; }
  .top-actions .label { display: none; }
  .brand-logo img { height: 38px; }
  .brand .app { font-size: 14.5px; padding-left: 10px; }
  .create-grid { grid-template-columns: 1fr 1fr; }
  .create .f-name { grid-column: 1 / -1; }
  .row { flex-direction: column; align-items: stretch; gap: 12px; }
  .row-actions { flex-wrap: nowrap; }
  .row-actions .select { flex: 1 1 0; min-width: 0; width: auto; }
  .tabs { width: 100%; }
  .tab { flex: 1 1 auto; justify-content: center; white-space: nowrap; padding: 0 6px; font-size: 13px; }
  .tabs { gap: 0; }
  .row .chev { display: none; }
  .row-actions .btn-ghost .lbl { display: none; }
  .search .input { width: 100%; }
  .toolbar-right, .search { width: 100%; }
  .toolbar-right .select { flex: 1; }
  .ptable thead { display: none; }
  .ptable, .ptable tbody, .ptable tr, .ptable td { display: block; width: 100%; }
  .ptable tr { border-top: 1px solid var(--border); padding: 10px 6px; }
  .ptable td { border: 0; padding: 4px 10px; }
  .ptable td.num, .ptable td.chevcell { display: none; }
  .ptable td.right { text-align: left; }
  .facts { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .create-grid { grid-template-columns: 1fr; }
  .create .f-multi { grid-column: auto; }
  .stats { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 27px; }
}

