:root {
  --app-primary: #7357eb;
  --app-primary-dark: #5b3fd0;
  --app-primary-rgb: 115, 87, 235;
  --app-sidebar: #fff;
  --app-bg: #f6f6f8;
  --app-border: #e9e9ee;
  --app-muted: #73737f;
  --sidebar-width: 264px;
  --topbar-height: 72px;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  background: var(--app-bg);
  color: #172033;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; }
.min-w-0 { min-width: 0; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1030;
  width: var(--sidebar-width);
  padding: 1.5rem 1rem;
  color: var(--bs-body-color);
  background: var(--app-sidebar);
  border-right: 1px solid var(--app-border);
  overflow-y: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #172033;
}
.sidebar .brand, .mobile-menu .brand, .brand-light { color: var(--bs-body-color); }
.brand:hover { color: inherit; }
.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--app-primary), color-mix(in srgb, var(--app-primary) 68%, white));
  box-shadow: 0 8px 22px rgba(var(--app-primary-rgb), .25);
}
.brand strong { display: block; font-size: 1.15rem; line-height: 1.05; }
.brand small { display: block; margin-top: .2rem; color: #94a3b8; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { margin-top: 2rem; gap: .28rem; }
.nav-divider { height: 1px; margin: 1rem .8rem; background: var(--app-border); }
.nav-section {
  padding: 0 .8rem;
  color: #64748b;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .72rem .85rem;
  border-radius: 10px;
  color: #666672;
  font-size: .9rem;
  font-weight: 500;
}
.sidebar-nav .nav-link i { width: 1.25rem; font-size: 1.1rem; text-align: center; }
.sidebar-nav .nav-link:hover { color: var(--app-primary); background: rgba(var(--app-primary-rgb), .075); }
.sidebar-nav .nav-link.active {
  color: var(--app-primary);
  background: rgba(var(--app-primary-rgb), .11);
  box-shadow: inset 3px 0 var(--app-primary);
  font-weight: 650;
}
.sidebar-footer {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
  padding: 1rem .5rem 0;
  border-top: 1px solid var(--app-border);
}
.sidebar-footer strong { max-width: 140px; font-size: .85rem; }
.sidebar-footer small { color: #94a3b8; font-size: .72rem; }
.user-avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
  font-weight: 700;
}

.main-content { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 1020;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 2rem;
  border-bottom: 1px solid var(--app-border);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
}
.page-title { margin: 0; font-size: 1.2rem; font-weight: 700; }
.page-subtitle { margin: .12rem 0 0; color: var(--app-muted); font-size: .8rem; }
.btn-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--bs-body-bg);
}
.user-menu { display: flex; max-width: 180px; align-items: center; gap: .55rem; padding: .2rem .4rem; border: 0; }
.appearance-panel { width: min(92vw, 390px); padding: 1rem; border-radius: 16px; }
.appearance-heading, .custom-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.appearance-heading { padding: .15rem .2rem .8rem; }
.appearance-heading strong, .custom-color-row strong { display: block; font-size: .9rem; }
.appearance-heading small, .custom-color-row small { display: block; margin-top: .15rem; color: var(--app-muted); font-size: .7rem; }
.appearance-section { padding: .9rem .2rem; border-bottom: 1px solid var(--app-border); }
.appearance-label { display: block; margin-bottom: .65rem; color: var(--app-muted); font-size: .68rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.mode-switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; padding: .3rem; border-radius: 10px; background: var(--app-bg); }
.mode-switcher button {
  padding: .55rem .35rem;
  border: 0;
  border-radius: 8px;
  color: var(--app-muted);
  background: transparent;
  font-size: .75rem;
  font-weight: 650;
}
.mode-switcher button i { margin-right: .25rem; }
.mode-switcher button:hover, .mode-switcher button.active { color: var(--app-primary); background: var(--bs-body-bg); box-shadow: 0 2px 7px rgba(20,20,28,.06); }
.brand-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.brand-option {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem .6rem;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  color: var(--bs-body-color);
  background: var(--bs-body-bg);
  font-size: .72rem;
}
.brand-option span { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 2px rgba(255,255,255,.42); }
.brand-option:hover, .brand-option.active { border-color: var(--app-primary); box-shadow: 0 0 0 2px rgba(var(--app-primary-rgb), .1); }
.custom-color-row { cursor: pointer; }
.custom-color-row input { width: 48px; height: 34px; padding: 3px; border: 1px solid var(--app-border); border-radius: 9px; background: var(--bs-body-bg); cursor: pointer; }
.content-wrapper { width: 100%; max-width: 1540px; margin: 0 auto; padding: 1.7rem 2rem 2.5rem; }
.mobile-context { margin-bottom: 1rem; }
.mobile-context span { display: block; font-size: 1.1rem; font-weight: 750; }
.mobile-context small { display: block; margin-top: .15rem; color: var(--app-muted); }
.welcome-banner {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  overflow: hidden;
  padding: 1.6rem 1.8rem;
  border: 1px solid rgba(var(--app-primary-rgb), .2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 90% 20%, rgba(var(--app-primary-rgb), .15), transparent 30%),
    linear-gradient(120deg, var(--bs-body-bg), rgba(var(--app-primary-rgb), .055));
}
.welcome-banner .eyebrow {
  color: var(--app-primary);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.welcome-banner h2 { margin: .35rem 0; font-size: clamp(1.35rem, 2vw, 1.8rem); font-weight: 780; }
.welcome-banner p { margin: 0; color: var(--app-muted); font-size: .88rem; }
.welcome-icon {
  display: grid;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  place-items: center;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(145deg, var(--app-primary), var(--app-primary-dark));
  box-shadow: 0 14px 30px rgba(var(--app-primary-rgb), .25);
  font-size: 1.6rem;
}

.metric-card, .panel-card {
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--bs-body-bg);
  box-shadow: 0 5px 20px rgba(15, 23, 42, .04);
}
.metric-card { display: flex; align-items: flex-start; gap: 1rem; padding: 1.35rem; }
.metric-icon {
  display: inline-grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 13px;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, .16);
}
.metric-icon-blue { color: #2563eb; background: #eff6ff; }
.metric-icon-violet { color: #7c3aed; background: #f5f3ff; }
.metric-icon-green { color: #059669; background: #ecfdf5; }
.metric-label { margin: 0 0 .25rem; color: var(--app-muted); font-size: .78rem; font-weight: 600; }
.metric-value { margin: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.15; }
.metric-card small { font-size: .7rem; }
.metric-card-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
  box-shadow: 0 12px 28px rgba(var(--app-primary-rgb), .2);
}
.metric-card-primary .metric-label, .metric-card-primary small { color: rgba(255, 255, 255, .75); }
.panel-card { padding: 1.5rem; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.panel-header h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.panel-header p { margin: .25rem 0 0; color: var(--app-muted); font-size: .8rem; }
.quick-action {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: .9rem;
  padding: .9rem;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  color: var(--bs-body-color);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.quick-action:hover { transform: translateY(-2px); border-color: rgba(var(--app-primary-rgb), .42); color: var(--bs-body-color); box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }
.quick-icon, .status-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 11px;
  color: var(--app-primary);
  background: rgba(var(--app-primary-rgb), .09);
  font-size: 1.05rem;
}
.quick-action strong, .quick-action small, .status-item strong, .status-item small { display: block; }
.quick-action strong, .status-item strong { font-size: .85rem; }
.quick-action small, .status-item small { margin-top: .15rem; color: var(--app-muted); font-size: .72rem; }
.status-item { display: flex; align-items: center; gap: .85rem; padding: .9rem 0; border-bottom: 1px solid var(--app-border); }
.status-dot { width: 11px; height: 11px; margin: 0 15px; flex: 0 0 11px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 5px #d1fae5; }
.btn-primary { border-color: var(--app-primary); background: var(--app-primary); }
.btn-primary:hover { border-color: var(--app-primary-dark); background: var(--app-primary-dark); }
.mobile-menu { width: min(88vw, 310px) !important; color: var(--bs-body-color); background: var(--app-sidebar); }
.mobile-menu .sidebar-nav { margin-top: .75rem; }
.mobile-menu .offcanvas-body { padding-bottom: 2rem; }

.master-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--app-border);
}
.master-search { position: relative; width: min(100%, 360px); }
.master-search > i {
  position: absolute;
  top: 50%;
  left: .9rem;
  z-index: 2;
  color: var(--app-muted);
  transform: translateY(-50%);
}
.master-search .form-control { padding-left: 2.5rem; padding-right: 2.5rem; }
.master-search .btn-link { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); }
.master-table { --bs-table-bg: transparent; }
.master-table th {
  padding: .85rem 1.25rem;
  border-bottom-color: var(--app-border);
  color: var(--app-muted);
  background: color-mix(in srgb, var(--app-bg) 65%, transparent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.master-table td { padding: 1rem 1.25rem; border-bottom-color: var(--app-border); font-size: .86rem; }
.master-table tbody tr:last-child td { border-bottom: 0; }
.master-table tbody tr:hover { background: color-mix(in srgb, var(--app-primary) 4%, transparent); }
.status-badge { padding: .42rem .65rem; border-radius: 99px; font-weight: 650; }
.active-status { color: #047857; background: #d1fae5; }
.inactive-status { color: #64748b; background: #e2e8f0; }
.btn-soft-primary { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
.btn-soft-primary:hover { color: #fff; background: #2563eb; border-color: #2563eb; }
.btn-soft-secondary { color: #475569; background: #f8fafc; border-color: #e2e8f0; }
.btn-soft-secondary:hover { color: #fff; background: #64748b; border-color: #64748b; }
.btn-soft-danger { color: #b91c1c; background: #fef2f2; border-color: #fee2e2; }
.btn-soft-danger:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.empty-state { padding: clamp(3rem, 8vw, 6rem) 1.5rem; text-align: center; }
.empty-icon, .delete-icon {
  display: inline-grid;
  width: 64px;
  height: 64px;
  margin-bottom: 1.25rem;
  place-items: center;
  border-radius: 18px;
  color: var(--app-primary);
  background: #eff6ff;
  font-size: 1.6rem;
}
.empty-state h2, .delete-card h2 { margin-bottom: .5rem; font-size: 1.15rem; font-weight: 750; }
.empty-state p { margin-bottom: 1.25rem; color: var(--app-muted); }
.master-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--app-border);
}
.form-section-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.form-section-heading h2 { margin: 0; font-size: 1rem; font-weight: 750; }
.form-section-heading p { margin: .25rem 0 0; color: var(--app-muted); font-size: .78rem; }
.form-label { margin-bottom: .4rem; font-size: .8rem; font-weight: 650; }
.form-control, .form-select { min-height: 44px; border-color: var(--app-border); }
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--app-primary-rgb), .55);
  box-shadow: 0 0 0 .22rem rgba(var(--app-primary-rgb), .11);
}
.master-relation-control { display: flex; align-items: stretch; gap: .5rem; }
.master-relation-control .form-select { width: 100%; }
.relation-actions .btn {
  display: inline-grid;
  min-width: 42px;
  place-items: center;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.detail-item {
  padding: 1rem;
  border: 1px solid var(--app-border);
  border-radius: .75rem;
  background: color-mix(in srgb, var(--app-bg) 45%, transparent);
}
.detail-item dt {
  margin-bottom: .3rem;
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.detail-item dd { margin: 0; font-size: .92rem; font-weight: 650; }
.form-check-input { width: 2.4em !important; height: 1.25em; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; padding: 1.25rem 0; }
.delete-card { padding: clamp(2rem, 5vw, 3.5rem); }
.delete-icon { color: #dc2626; background: #fef2f2; }

.login-page { min-width: 320px; background: #fff; }
.login-showcase {
  position: relative;
  overflow: hidden;
  align-items: center;
  padding: clamp(3rem, 7vw, 7rem);
  color: #fff;
  background: linear-gradient(140deg, #181820 0%, color-mix(in srgb, var(--app-primary-dark) 52%, #15151d) 55%, var(--app-primary) 100%);
}
.login-showcase::before, .login-showcase::after { position: absolute; content: ""; border-radius: 50%; background: rgba(255,255,255,.06); }
.login-showcase::before { width: 420px; height: 420px; right: -180px; top: -140px; }
.login-showcase::after { width: 280px; height: 280px; left: -110px; bottom: -110px; }
.showcase-content { position: relative; z-index: 1; max-width: 590px; }
.showcase-eyebrow { color: #93c5fd; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.showcase-content h1 { max-width: 550px; margin: 1rem 0 1.35rem; font-size: clamp(2.4rem, 4.5vw, 4.25rem); font-weight: 750; letter-spacing: -.055em; line-height: 1.04; }
.showcase-content > p:not(.showcase-eyebrow) { max-width: 520px; color: #cbd5e1; font-size: 1.05rem; line-height: 1.7; }
.showcase-features { display: flex; flex-wrap: wrap; gap: .85rem 1.4rem; margin-top: 2.5rem; color: #e2e8f0; font-size: .85rem; }
.showcase-features i { margin-right: .35rem; color: #60a5fa; }
.login-form-side { padding: 2rem; background: #fff; }
.login-card { width: 100%; max-width: 430px; }
.login-card h2 { margin-bottom: .4rem; font-size: 2rem; font-weight: 750; letter-spacing: -.035em; }
.login-card .form-label { font-size: .83rem; font-weight: 650; }
.login-card .input-group-text { border-right: 0; color: #64748b; background: #f8fafc; }
.login-card .form-control { border-left: 0; font-size: .92rem; }
.login-card .form-control:focus { border-color: #dee2e6; box-shadow: none; }
.login-card .input-group:focus-within { border-radius: .5rem; box-shadow: 0 0 0 .25rem rgba(var(--app-primary-rgb), .12); }
.password-toggle { border-left: 0; }
.login-help { margin: 1.5rem 0 0; color: #94a3b8; font-size: .75rem; text-align: center; }

[data-bs-theme="dark"] {
  --app-bg: #0b1120;
  --app-border: #263247;
  --app-muted: #94a3b8;
  --app-sidebar: #111827;
}
[data-bs-theme="dark"] body { color: #e5e7eb; }
[data-bs-theme="dark"] .sidebar-nav .nav-link { color: #aeb9cb; }
[data-bs-theme="dark"] .sidebar-nav .nav-link:hover,
[data-bs-theme="dark"] .sidebar-nav .nav-link.active { color: color-mix(in srgb, var(--app-primary) 72%, white); }
[data-bs-theme="dark"] .sidebar-footer { border-top-color: rgba(255,255,255,.08); }
[data-bs-theme="dark"] .mobile-menu .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .topbar { background: rgba(15, 23, 42, .92); }
[data-bs-theme="dark"] .login-page,
[data-bs-theme="dark"] .login-form-side { background: #0f172a; }
[data-bs-theme="dark"] .login-card .input-group-text { color: #94a3b8; background: #111827; }
[data-bs-theme="dark"] .metric-icon-blue, [data-bs-theme="dark"] .quick-icon, [data-bs-theme="dark"] .status-icon { background: rgba(37,99,235,.18); }
[data-bs-theme="dark"] .metric-icon-violet { background: rgba(124,58,237,.18); }
[data-bs-theme="dark"] .metric-icon-green { background: rgba(5,150,105,.18); }
[data-bs-theme="dark"] .active-status { color: #6ee7b7; background: rgba(5,150,105,.2); }
[data-bs-theme="dark"] .inactive-status { color: #cbd5e1; background: rgba(100,116,139,.25); }
[data-bs-theme="dark"] .btn-soft-primary, [data-bs-theme="dark"] .empty-icon { background: rgba(37,99,235,.18); }
[data-bs-theme="dark"] .btn-soft-secondary { color: #cbd5e1; background: rgba(100,116,139,.18); }
[data-bs-theme="dark"] .btn-soft-danger, [data-bs-theme="dark"] .delete-icon { background: rgba(220,38,38,.18); }

@media (max-width: 991.98px) {
  .main-content { margin-left: 0; }
  .topbar { min-height: 68px; padding: .7rem 1rem; }
  .content-wrapper { padding: 1.25rem; }
}
@media (max-width: 575.98px) {
  .content-wrapper { padding: 1rem; }
  .metric-card { align-items: center; padding: 1.1rem; }
  .welcome-banner { min-height: auto; padding: 1.25rem; }
  .welcome-icon { width: 52px; height: 52px; flex-basis: 52px; border-radius: 15px; font-size: 1.25rem; }
  .panel-card { padding: 1.15rem; }
  .login-form-side { align-items: flex-start !important; padding: 2rem 1.25rem; }
  .login-card { margin-top: 1rem; }
  .master-toolbar { padding: .85rem; }
  .master-search { width: 100%; }
  .master-table thead { display: none; }
  .master-table, .master-table tbody, .master-table tr, .master-table td { display: block; width: 100%; }
  .master-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--app-border); }
  .master-table tbody tr:last-child { border-bottom: 0; }
  .master-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem 0;
    border: 0;
    text-align: right;
  }
  .master-table td::before {
    content: attr(data-label);
    color: var(--app-muted);
    font-size: .7rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
  }
  .master-table .actions-cell { justify-content: flex-end; padding-top: .75rem; }
  .master-table .actions-cell::before { display: none; }
  .master-table .actions-cell .btn { flex: 1; }
  .form-actions { position: sticky; bottom: 0; z-index: 10; margin: 0 -1rem; padding: .85rem 1rem; border-top: 1px solid var(--app-border); background: var(--bs-body-bg); }
  .form-actions .btn { flex: 1; }
  .master-relation-control { align-items: stretch; flex-direction: column; }
  .relation-actions { display: grid; grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .appearance-panel { padding: .8rem; }
  .brand-presets { grid-template-columns: repeat(2, 1fr); }
}

/* Artículos contiene más información que el resto de los maestros. En anchos
   intermedios se presenta como una rejilla de fichas para evitar una tabla
   horizontal comprimida o con desplazamiento lateral. */
@media (max-width: 1199.98px) {
  .articles-grid-wrapper { overflow: visible; }
  .articles-grid,
  .articles-grid tbody { display: block; width: 100%; }
  .articles-grid thead { display: none; }
  .articles-grid tbody {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  .articles-grid tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    overflow: hidden;
    padding: 1rem;
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--bs-body-bg);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .045);
  }
  .articles-grid tbody tr:hover {
    border-color: rgba(var(--app-primary-rgb), .28);
    background: color-mix(in srgb, var(--app-primary) 2.5%, var(--bs-body-bg));
  }
  .articles-grid tbody td {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: .25rem;
    padding: .55rem .5rem;
    border: 0;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .articles-grid tbody td::before {
    display: block;
    content: attr(data-label);
    color: var(--app-muted);
    font-size: .66rem;
    font-weight: 750;
    letter-spacing: .045em;
    line-height: 1.2;
    text-align: left;
    text-transform: uppercase;
  }
  .articles-grid tbody td:nth-child(2) {
    grid-column: 1 / -1;
    padding-top: .15rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid var(--app-border);
    font-size: 1rem;
  }
  .articles-grid .actions-cell {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
    margin-top: .55rem;
    padding-top: .85rem;
    border-top: 1px solid var(--app-border);
  }
  .articles-grid .actions-cell::before { display: none; }
  .articles-grid .actions-cell .btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
  }
  .articles-grid .actions-cell .btn span { display: inline !important; }
}

@media (max-width: 767.98px) {
  .articles-grid tbody { grid-template-columns: 1fr; gap: .85rem; padding: .85rem; }
}

@media (max-width: 420px) {
  .articles-grid tbody tr { grid-template-columns: 1fr; padding: .85rem; }
  .articles-grid tbody td:nth-child(2),
  .articles-grid .actions-cell { grid-column: 1; }
  .articles-grid .actions-cell .btn span { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .print-hidden { display: none !important; }
  .main-content { margin: 0 !important; }
  .content-wrapper { max-width: none; padding: 0; }
  .receipt-card, .panel-card { border: 1px solid #d8d8dd; box-shadow: none; }
}

.color-value {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.color-swatch {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 50%;
  background-color: var(--swatch-color);
  box-shadow: 0 0 0 2px var(--bs-body-bg);
}
input[type="color"].form-control {
  min-height: 2.75rem;
  padding: .3rem;
  cursor: pointer;
}

/* Shared, keyboard-accessible navigation and narrow-screen safeguards. */
.menu-group { margin: .2rem 0; }
.menu-group summary { display:flex; align-items:center; gap:.75rem; padding:.85rem .9rem; border-radius:12px; cursor:pointer; list-style:none; font-size:.86rem; font-weight:650; }
.menu-group summary::-webkit-details-marker { display:none; }
.menu-group summary:hover, .menu-group[open] summary { background:rgba(var(--app-primary-rgb), .09); color:var(--app-primary); }
.menu-group summary:focus-visible { outline:2px solid var(--app-primary); outline-offset:2px; }
.menu-chevron { margin-left:auto; font-size:.75rem; transition:transform .18s; }
.menu-group[open] .menu-chevron { transform:rotate(180deg); }
.menu-items { margin:.3rem .7rem .6rem 1.3rem; padding-left:.65rem; border-left:1px solid var(--app-border); }
.menu-items .nav-link { min-height:40px; padding:.55rem .7rem; font-size:.8rem; white-space:normal; }
.main-content, .content-wrapper, .panel-card, .topbar > div { min-width:0; }
.table-responsive { max-width:100%; overscroll-behavior-x:contain; }
img, canvas, svg { max-width:100%; }
.mobile-menu { --bs-offcanvas-width:min(340px, 92vw); }
input, select, textarea { max-width:100%; }
@media (max-width:575.98px) {
  .topbar { gap:.35rem; padding:.65rem .6rem; }
  .topbar > div:first-child { flex:1; gap:.35rem!important; }
  .topbar > div:last-child { flex-shrink:0; gap:.2rem!important; }
  .topbar .btn-icon { width:34px; height:38px; }
  .topbar .user-menu { padding:0; }
  .topbar .user-avatar { width:30px; height:30px; flex-basis:30px; }
  .page-title { font-size:1rem; }
  .content-wrapper { padding:1rem; }
  .panel-card { padding:1rem; }
  .d-flex.justify-content-between { flex-wrap:wrap; gap:.65rem; }
  .nav-tabs { flex-wrap:wrap; }
  .btn-group { flex-wrap:wrap; }
  .form-actions { flex-wrap:wrap; }
  .pagination { flex-wrap:wrap; }
}

@media (max-width:575.98px) { .form-actions { margin-left:0; margin-right:0; max-width:100%; } }
