/* ===== Pilnook Panel — panel.css ===== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; background: #f1f5f9; color: #1e293b; line-height: 1.5; }
/* rc000231: drop the hover underline globally so links stay
   flat. Surfaces that still want the affordance (e.g.
   .topbar-logout) opt back in via their own selector. */
a { color: #bd3bff; text-decoration: none; }
a:hover { text-decoration: none; }

/* --- Layout --- */
.panel-layout { display: flex; min-height: 100vh; }
.panel-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.panel-content { flex: 1; padding: 24px 32px; max-width: 1200px; width: 100%; }
/* rc000394 — opt-in wide layout: drops the 1200 px max + trims the
   horizontal gutter so the page fills the whole column right of the
   sidebar. Applied by base.html when Section="store" (extend the
   predicate to enroll more pages). */
.panel-content-wide { max-width: 100%; padding: 24px 24px; }

/* --- Sidebar --- */
.panel-sidebar { width: 240px; background: #1e2125; color: #e2e8f0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; transition: transform .2s; }
.panel-main { margin-left: 240px; }
.sidebar-logo { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px 16px 24px; }
.sidebar-brand { font-size: 1.25rem; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 0 8px; }
.nav-group { margin-bottom: 8px; }
.nav-group-label { display: block; padding: 12px 12px 4px; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; font-weight: 600; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; color: #cbd5e1; font-size: .9rem; transition: background .15s, color .15s; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-item.active { background: #bd3bff; color: #fff; }
.nav-item svg { flex-shrink: 0; }

/* rc000171: panel rc footer at the bottom of the sidebar. */
.sidebar-version { padding: 8px 12px; font-size: .65rem; color: #94a3b8; text-align: center; border-top: 1px solid rgba(255,255,255,.06); }

/* rc000171: module-version strip rendered below the content area
   when the user is inside a module surface (/modules/<code>/*). */
.module-version-footer { padding: 6px 32px; font-size: .7rem; color: #94a3b8; text-align: right; border-top: 1px solid #e2e8f0; background: #f8fafc; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.module-version-footer .mvf-label { text-transform: capitalize; }
.module-version-footer .mvf-sep { opacity: .5; }
.module-version-footer .mvf-value { font-family: ui-monospace, monospace; color: #475569; }

/* Sidebar collapse */
.sidebar-collapsed .panel-sidebar { transform: translateX(-240px); }
.sidebar-collapsed .panel-main { margin-left: 0; }
/* rc000172: page modals (Catalogs, Locations) live to the right of
   the sidebar — when the sidebar is collapsed off-screen, let them
   reclaim the full width. The base `left: 240px` is set inline in
   the per-page styles. */
.sidebar-collapsed .cat-modal-overlay,
.sidebar-collapsed .ubic-modal-overlay { left: 0; }

/* --- Topbar --- */
.panel-topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 32px; height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; }

/* rc000339 Story D — pending-deletion strip rendered under the
   topbar by base.html when the customer has open GDPR Art.17
   requests. Amber tone matches the in-modal deletion-pending
   banner from rc000338 so the visual language is consistent
   across surfaces. Multi-row stack (one per pending sub) is
   supported but typical case is N=1. */
.deletion-topstrip {
  background: #fef3c7;
  border-bottom: 1px solid #fde68a;
}
.deletion-topstrip-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 32px;
  color: #78350f;
  font-size: 0.88rem;
}
.deletion-topstrip-row + .deletion-topstrip-row { border-top: 1px solid #fde68a; }
.deletion-topstrip-icon {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fde68a;
  color: #854d0e;
}
.deletion-topstrip-body { flex: 1 1 auto; line-height: 1.4; }
.deletion-topstrip-body strong { color: #78350f; margin-right: 4px; }
.deletion-topstrip-body span { color: #92400e; }
.deletion-topstrip-note { flex: 0 0 auto; color: #92400e; font-size: 0.8rem; }
.deletion-topstrip-cancel {
  flex: 0 0 auto;
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fcd34d;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.deletion-topstrip-cancel:hover  { background: #fef2f2; border-color: #fca5a5; }
.deletion-topstrip-cancel:active { background: #fee2e2; }
.deletion-topstrip-cancel:disabled { opacity: 0.55; cursor: wait; }
@media (max-width: 640px) {
  .deletion-topstrip-row { flex-wrap: wrap; padding: 8px 16px; }
  .deletion-topstrip-body { flex-basis: 100%; }
  .deletion-topstrip-cancel { margin-left: auto; }
}

/* rc000341 — topstrip-modal (styled confirm/alert hybrid).
   Used by window.topstripModal() in base.html. Two-button when
   cancel is shown; single-OK when caller passes cancelLabel:null.
   Tones flip the icon background + OK button colour pair so the
   same shell renders info / warn / danger consistently. */
.topstrip-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0);
  transition: background 0.18s ease;
  pointer-events: none;
}
.topstrip-modal-overlay[hidden] { display: none; }
.topstrip-modal-overlay.open    { background: rgba(15,23,42,0.45); pointer-events: auto; }
.topstrip-modal-box {
  background: #fff; border-radius: 14px; max-width: 460px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 60px rgba(15,23,42,0.22);
  transform: scale(0.96); opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  display: flex; flex-direction: column;
}
.topstrip-modal-overlay.open .topstrip-modal-box { transform: scale(1); opacity: 1; }
.topstrip-modal-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 1rem 1.1rem 0.5rem;
}
.topstrip-modal-icon {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.topstrip-modal-icon-info   { background: #dbeafe; color: #1e40af; }
.topstrip-modal-icon-warn   { background: #fef3c7; color: #854d0e; }
.topstrip-modal-icon-danger { background: #fee2e2; color: #b91c1c; }
.topstrip-modal-title {
  flex: 1 1 auto;
  margin: 0;
  font-weight: 600; color: #0f172a; font-size: 1rem;
}
.topstrip-modal-close {
  flex: 0 0 auto;
  background: none; border: none; cursor: pointer; color: #64748b;
  padding: 0.2rem;
}
.topstrip-modal-close:hover { color: #0f172a; }
.topstrip-modal-body {
  padding: 0 1.1rem 1rem 1.1rem;
  color: #0f172a;
  font-size: 0.92rem;
  line-height: 1.5;
}
.topstrip-modal-body p { margin: 0; }
.topstrip-modal-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 0.75rem 1.1rem;
  background: #fafbfd;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 14px 14px;
}
.topstrip-modal-cancel,
.topstrip-modal-ok {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0.5rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}
.topstrip-modal-cancel {
  background: #fff; color: #475569; border-color: #e2e8f0;
}
.topstrip-modal-cancel:hover { background: #f1f5f9; border-color: #cbd5e1; }
.topstrip-modal-ok-info   { background: #1976d2; color: #fff; border-color: #1976d2; }
.topstrip-modal-ok-info:hover   { background: #1565c0; border-color: #1565c0; }
.topstrip-modal-ok-warn   { background: #d97706; color: #fff; border-color: #d97706; }
.topstrip-modal-ok-warn:hover   { background: #b45309; border-color: #b45309; }
.topstrip-modal-ok-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.topstrip-modal-ok-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.topstrip-modal-ok:focus-visible,
.topstrip-modal-cancel:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
@media (max-width: 460px) {
  .topstrip-modal-footer { flex-direction: column-reverse; }
  .topstrip-modal-cancel,
  .topstrip-modal-ok { width: 100%; }
}
.sidebar-toggle { background: none; border: none; cursor: pointer; color: #64748b; padding: 4px; }
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: .85rem; }
.topbar-account { font-weight: 600; color: #1e293b; }
.topbar-email { color: #64748b; }
.topbar-logout { color: #ef4444; font-size: .8rem; }
.topbar-logout:hover { text-decoration: underline; }

/* --- Topbar user dropdown --- */
.topbar-user-dropdown { position: relative; }
.topbar-user-btn { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border: none; background: none; cursor: pointer; border-radius: 8px; transition: background .15s; }
.topbar-user-btn:hover { background: #f1f5f9; }
.topbar-avatar { width: 32px; height: 32px; border-radius: 50%; background: #bd3bff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.topbar-user-info { display: flex; flex-direction: column; text-align: left; line-height: 1.3; }
.topbar-user-name { font-weight: 600; font-size: .8rem; color: #0f172a; }
.topbar-user-email { font-size: .7rem; color: #94a3b8; }
.topbar-chevron { color: #94a3b8; transition: transform .2s; flex-shrink: 0; }
.topbar-user-dropdown.open .topbar-chevron { transform: rotate(180deg); }
.topbar-dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.1); padding: 6px; z-index: 200; }
.topbar-user-dropdown.open .topbar-dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: .85rem; color: #1e293b; border-radius: 6px; transition: background .12s; text-decoration: none; }
.dropdown-item:hover { background: #f1f5f9; text-decoration: none; }
.dropdown-item svg { color: #64748b; flex-shrink: 0; }
.dropdown-logout { color: #ef4444; }
.dropdown-logout svg { color: #ef4444; }
.dropdown-sep { height: 1px; background: #e2e8f0; margin: 4px 8px; }

/* --- Page header --- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.page-subtitle { color: #64748b; font-size: .9rem; }
.page-header .btn { margin-top: 8px; }

/* --- Breadcrumb --- */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: #94a3b8; margin-bottom: 8px; }
.breadcrumb a { color: #bd3bff; }
.bc-sep { color: #cbd5e1; }

/* --- Stats grid --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; display: flex; gap: 16px; align-items: center; border: 1px solid #e2e8f0; }
.stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.domains-icon { background: #f3e8ff; color: #bd3bff; }
.stat-icon.hostings-icon { background: #dbeafe; color: #2563eb; }
.stat-icon.multisite-icon { background: #d1fae5; color: #059669; }
.stat-icon.billing-icon { background: #fef3c7; color: #d97706; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; color: #0f172a; }
.stat-label { display: block; font-size: .8rem; color: #64748b; }

/* --- Section cards --- */
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }
.section-card { background: #fff; border-radius: 8px; padding: 20px; border: 1px solid #e2e8f0; }
.section-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }

/* --- Detail grid --- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
.detail-card { background: #fff; border-radius: 8px; padding: 20px; border: 1px solid #e2e8f0; }
.detail-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.card-desc { color: #64748b; font-size: .85rem; margin-bottom: 12px; }
.detail-list { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: .85rem; }
.detail-list dt { font-weight: 600; color: #64748b; }
.detail-list dd { color: #1e293b; }

/* --- Data table --- */
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table.full-width { background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; overflow: hidden; }
.data-table thead { background: #f8fafc; }
.data-table th { text-align: left; padding: 10px 14px; font-weight: 600; color: #64748b; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #e2e8f0; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.data-table tbody tr:hover { background: #f8fafc; }
.cell-primary a { color: #bd3bff; font-weight: 500; }
.cell-mono { font-family: 'SF Mono', Monaco, Consolas, monospace; font-size: .8rem; }
.cell-actions { display: flex; gap: 8px; }

/* rc000188: visually disable read-only inputs.
   Multiple page-scoped modal forms set `input.readOnly = true` on
   identity fields (variety code, size-grade code, warehouse code)
   because the backend doesn't accept patching them — codes feed
   lot-code composition + dispatch notes, renaming would silently
   invalidate paper trails. Without this rule the input keeps a
   regular look and feel and the operator wastes time typing into
   a field that quietly discards the change. */
input[readonly], textarea[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}
input[readonly]:focus, textarea[readonly]:focus { border-color: #cbd5e1 !important; box-shadow: none !important; }

/* --- Pilnook unified table (rc000183) ---
   Gold standard was the farms table introduced in rc000181. Lifted
   here so every agrotrack listing (Catalogs varieties + size grades,
   Locations farms + warehouses, Warehouse units, future modules)
   shares one look — instead of three slightly-different per-page
   table classes that drifted apart over time. */
.pilnook-table { width:100%; border-collapse:collapse; background:#fff; border:1px solid #e2e8f0; border-radius:8px; overflow:hidden; }
.pilnook-table th, .pilnook-table td { text-align:left; padding:0.6rem 0.85rem; font-size:0.9rem; vertical-align:middle; }
.pilnook-table th { background:#f8fafc; color:#475569; font-weight:600; font-size:0.8rem; text-transform:uppercase; letter-spacing:0.03em; }
.pilnook-table tr { border-top:1px solid #f1f5f9; }
.pilnook-table thead tr { border-top:none; }
.pilnook-table tr:first-child { border-top:none; }
.pilnook-table tbody tr:hover { background:#fafbfc; }

/* Cell type modifiers — opt-in via class on <td>. */
.pilnook-table td.code { color:#1976d2; font-family:ui-monospace,monospace; font-weight:600; font-size:0.88rem; width:5.5rem; }
.pilnook-table td.name { font-weight:600; color:#0f172a; }
.pilnook-table td.name .row-sub { font-weight:400; font-size:0.78rem; color:#94a3b8; margin-top:0.15rem; }
.pilnook-table td.muted { color:#475569; font-size:0.85rem; }
.pilnook-table td.muted-empty { color:#94a3b8; font-style:italic; font-size:0.85rem; }
.pilnook-table td.notes { color:#64748b; font-size:0.82rem; max-width:18rem; overflow:hidden; text-overflow:ellipsis; }
.pilnook-table td.numeric { color:#64748b; font-size:0.85rem; white-space:nowrap; }
.pilnook-table td.actions { width:1%; white-space:nowrap; }

/* Action button cluster — used both inside .pilnook-table td.actions
   and standalone (e.g. .pilnook-actions in a non-table context). */
.pilnook-actions { display:flex; gap:0.3rem; justify-content:flex-end; white-space:nowrap; }
.pilnook-actions button, .pilnook-actions a.btn {
  background:none; border:1px solid #cbd5e1; color:#475569;
  border-radius:4px; padding:0.25rem 0.55rem; font-size:0.8rem;
  cursor:pointer; text-decoration:none;
  display:inline-flex; align-items:center; gap:0.3rem;
  font-family:inherit;
}
.pilnook-actions button:hover, .pilnook-actions a.btn:hover { background:#f1f5f9; border-color:#94a3b8; }
.pilnook-actions button.danger { color:#dc2626; border-color:#fecaca; }
.pilnook-actions button.danger:hover { background:#fef2f2; }
.pilnook-actions .btn-locate { color:#1976d2; border-color:#bfdbfe; }
.pilnook-actions .btn-locate:hover { background:#eff6ff; border-color:#1976d2; }
.pilnook-actions .btn-locate.btn-pin-missing { color:#94a3b8; border-color:#e2e8f0; }
.pilnook-actions .btn-locate.btn-pin-missing:hover { color:#1976d2; border-color:#bfdbfe; background:#eff6ff; }
/* Calibrate is a positive CTA — green like the existing one. */
.pilnook-actions .btn-calibrate { color:#fff; background:#16a34a; border-color:#16a34a; }
.pilnook-actions .btn-calibrate:hover { background:#15803d; border-color:#15803d; }
.pilnook-actions .btn-calibrate:disabled { opacity:0.55; cursor:not-allowed; background:#9ca3af; border-color:#9ca3af; }

/* Inline crop / kind badge used inside .pilnook-table td.name. */
.pilnook-table .row-badge {
  display:inline-block; margin-left:0.4rem;
  padding:0.05rem 0.45rem; background:#f1f5f9; color:#475569;
  border-radius:9999px; font-size:0.7rem; font-weight:500;
}

/* --- Badges --- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-active, .badge-ok { background: #d1fae5; color: #065f46; }
.badge-pending {  background: #fef3c7; color: #92400e; }
.badge-suspended, .badge-error { background: #fee2e2; color: #991b1b; }
.badge-dns { background: #e0e7ff; color: #3730a3; }
.badge-type { background: #f1f5f9; color: #475569; }
.badge-role { background: #f3e8ff; color: #bd3bff; }
/* tb_units lifecycle pills (rc000280). */
.badge-pre_printed { background: #f1f5f9; color: #475569; }      /* sticker printed, not yet scanned */
.badge-received    { background: #d1fae5; color: #065f46; }      /* scanned into inventory */
.badge-dispatched  { background: #e0e7ff; color: #3730a3; }      /* shipped out */
.badge-blocked     { background: #fee2e2; color: #991b1b; }      /* quality hold */

/* ──────────────────────────────────────────────────────────────────
   Warehouse page (rc000280) — farm → warehouse → assets layout.
   Builds on .section-card + .pilnook-table; adds card framing,
   kind icon, stage chip and a 2-line code cell so the operator
   reads the row at a glance.
   ────────────────────────────────────────────────────────────── */
.wh-card { padding:0; border:1px solid #e2e8f0; border-radius:10px; background:#fff; box-shadow:0 1px 2px rgba(15,23,42,0.04); margin-bottom:1.25rem; overflow:hidden; }
.wh-card.wh-card-unassigned { border-left:3px solid #f59e0b; }
.wh-card-head { display:flex; align-items:center; gap:0.75rem; padding:0.85rem 1rem; background:linear-gradient(180deg,#fafbfc 0%,#f8fafc 100%); border-bottom:1px solid #e2e8f0; }
.wh-card-head .wh-icon { width:32px; height:32px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; background:#eef2ff; color:#3730a3; }
.wh-card.wh-card-unassigned .wh-card-head .wh-icon { background:#fef3c7; color:#92400e; }
.wh-card-head h3 { margin:0; font-size:0.95rem; font-weight:600; color:#0f172a; }
.wh-card-head .wh-code { font-family:ui-monospace,monospace; font-size:0.72rem; color:#94a3b8; padding:0.1rem 0.4rem; background:#f1f5f9; border-radius:4px; }
.wh-card-head .wh-kind { font-size:0.7rem; font-weight:600; text-transform:uppercase; letter-spacing:0.03em; color:#3730a3; padding:0.12rem 0.5rem; background:#eef2ff; border-radius:9999px; }
.wh-card-head .wh-count { margin-left:auto; font-size:0.85rem; color:#475569; font-weight:500; }
.wh-card-body { padding:0; }
.wh-card-empty { padding:1rem; color:#94a3b8; font-size:0.85rem; font-style:italic; text-align:center; }

/* Per-asset row layout — overrides .pilnook-table defaults so the
   warehouse table fits more info without horizontal scroll. */
.wh-asset-table { border:none; border-radius:0; box-shadow:none; }
.wh-asset-table th { background:#fff; color:#94a3b8; font-size:0.7rem; padding:0.55rem 1rem; border-bottom:1px solid #f1f5f9; }
.wh-asset-table td { padding:0.65rem 1rem; }
.wh-asset-table tbody tr:hover { background:#f8fafc; }
.wh-asset-table .wh-asset-code { font-family:ui-monospace,monospace; font-weight:600; color:#1976d2; font-size:0.88rem; text-decoration:none; }
.wh-asset-table .wh-asset-code:hover { text-decoration:underline; }
.wh-asset-table .wh-asset-lot { font-family:ui-monospace,monospace; font-size:0.72rem; color:#94a3b8; margin-top:0.15rem; }
.wh-asset-table td.wh-asset-id { width:14rem; }

/* Stage chip — HRV warm, CAL cool, DSP slate, others gray. */
.wh-stage { display:inline-block; padding:0.12rem 0.5rem; border-radius:4px; font-size:0.7rem; font-weight:700; letter-spacing:0.03em; font-family:ui-monospace,monospace; }
.wh-stage-HRV { background:#d1fae5; color:#065f46; }   /* harvest — green */
.wh-stage-CAL { background:#dbeafe; color:#1e40af; }   /* calibrate — blue */
.wh-stage-DSP { background:#e2e8f0; color:#475569; }   /* dispatch — slate */
.wh-stage-PCK { background:#fce7f3; color:#9d174d; }   /* packaging — pink */

/* Origin path "PLC · R01 · BLC" — quiet so it doesn't fight the lot code. */
.wh-asset-origin { font-size:0.8rem; color:#475569; }
.wh-asset-origin .wh-sep { color:#cbd5e1; margin:0 0.35rem; }
.wh-asset-size { display:inline-block; padding:0.1rem 0.45rem; background:#f1f5f9; color:#475569; border-radius:4px; font-size:0.72rem; font-weight:600; font-family:ui-monospace,monospace; }
.wh-asset-empty-cell { color:#cbd5e1; }

/* Section card for the farm group — slightly softer than the existing
   .section-card so the warehouse cards inside stand out. */
.wh-farm-section { background:transparent; border:none; padding:0; margin-bottom:1.75rem; }
.wh-farm-section > header { display:flex; align-items:baseline; gap:0.6rem; padding:0 0.2rem 0.4rem; border-bottom:1px solid #e2e8f0; margin-bottom:1rem; }
.wh-farm-section > header h2 { margin:0; font-size:1.1rem; font-weight:600; color:#0f172a; }
.wh-farm-section > header code { font-family:ui-monospace,monospace; font-size:0.78rem; color:#94a3b8; background:#f1f5f9; padding:0.1rem 0.4rem; border-radius:4px; }
.wh-farm-section > header .wh-farm-count { margin-left:auto; font-size:0.82rem; color:#64748b; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: .85rem; font-weight: 500; border: none; cursor: pointer; transition: background .15s, box-shadow .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: #bd3bff; color: #fff; }
.btn-primary:hover { background: #a020f0; }
.btn-ghost { background: transparent; color: #bd3bff; }
.btn-ghost:hover { background: #f5f3ff; }
.btn-danger { color: #ef4444!important; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-xs { padding: 3px 8px; font-size: .75rem; }
.btn-block { width: 100%; justify-content: center; }

/* --- Forms --- */
.form-card { background: #fff; border-radius: 8px; padding: 24px; border: 1px solid #e2e8f0; max-width: 640px; }
.form-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: .85rem; background: #fff; color: #1e293b; transition: border-color .15s; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #bd3bff; box-shadow: 0 0 0 3px rgba(189,59,255,.12); }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; }
.form-row .form-group.flex-2 { flex: 2; }
.form-row .form-group.flex-3 { flex: 3; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-error { color: #ef4444; font-size: .8rem; margin-top: 8px; padding: 8px 12px; background: #fef2f2; border-radius: 6px; border: 1px solid #fecaca; }
.form-success { color: #065f46; font-size: .8rem; margin-top: 8px; padding: 8px 12px; background: #ecfdf5; border-radius: 6px; border: 1px solid #a7f3d0; }
.input-with-suffix { display: flex; }
.input-with-suffix input { border-radius: 6px 0 0 6px; }
.input-with-suffix select { border-radius: 0 6px 6px 0; border-left: none; width: auto; min-width: 80px; }

/* --- DNS toolbar --- */
.dns-toolbar { margin-bottom: 16px; }

/* --- Empty state --- */
.empty-state { color: #94a3b8; font-size: .85rem; font-style: italic; }
.empty-state-box { text-align: center; padding: 48px 24px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; }
.empty-state-box h3 { margin: 16px 0 8px; color: #475569; }
.empty-state-box p { color: #94a3b8; margin-bottom: 16px; }

/* --- Login --- */
.login-body { background: linear-gradient(135deg, #1e2125, #2a2d32); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-container { width: 100%; max-width: 400px; padding: 24px; }
.login-card { background: #fff; border-radius: 12px; padding: 40px 32px; box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo h1 { font-size: 1.5rem; color: #1e293b; margin-top: 8px; }
.login-card h2 { text-align: center; font-size: .9rem; color: #64748b; font-weight: 400; margin-bottom: 24px; }

/* --- Error pages --- */
.error-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f1f5f9; }
.error-container { text-align: center; }
.error-code { font-size: 6rem; font-weight: 800; color: #bd3bff; line-height: 1; }
.error-container p { color: #64748b; margin: 12px 0 24px; }

/* --- Responsive --- */
/* --- Support page --- */
.support-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 32px; }
.support-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.support-card-primary { border-color: #2563eb; border-width: 2px; }
.support-card-icon { width: 48px; height: 48px; border-radius: 10px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: #2563eb; }
.support-card-primary .support-card-icon { background: #eff6ff; }
.support-card-title { font-size: 1.05rem; font-weight: 600; color: #0f172a; }
.support-card-desc { font-size: .85rem; color: #64748b; line-height: 1.5; flex: 1; }
.support-card-status { font-size: .75rem; color: #94a3b8; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.status-coming { background: #f59e0b; }
.status-dot.status-active { background: #22c55e; }
.support-section { margin-bottom: 32px; }
.support-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.support-section-header h2 { font-size: 1.1rem; font-weight: 600; color: #0f172a; }
.support-search-box { display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0 12px; height: 36px; min-width: 240px; }
.support-search-box svg { color: #94a3b8; flex-shrink: 0; }
.support-search-input { border: none; background: none; outline: none; font-size: .85rem; width: 100%; color: #1e293b; }
.support-search-input::placeholder { color: #94a3b8; }
.support-faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.support-faq-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.support-faq-icon { color: #64748b; }
.support-faq-card h3 { font-size: .95rem; font-weight: 600; color: #0f172a; }
.support-faq-card p { font-size: .8rem; color: #64748b; line-height: 1.5; flex: 1; }

/* --- Confirm modal --- */
.confirm-overlay[hidden] { display: none; }
.confirm-overlay { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0); transition: background .18s; pointer-events: none; }
.confirm-overlay.open { background: rgba(0,0,0,.45); pointer-events: auto; }
.confirm-box { background: #fff; border-radius: 14px; padding: 28px 24px 20px; max-width: 400px; width: calc(100% - 32px); box-shadow: 0 16px 48px rgba(0,0,0,.18); text-align: center; transform: scale(.92); opacity: 0; transition: transform .18s, opacity .18s; }
.confirm-overlay.open .confirm-box { transform: scale(1); opacity: 1; }
.confirm-icon { color: #f59e0b; margin-bottom: 12px; }
.confirm-box h3 { font-size: 1.05rem; font-weight: 600; color: #0f172a; margin-bottom: 8px; }
.confirm-box p { font-size: .88rem; color: #64748b; line-height: 1.5; margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-btn { padding: 8px 24px; border-radius: 8px; font-size: .88rem; font-weight: 500; border: none; cursor: pointer; transition: background .12s, color .12s; }
.confirm-btn-cancel { background: #f1f5f9; color: #475569; }
.confirm-btn-cancel:hover { background: #e2e8f0; }
.confirm-btn-ok { background: #2563eb; color: #fff; }
.confirm-btn-ok:hover { background: #1d4ed8; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .panel-sidebar { transform: translateX(-240px); }
  .panel-main { margin-left: 0; }
  body.sidebar-open .panel-sidebar { transform: translateX(0); }
  .panel-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .section-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  /* rc000172: on mobile the sidebar hides by default, so the modal
     overlay can use the full viewport — and when the operator
     reveals the sidebar (body.sidebar-open) we push the modal
     edge back to 240px so the two never overlap. */
  .cat-modal-overlay,
  .ubic-modal-overlay { left: 0; }
  body.sidebar-open .cat-modal-overlay,
  body.sidebar-open .ubic-modal-overlay { left: 240px; }
}

/* --- Module tiles (dashboard) ---
   rc000236: restored from the inline <style> block that was
   accidentally dropped from dashboard.html when rc000234 trimmed
   the page to "My modules" only. Same selectors and values as the
   rc000225 → rc000233 chain (vertical brand cards, 5:7 ratio, 52%
   white emblem). Now lives in panel.css so it survives template
   edits and is cached the same way as the rest of the panel CSS.
*/
.module-tiles { margin-bottom: 2rem; }
.module-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.85rem;
}
.module-tile {
  --tile-color: #7CB342;
  --tile-bg: none;
  position: relative;
  /* rc000232: aspect locked to the actual asset ratio (the
     tractor photo and any future module photo are 5×7). 250/410
     was a guess before the photo arrived. */
  aspect-ratio: 5 / 7;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.module-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
/* Layer 1 — placeholder photo background.
   When the operator supplies a real picture per module, set
   `background-image: url('...')` here (or pass it via inline
   style from Go). The CSS below already darkens it the right
   amount under the colour overlay. */
.module-tile::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  /* rc000232: real photo when --tile-bg points at a /static
     url; otherwise a gradient placeholder built from the
     module's tint colour. Either way the colour overlay
     (::after) sits on top and tints to the brand tone. */
  background-image: var(--tile-bg),
    linear-gradient(135deg,
      color-mix(in srgb, var(--tile-color) 92%, #000) 0%,
      color-mix(in srgb, var(--tile-color) 70%, #fff) 100%);
  background-size: cover, cover;
  background-position: center, center;
  /* rc000238: smooth zoom on hover. Slower than the card's
     translate (0.4s vs 0.18s) so the photo seems to "breathe"
     into the lift, not snap with it. */
  transition: transform 0.4s ease;
  transform-origin: center;
}
/* rc000238: zoom only the photo layer (::before) on hover, NOT
   the card itself, so the emblem stays put and the colour
   overlay (::after) keeps full coverage during the scale. */
.module-tile:hover::before { transform: scale(1.08); }
/* Layer 2 — colour-tinted overlay so the photo (when present)
   adopts the brand tone, like the AGV green / CV blue / OHW
   orange in the mood board. */
.module-tile::after {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  background: var(--tile-color);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
/* Layer 3 — centred white emblem with the brand short tag,
   icon and full name. */
.module-tile-emblem {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: #ffffff;
  /* rc000233: 60 → 52 %. Smaller white square so the photo
     breathes more, then the text below scales up to keep the
     emblem readable at the new size. */
  width: 52%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  padding: 0.75rem;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  text-align: center;
}
/* rc000233: emblem text bumped another step now that the
   square is 52 %. Reads larger relative to the smaller chrome
   even though the absolute pixels grew only mildly. */
.module-tile-emblem .icon {
  font-size: 2.3rem; line-height: 1; margin-bottom: 0.25rem;
  color: var(--tile-color);
}
.module-tile-emblem .short {
  font-weight: 800;
  font-size: 1.95rem;
  letter-spacing: 0.02em;
  color: var(--tile-color);
  line-height: 1;
}
.module-tile-emblem .name {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  line-height: 1.2;
  margin-top: 0.3rem;
}

/* rc000303: every <select> in the panel wears the same slate-grey
   chevron (turns blue on focus to match the focus ring), not the
   browser-default arrow — which on some GTK/Edge/Firefox themes
   renders as a bright blue triangle that clashes with our slate UI.
   Global rule; inline `style="..."` on individual selects
   (border/padding/font-size) remains effective except for
   padding-right (forced via !important) so the chevron never
   overlaps the trigger text. Multi-select listboxes (size>1) keep
   the browser-default appearance — chevron only makes sense for
   single-value triggers. */
select:not([multiple]):not([size]):not(.crop-type-select) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  background-size: 14px 14px;
  padding-right: 2rem !important;
}
select:not([multiple]):not([size]):not(.crop-type-select):focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231976d2' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
select:not([multiple]):not([size]):not(.crop-type-select):disabled {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  cursor: not-allowed;
}
