/* ============================================================
   Next Matter Pro Case
   Shared design system
   One CSS file for the full platform
   ============================================================ */

:root {
  --primary: #123B6D;
  --deep: #0D2C52;
  --deep-2: #0a2545;
  --midnight: #061B33;

  --bg: #eef3f9;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;

  --text: #132238;
  --muted: #5B6B7C;
  --muted-2: #7A899A;

  --border: rgba(13, 44, 82, .10);
  --border-strong: rgba(13, 44, 82, .18);

  --shadow: 0 24px 50px rgba(13, 44, 82, .08);
  --shadow-soft: 0 12px 28px rgba(13, 44, 82, .05);

  --success: #1f6b3b;
  --success-soft: #eaf6ee;

  --warning: #9a6700;
  --warning-soft: #fff8e8;

  --danger: #8a1f1f;
  --danger-soft: #fff4f4;

  --blue-soft: #eef4fa;

  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --sidebar-width: 280px;
  --sidebar-collapsed-width: 86px;
  --topbar-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(18, 59, 109, .10), transparent 34%),
    linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

body.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  left: 18px;
  top: -80px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--deep);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
  transition: top .18s ease;
}

.skip-link:focus {
  top: 18px;
}

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

/* Sidebar */

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(220, 232, 245, .16), transparent 32%),
    linear-gradient(180deg, var(--deep) 0%, var(--midnight) 100%);
  color: #ffffff;
  border-right: 1px solid rgba(255, 255, 255, .08);
  z-index: 50;
}

.sidebar-toggle-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.sidebar-collapse-btn {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  transition: background .18s ease, transform .18s ease;
}

.sidebar-collapse-btn:hover {
  background: rgba(255, 255, 255, .13);
  transform: translateY(-1px);
}

.hamburger-shell {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.hamburger-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .11);
  margin-bottom: 22px;
}

.brand img {
  display: block;
  width: auto;
  height: auto;
  max-width: 138px;
  max-height: 42px;
  object-fit: contain;
  flex: 0 1 auto;
}

body.sidebar-collapsed .brand img {
  max-width: 42px;
  max-height: 42px;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  font-size: .92rem;
  line-height: 1.1;
  color: #ffffff;
}

.brand-copy span {
  color: #bfd7f1;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-section {
  margin-top: 18px;
}

.nav-label {
  margin: 0 0 8px;
  padding: 0 12px;
  color: rgba(255, 255, 255, .58);
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-link {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 255, 255, .82);
  border: 1px solid transparent;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .12);
  transform: translateX(2px);
}

.nav-link.active {
  color: var(--deep);
  background: #ffffff;
  border-color: rgba(255, 255, 255, .45);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .18);
  font-weight: 900;
}

.count,
.soon-badge {
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .14);
  color: inherit;
  font-size: .7rem;
  font-weight: 900;
}

.security-card {
  margin-top: 22px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
}

.security-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: .8rem;
  color: #ffffff;
}

.security-card p {
  margin: 0;
  color: rgba(255, 255, 255, .66);
  font-size: .76rem;
  line-height: 1.45;
}

/* Collapsed sidebar */

body.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 10px 6px;
}

body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .sidebar-collapse-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-link span:not(.count):not(.soon-badge),
body.sidebar-collapsed .security-card {
  display: none;
}

body.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .count,
body.sidebar-collapsed .soon-badge {
  display: none;
}

/* Main */

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--topbar-height);
  background: rgba(247, 249, 252, .86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  min-height: var(--topbar-height);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.page-title {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.page-title strong {
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--text);
}

.page-title span {
  color: var(--muted);
  font-size: .8rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-sidebar-toggle {
  display: none !important;
}

.wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

/* Components */

.page-card,
.panel,
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.page-card {
  padding: 22px;
}

.panel {
  padding: 18px;
}

.card {
  padding: 16px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title h1,
.section-title h2,
.section-title h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.18;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.btn {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: #f7fbff;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn.primary:hover {
  background: var(--deep);
}

.btn.secondary {
  background: #ffffff;
  color: var(--primary);
}

.btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(138, 31, 31, .16);
}

.pill-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

.pill-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-link {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--deep);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.profile-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Forms */

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--text);
  font-size: .78rem;
  font-weight: 900;
}

.field small {
  color: var(--muted);
}

.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea,
.textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(18, 59, 109, .36);
  box-shadow: 0 0 0 4px rgba(18, 59, 109, .09);
}

/* Tables */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: #f8fbff;
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Badges and flashes */

.badge {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  border: 1px solid transparent;
}

.badge.green {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(31, 107, 59, .14);
}

.badge.gold {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: rgba(154, 103, 0, .15);
}

.badge.red {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(138, 31, 31, .15);
}

.badge.blue,
.badge.muted {
  color: var(--primary);
  background: var(--blue-soft);
  border-color: rgba(18, 59, 109, .12);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.flash-message {
  padding: 12px 14px;
  border-radius: 16px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.flash-green {
  color: var(--success);
  background: var(--success-soft);
}

.flash-gold {
  color: var(--warning);
  background: var(--warning-soft);
}

.flash-red {
  color: var(--danger);
  background: var(--danger-soft);
}

.flash-blue,
.flash-muted {
  color: var(--primary);
  background: var(--blue-soft);
}

/* Matter hero */

.matter-hero {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(220, 232, 245, .35), transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.matter-hero-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.matter-title-area {
  min-width: 0;
}

.matter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.matter-title-area h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.08;
  color: var(--deep);
}

.matter-title-area p {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.stage-form {
  padding: 6px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.stage-form select {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--primary);
  font-size: .78rem;
  font-weight: 900;
  padding: 8px 12px;
}

/* Mobile */

@media (max-width: 980px) {
  .site-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-collapsed {
    --sidebar-width: 280px;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .sidebar-collapse-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-link span:not(.count):not(.soon-badge),
  body.sidebar-collapsed .security-card {
    display: initial;
  }

  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .security-card {
    display: grid;
  }

  body.sidebar-collapsed .nav-link {
    justify-content: space-between;
    padding: 10px 12px;
  }

  .mobile-sidebar-toggle {
    display: inline-flex !important;
  }

  .topbar-inner {
    padding: 12px 16px;
  }

  .wrap {
    width: min(100% - 28px, 1280px);
    padding-top: 16px;
  }

  .matter-hero-inner,
  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .grid.two,
  .grid.three,
  .grid.four,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .top-actions {
    gap: 7px;
  }

  .page-card,
  .panel {
    padding: 16px;
    border-radius: 20px;
  }

  .btn {
    min-height: 36px;
    padding: 8px 12px;
  }
}

/* ============================================================
   Sidebar refinement override
   Keeps labels visible when collapsed
   ============================================================ */

:root {
  --sidebar-width: 284px;
  --sidebar-collapsed-width: 132px;
}

/* Sidebar menu button: small, left-aligned, material pill */
.sidebar-toggle-row {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.sidebar-collapse-btn {
  width: auto;
  min-width: 42px;
  min-height: 34px;
  padding: 7px 10px;
  justify-content: flex-start;
  gap: 7px;
  border-radius: 999px;
}

.hamburger-shell {
  width: 18px;
  height: 18px;
}

.hamburger-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.sidebar-collapse-text {
  font-size: .74rem;
}

/* Brand logo: show actual uploaded logo without blowing up */
.brand {
  justify-content: flex-start;
  min-height: 58px;
  padding: 10px 12px;
  overflow: hidden;
}

.brand img {
  display: block;
  width: auto;
  height: auto;
  max-width: 168px;
  max-height: 46px;
  object-fit: contain;
  flex: 0 1 auto;
}

/* If uploaded logo does not include "Case", layout adds no fake second line */
.brand-copy {
  display: none;
}

/* Left-align all menu options */
.nav-link {
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.nav-link .nav-text {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
  white-space: normal;
  line-height: 1.12;
}

.nav-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.10);
  color: inherit;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link.active .nav-icon {
  background: rgba(18,59,109,.10);
  color: var(--primary);
}

/* Collapsed sidebar should still show labels, just smaller */
body.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar {
  padding-left: 10px;
  padding-right: 10px;
}

body.sidebar-collapsed .sidebar-toggle-row {
  justify-content: flex-start;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  justify-content: flex-start;
}

body.sidebar-collapsed .sidebar-collapse-text {
  display: inline;
  font-size: .62rem;
}

body.sidebar-collapsed .brand {
  justify-content: flex-start;
  padding: 8px;
  min-height: 46px;
}

body.sidebar-collapsed .brand img {
  max-width: 96px;
  max-height: 34px;
}

body.sidebar-collapsed .brand-copy {
  display: none;
}

body.sidebar-collapsed .nav-label {
  display: block;
  padding: 0 6px;
  font-size: .5rem;
  letter-spacing: .08em;
}

body.sidebar-collapsed .nav-link {
  min-height: 38px;
  padding: 7px 8px;
  justify-content: flex-start;
  gap: 6px;
  border-radius: 16px;
}

body.sidebar-collapsed .nav-link .nav-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
}

body.sidebar-collapsed .nav-link .nav-icon svg {
  width: 13px;
  height: 13px;
}

body.sidebar-collapsed .nav-link .nav-text {
  display: block;
  font-size: .57rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.sidebar-collapsed .security-card {
  display: block;
  padding: 9px;
  border-radius: 14px;
}

body.sidebar-collapsed .security-card strong {
  font-size: .58rem;
  line-height: 1.1;
}

body.sidebar-collapsed .security-card p {
  display: none;
}

/* Mobile should still behave like an overlay drawer */
@media (max-width: 980px) {
  body.sidebar-collapsed {
    --sidebar-width: 284px;
  }

  body.sidebar-collapsed .sidebar {
    padding: 16px;
  }

  body.sidebar-collapsed .brand img {
    max-width: 168px;
    max-height: 46px;
  }

  body.sidebar-collapsed .nav-label {
    font-size: .66rem;
    letter-spacing: .13em;
    padding: 0 12px;
  }

  body.sidebar-collapsed .nav-link {
    min-height: 42px;
    padding: 10px 12px;
    gap: 10px;
    border-radius: 999px;
  }

  body.sidebar-collapsed .nav-link .nav-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  body.sidebar-collapsed .nav-link .nav-icon svg {
    width: 16px;
    height: 16px;
  }

  body.sidebar-collapsed .nav-link .nav-text {
    font-size: .82rem;
  }

  body.sidebar-collapsed .security-card {
    display: block;
    padding: 14px;
    border-radius: 20px;
  }

  body.sidebar-collapsed .security-card p {
    display: block;
  }
}

/* ============================================================
   Sidebar collapsed icon + brand text fix
   ============================================================ */

/* Show brand text beside the uploaded logo */
.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  color: #ffffff;
  font-size: .82rem;
  line-height: 1.05;
  font-weight: 900;
  white-space: nowrap;
}

.brand-copy span {
  display: block;
  color: #bfd7f1;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Keep uploaded logo controlled now that text is beside it */
.brand img {
  max-width: 54px;
  max-height: 42px;
  width: auto;
  height: auto;
  flex: 0 0 auto;
}

/* Important: older collapsed rule hides spans. Undo that for nav icons/text. */
body.sidebar-collapsed .nav-link .nav-icon,
body.sidebar-collapsed .nav-link .nav-icon svg,
body.sidebar-collapsed .nav-link .nav-text {
  display: grid;
}

body.sidebar-collapsed .nav-link .nav-text {
  display: block;
}

/* Collapsed brand should still show logo and compact text */
body.sidebar-collapsed .brand {
  gap: 6px;
}

body.sidebar-collapsed .brand img {
  max-width: 30px;
  max-height: 30px;
}

body.sidebar-collapsed .brand-copy {
  display: grid;
}

body.sidebar-collapsed .brand-copy strong {
  font-size: .54rem;
  line-height: 1.02;
  white-space: normal;
}

body.sidebar-collapsed .brand-copy span {
  font-size: .46rem;
  letter-spacing: .08em;
}

/* Force collapsed menu icons to remain visible */
body.sidebar-collapsed .nav-icon {
  display: grid !important;
  width: 22px;
  height: 22px;
  min-width: 22px;
  place-items: center;
}

body.sidebar-collapsed .nav-icon svg {
  display: block !important;
  width: 13px;
  height: 13px;
}

/* Force collapsed labels to remain visible beside icons */
body.sidebar-collapsed .nav-text {
  display: block !important;
  font-size: .57rem;
  line-height: 1.05;
  font-weight: 800;
}

/* Keep mobile drawer full-size */
@media (max-width: 980px) {
  .brand img {
    max-width: 54px;
    max-height: 42px;
  }

  body.sidebar-collapsed .brand img {
    max-width: 54px;
    max-height: 42px;
  }

  body.sidebar-collapsed .brand-copy strong {
    font-size: .82rem;
    white-space: nowrap;
  }

  body.sidebar-collapsed .brand-copy span {
    font-size: .56rem;
    letter-spacing: .14em;
  }
}

/* ============================================================
   Collapsed sidebar: icons-only clean mode
   ============================================================ */

body.sidebar-collapsed {
  --sidebar-width: 86px;
}

body.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

body.sidebar-collapsed .sidebar-toggle-row {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-collapse-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-collapse-text {
  display: none !important;
}

body.sidebar-collapsed .brand {
  justify-content: center;
  padding: 8px 0 14px;
  min-height: 52px;
}

body.sidebar-collapsed .brand img {
  max-width: 42px;
  max-height: 42px;
}

body.sidebar-collapsed .brand-copy {
  display: none !important;
}

body.sidebar-collapsed .nav-section {
  margin-top: 14px;
}

body.sidebar-collapsed .nav-label {
  display: none !important;
}

body.sidebar-collapsed .nav-list {
  gap: 8px;
}

body.sidebar-collapsed .nav-link {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  margin: 0 auto;
  justify-content: center;
  border-radius: 18px;
}

body.sidebar-collapsed .nav-link .nav-text {
  display: none !important;
}

body.sidebar-collapsed .nav-icon {
  display: grid !important;
  width: 30px;
  height: 30px;
  min-width: 30px;
  place-items: center;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-icon svg {
  display: block !important;
  width: 17px;
  height: 17px;
}

body.sidebar-collapsed .security-card {
  display: none !important;
}

/* Keep full sidebar behavior on mobile drawer */
@media (max-width: 980px) {
  body.sidebar-collapsed {
    --sidebar-width: 284px;
  }

  body.sidebar-collapsed .sidebar {
    padding: 16px;
  }

  body.sidebar-collapsed .sidebar-toggle-row {
    justify-content: flex-start;
  }

  body.sidebar-collapsed .sidebar-collapse-btn {
    width: auto;
    height: auto;
    min-width: 42px;
    min-height: 34px;
    padding: 7px 10px;
    justify-content: flex-start;
  }

  body.sidebar-collapsed .sidebar-collapse-text {
    display: inline !important;
  }

  body.sidebar-collapsed .brand {
    justify-content: flex-start;
    padding: 10px 12px;
    min-height: 58px;
  }

  body.sidebar-collapsed .brand img {
    max-width: 54px;
    max-height: 42px;
  }

  body.sidebar-collapsed .brand-copy {
    display: grid !important;
  }

  body.sidebar-collapsed .nav-label {
    display: block !important;
  }

  body.sidebar-collapsed .nav-link {
    width: auto;
    height: auto;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    justify-content: flex-start;
    border-radius: 999px;
  }

  body.sidebar-collapsed .nav-link .nav-text {
    display: block !important;
  }

  body.sidebar-collapsed .security-card {
    display: block !important;
  }
}

