/* ==========================================================================
   NETASSET — GLOBAL STYLE SYSTEM
   Shared by Dashboard, Router, Switch, Server, Master Data & Detail pages
   ========================================================================== */

:root {
  --bg: #f4f7fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #071a33;
  --text-soft: #29435f;
  --text-muted: #5d7895;
  --border: #d7e0ea;
  --border-strong: #c4d1df;
  --accent: #12b8ad;
  --accent-dark: #078f88;
  --accent-soft: #e5f8f6;
  --success: #10b981;
  --success-soft: #e7f8f0;
  --warning: #f59e0b;
  --warning-soft: #fff4df;
  --danger: #ef4444;
  --danger-soft: #fdecec;
  --neutral: #94a3b8;
  --neutral-soft: #eef2f6;
  --sidebar: #081323;
  --sidebar-2: #0d1a2d;
  --sidebar-text: #a8bad0;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(15, 35, 55, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 35, 55, 0.09);
  --sidebar-width: 260px;
  --topbar-height: 104px;
  font-synthesis: none;
}

/* RESET */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}
table {
  width: 100%;
  border-collapse: collapse;
}
::selection {
  background: var(--accent-soft);
  color: var(--text);
}

/* APP SHELL */
.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  scrollbar-width: thin;
  scrollbar-color: #263650 transparent;
}

.sidebar::-webkit-scrollbar {
  width: 7px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #263650;
  border-radius: 999px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 17px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #062c2a;
  font-family: "Space Grotesk", sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.brand-name {
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
}
.brand-sub {
  margin-top: 3px;
  color: #7087a2;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sidebar-nav {
  padding: 17px 10px 28px;
}

.nav-top,
.nav-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.nav-top:hover,
.nav-group > summary:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
}
.nav-top.active {
  background: #15243d;
  color: #fff;
}
.nav-top.disabled,
.nav-sub.disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.nav-group {
  margin: 3px 0;
}
.nav-group > summary {
  list-style: none;
  cursor: pointer;
}
.nav-group > summary::-webkit-details-marker {
  display: none;
}
.nav-group > summary::after {
  content: "⌄";
  color: #71859d;
  transition: transform 140ms ease;
}
.nav-group[open] > summary::after {
  transform: rotate(180deg);
}

.nav-children {
  position: relative;
  margin: 1px 0 4px 18px;
  padding: 1px 0 1px 12px;
  border-left: 1px solid #25364f;
}

.nav-sub {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 5px;
  color: #8297af;
  font-size: 12px;
  transition:
    background 120ms ease,
    color 120ms ease;
}

.nav-sub::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: #25364f;
}

.nav-sub:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
}
.nav-sub.active {
  background: #172744;
  color: var(--accent);
  font-weight: 600;
}
.soon-tag {
  margin-left: auto;
  color: #61748d;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

/* MAIN + TOPBAR */
.main {
  width: calc(100% - var(--sidebar-width));
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  background: var(--bg);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--topbar-height);
  padding: 22px 34px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  color: var(--text-muted);
  font-size: 12px;
}
.page-title {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 25px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px 34px 56px;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-header h1 {
  margin: 3px 0 7px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.page-eyebrow,
.eyebrow {
  color: var(--accent-dark);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-description {
  max-width: 780px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary,
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #052d2a;
}
.btn-primary:hover,
.btn-accent:hover {
  background: #0eaaa1;
  border-color: #0eaaa1;
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: #b7c6d6;
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-sm {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

/* PANELS */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}
.panel-subtitle,
.table-result-count {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 11px;
}

/* STATS */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  min-width: 0;
  padding: 20px 22px;
}
.stat-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.stat-value {
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}
.stat-sub,
.stat-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
}
.stat-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
}

/* CATEGORIES */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.category-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}
.category-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.cat-count {
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
}
.cat-label {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 10px;
}

/* TABLE TOOLBAR */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.search-box {
  position: relative;
  width: min(340px, 34vw);
}
.search-box input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px 8px 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 12px;
  top: 50%;
  z-index: 1;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transform: translateY(-53%);
  pointer-events: none;
}
.search-box input::placeholder {
  color: #7188a0;
}
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-select,
.table-toolbar select {
  min-height: 38px;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

/* TABLE */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.table-wrap table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
}
.table-wrap th {
  height: 46px;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table-wrap td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  vertical-align: middle;
}
.table-wrap tbody tr:hover {
  background: #fbfcfd;
}
.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

/* ASSET CELLS */
.asset-cell,
.server-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.asset-icon,
.server-icon,
.router-icon,
.switch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}
.asset-name,
.asset-name-text,
.server-name-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.asset-name strong,
.asset-name a,
.asset-name-text strong,
.asset-name-text a,
.server-name-text strong,
.server-name-text a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}
.asset-code,
.server-code-inline,
.router-code-inline,
.switch-code-inline {
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success,
.badge-active {
  background: var(--success-soft);
  color: #07966a;
}
.badge-warning,
.badge-maintenance {
  background: var(--warning-soft);
  color: #d97706;
}
.badge-danger,
.badge-retired {
  background: var(--danger-soft);
  color: #dc2626;
}
.badge-neutral {
  background: var(--neutral-soft);
  color: #64748b;
}

/* OPERATIONAL */
.operational,
.server-operational {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.operational::before,
.server-operational::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.operational-up,
.server-operational-up {
  color: var(--success);
}
.operational-degraded,
.server-operational-degraded {
  color: var(--warning);
}
.operational-down,
.server-operational-down {
  color: var(--danger);
}

/* ROW ACTIONS */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}
.icon-btn:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text);
  transform: translateY(-1px);
}

/* DETAIL */
.detail-page {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 34px 56px;
}
.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.detail-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: "IBM Plex Mono", monospace;
  font-size: 15px;
  font-weight: 700;
}
.detail-hero h1 {
  margin: 3px 0 5px;
  font-size: 30px;
  line-height: 1.1;
}
.detail-meta {
  color: var(--text-muted);
  font-size: 12px;
}
.detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.detail-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
}
.detail-tabs button,
.detail-tabs a {
  min-height: 40px;
  padding: 9px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.detail-tabs button:hover,
.detail-tabs a:hover,
.detail-tabs .active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.detail-section {
  padding: 22px 0;
}
.detail-section > h2 {
  margin-bottom: 5px;
  font-size: 21px;
}
.detail-section > p {
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 12px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.detail-group {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.detail-group h3 {
  margin: 0 0 14px;
  font-size: 14px;
}
.detail-kv {
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(0, 1.25fr);
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.detail-kv:last-child {
  border-bottom: none;
}
.detail-kv span {
  color: var(--text-muted);
  font-size: 12px;
}
.detail-kv strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

/* MODALS / FORMS */
dialog {
  max-width: calc(100vw - 32px);
  padding: 0;
  border: none;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(15, 24, 38, 0.2);
}
dialog::backdrop {
  background: rgba(11, 18, 32, 0.56);
}
.modal {
  width: min(920px, calc(100vw - 32px));
}
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 19px;
}
.modal-body {
  max-height: min(72vh, 700px);
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.form-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-child {
  border-bottom: none;
}
.form-section-head {
  margin-bottom: 16px;
}
.form-section-head h4 {
  margin: 0;
  font-size: 15px;
}
.form-section-head p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
.form-field.full {
  grid-column: 1 / -1;
}
.form-field label {
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.form-field textarea {
  min-height: 90px;
  resize: vertical;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field input:disabled,
.form-field select:disabled {
  background: var(--bg);
  color: var(--text-muted);
  cursor: not-allowed;
}
.mono-input,
.mono {
  font-family: "IBM Plex Mono", monospace !important;
}

/* EMPTY + TOAST */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 190px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.toast .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}
.toast-text {
  font-size: 12px;
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .content,
  .detail-page {
    padding-left: 28px;
    padding-right: 28px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
  .page-header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
  }
  .topbar {
    padding-left: 24px;
    padding-right: 24px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.full {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    width: 260px;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main {
    width: 100%;
    margin-left: 0;
  }
  .topbar {
    min-height: 82px;
    padding: 18px;
  }
  .content,
  .detail-page {
    padding: 22px 18px 42px;
  }
  .stat-grid,
  .category-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-header-actions {
    width: 100%;
    justify-content: stretch;
  }
  .page-header-actions .btn {
    flex: 1;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }
  .table-toolbar {
    width: 100%;
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    width: 100%;
  }
  .filter-select,
  .table-toolbar select {
    width: 100%;
  }
  .detail-kv {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .detail-kv strong {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 12px;
  }
  .page-title {
    font-size: 21px;
  }
  .topbar-actions .btn {
    padding-left: 10px;
    padding-right: 10px;
  }
  .stat-card,
  .category-card {
    padding: 17px 18px;
  }
  .modal,
  dialog {
    max-width: calc(100vw - 16px);
  }
  .modal-head,
  .modal-foot,
  .form-section {
    padding-left: 18px;
    padding-right: 18px;
  }
}
