/* ==========================================================================
   Qanoonak Dashboard — Apple Liquid Glass workspace
   RTL Arabic · six role experiences · local-first
   ========================================================================== */

:root {
  --navy: #0f172a;
  --navy-2: #111c33;
  --royal: #2563eb;
  --royal-2: #4338ca;
  --gold: #d9b44a;
  --emerald: #10b981;
  --cyan: #06b6d4;
  --violet: #8b5cf6;
  --rose: #f43f5e;
  --amber: #f59e0b;

  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: rgba(255, 255, 255, 0.66);
  --line-soft: rgba(148, 163, 184, 0.18);
  --surface: rgba(255, 255, 255, 0.66);
  --surface-strong: rgba(255, 255, 255, 0.84);
  --surface-soft: rgba(248, 250, 255, 0.5);
  --sidebar-width: 286px;
  --radius: 1.5rem;
  --radius-sm: 1rem;
  --glass-shadow: 0 24px 70px -32px rgba(15, 23, 42, 0.38), 0 10px 28px -22px rgba(15, 23, 42, 0.26);
  --glass-shadow-soft: 0 16px 40px -30px rgba(15, 23, 42, 0.28);
  --focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.11);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 8.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #e9f0fa;
  color: var(--text);
  font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(37, 99, 235, 0.18); }

:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.65);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  right: 1rem;
  z-index: 200;
  transform: translateY(-140%);
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  padding: 0.7rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 800;
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }

/* --------------------------------------------------------------------------
   Ambient background
   -------------------------------------------------------------------------- */
.dash-ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 4%, rgba(191, 219, 254, 0.72), transparent 34%),
    radial-gradient(circle at 8% 8%, rgba(224, 231, 255, 0.8), transparent 30%),
    linear-gradient(135deg, #eef4fc 0%, #e8eff9 45%, #eef3f8 100%);
}

.ambient-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(4px);
  opacity: 0.72;
  animation: orbFloat 18s ease-in-out infinite alternate;
}
.ambient-orb--blue {
  width: 34rem; height: 34rem;
  top: -14rem; left: -8rem;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22), transparent 68%);
}
.ambient-orb--gold {
  width: 26rem; height: 26rem;
  bottom: 6rem; right: -9rem;
  background: radial-gradient(circle, rgba(217, 180, 74, 0.16), transparent 68%);
  animation-delay: -6s;
}
.ambient-orb--mint {
  width: 24rem; height: 24rem;
  top: 42%; left: 36%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.09), transparent 68%);
  animation-delay: -11s;
}
.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.13) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

@keyframes orbFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2.5rem, 1.8rem, 0) scale(1.08); }
}

/* --------------------------------------------------------------------------
   Shell + top bar
   -------------------------------------------------------------------------- */
.dashboard-app {
  width: min(100%, 1640px);
  margin-inline: auto;
  padding: 0.85rem 1rem 2rem;
}

.dash-topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.85rem;
  min-height: 72px;
  padding: 0.65rem 0.75rem 0.65rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 1.55rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
    rgba(255, 255, 255, 0.55);
  box-shadow:
    0 22px 60px -38px rgba(15, 23, 42, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.topbar-menu-btn { display: none; }

.dash-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 1rem;
  padding: 0.2rem;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 52%),
    linear-gradient(140deg, #1d4ed8, #2563eb 48%, #0f172a);
  box-shadow:
    0 12px 28px -14px rgba(37, 99, 235, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.brand-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #e6c76a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.38);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-size: 1.13rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.brand-sub {
  margin-top: 0.22rem;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7c8ba3;
  white-space: nowrap;
}

/* Role switcher */
.role-switcher {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(241, 245, 249, 0.6);
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.04),
    0 1px 0 rgba(255, 255, 255, 0.7);
  overflow-x: auto;
  scrollbar-width: none;
}
.role-switcher::-webkit-scrollbar { display: none; }

.role-pill {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.38rem;
  padding: 0.5rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.role-pill:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.68);
}
.role-pill.is-active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, #1e40af, #2563eb 58%, #3b82f6);
  box-shadow:
    0 9px 22px -12px rgba(37, 99, 235, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}
.role-pill__icon {
  display: grid;
  width: 20px; height: 20px;
  place-items: center;
  border-radius: 7px;
  background: rgba(148, 163, 184, 0.1);
}
.role-pill.is-active .role-pill__icon {
  background: rgba(255, 255, 255, 0.16);
}
.role-pill svg { width: 13px; height: 13px; stroke-width: 2.2; }
.role-dot {
  position: absolute;
  top: 4px; left: 5px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

/* Topbar actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
}

.dash-search {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  height: 40px;
  padding: 0 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.03);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.dash-search:focus-within {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--focus-ring);
}
.dash-search-icon { color: #94a3b8; flex: 0 0 auto; }
.dash-search input {
  width: 132px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--navy);
  font-size: 0.74rem;
  font-weight: 600;
}
.dash-search input::placeholder { color: #9aa8ba; }
.dash-search kbd {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 6px;
  padding: 0.06rem 0.28rem;
  background: rgba(255, 255, 255, 0.7);
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.55rem;
  white-space: nowrap;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
  color: #475569;
  box-shadow:
    0 7px 18px -14px rgba(15, 23, 42, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transition: transform 170ms ease, background 170ms ease, color 170ms ease, box-shadow 170ms ease;
}
.icon-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.9);
  color: var(--royal);
  box-shadow:
    0 12px 26px -16px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}
.icon-btn:active { transform: translateY(0) scale(0.97); }

.notification-count {
  position: absolute;
  top: -4px; left: -4px;
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  border: 2px solid #f2f6fc;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 900;
  line-height: 1;
}

/* Session chip */
.session-chip-wrap { position: relative; }

.session-chip {
  display: flex;
  align-items: center;
  gap: 0.52rem;
  max-width: 220px;
  padding: 0.24rem 0.34rem 0.24rem 0.62rem;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--navy);
  box-shadow:
    0 8px 22px -18px rgba(15, 23, 42, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  transition: background 180ms ease, transform 180ms ease;
}
.session-chip:hover { background: rgba(255, 255, 255, 0.92); transform: translateY(-1px); }
.session-avatar {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  box-shadow: 0 4px 10px -6px rgba(15, 23, 42, 0.4);
}
.session-avatar img,
.avatar-sm img,
.avatar-xs img,
.sidebar-avatar img,
.person-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.session-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.18;
}
.session-name {
  max-width: 118px;
  overflow: hidden;
  color: var(--navy);
  font-size: 0.71rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-role {
  margin-top: 0.12rem;
  color: #7b8aa1;
  font-size: 0.56rem;
  font-weight: 700;
  white-space: nowrap;
}
.session-chevron { color: #94a3b8; flex: 0 0 auto; }

.session-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  z-index: 90;
  width: 245px;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 26px 60px -24px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: menuIn 160ms ease both;
}
.session-menu__head {
  padding: 0.65rem 0.6rem 0.7rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
  margin-bottom: 0.35rem;
}
.session-menu__head strong { display: block; color: var(--navy); font-size: 0.8rem; }
.session-menu__head span { display: block; color: var(--muted); font-size: 0.63rem; margin-top: 0.15rem; }
.session-menu__item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.7rem;
  padding: 0.52rem 0.6rem;
  background: transparent;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  transition: background 160ms ease, color 160ms ease;
}
.session-menu__item:hover { background: rgba(239, 246, 255, 0.8); color: var(--royal); }
.session-menu__item.is-danger:hover { background: rgba(254, 242, 242, 0.9); color: #dc2626; }
.session-menu__item svg { width: 14px; height: 14px; }

@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   Layout + glass sidebar
   -------------------------------------------------------------------------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  align-items: start;
  gap: 1.1rem;
  margin-top: 1.1rem;
}

.dash-sidebar {
  position: sticky;
  top: 6.2rem;
  display: flex;
  max-height: calc(100vh - 7.4rem);
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 1.85rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, 0.18), transparent 34%),
    linear-gradient(160deg, rgba(17, 28, 51, 0.96), rgba(15, 23, 42, 0.93) 55%, rgba(9, 14, 27, 0.96));
  color: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 30px 70px -34px rgba(15, 23, 42, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.dash-sidebar::-webkit-scrollbar { width: 5px; }
.dash-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
.sidebar-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), transparent 28%, transparent 74%, rgba(255, 255, 255, 0.03));
}

.sidebar-user { position: relative; z-index: 1; }
.sidebar-user-card {
  position: relative;
  overflow: hidden;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.25), transparent 44%),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}
.sidebar-user-card::after {
  content: "";
  position: absolute;
  top: -35px; left: -35px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(217, 180, 74, 0.1);
  filter: blur(14px);
}
.sidebar-user-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.sidebar-avatar {
  width: 52px; height: 52px;
  flex: 0 0 52px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 1.05rem;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.7);
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  overflow: hidden;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user-role {
  margin-top: 0.2rem;
  color: #a9b9d0;
  font-size: 0.63rem;
  font-weight: 600;
}
.sidebar-user-org {
  margin-top: 0.1rem;
  color: #7e90aa;
  font-size: 0.56rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-badge-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.72rem;
}
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0.22rem 0.42rem;
  background: rgba(255, 255, 255, 0.06);
  color: #c6d3e5;
  font-size: 0.53rem;
  font-weight: 700;
}
.sidebar-badge.is-live { color: #86efac; border-color: rgba(52, 211, 153, 0.18); background: rgba(16, 185, 129, 0.1); }
.sidebar-badge.is-preview { color: #fde68a; border-color: rgba(251, 191, 36, 0.16); background: rgba(245, 158, 11, 0.1); }
.sidebar-return {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  border: 1px solid rgba(147, 197, 253, 0.22);
  border-radius: 0.72rem;
  padding: 0.42rem;
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-size: 0.61rem;
  font-weight: 800;
  transition: background 160ms ease;
}
.sidebar-return:hover { background: rgba(37, 99, 235, 0.26); }

/* Sidebar navigation */
.sidebar-nav { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 0.65rem; }
.sidebar-group { display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-group-label {
  padding: 0 0.55rem;
  margin-bottom: 0.18rem;
  color: #6f819b;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.sidebar-link {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 0.82rem;
  padding: 0.48rem 0.52rem;
  background: transparent;
  color: #aebdd2;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: right;
  transition: background 170ms ease, color 170ms ease, border-color 170ms ease, transform 170ms ease;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  transform: translateX(-2px);
}
.sidebar-icon {
  display: grid;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.055);
  color: #8ea4c2;
  transition: background 170ms ease, color 170ms ease;
}
.sidebar-link svg { width: 14px; height: 14px; }
.sidebar-link.is-active {
  border-color: rgba(147, 197, 253, 0.16);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(37, 99, 235, 0.08));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.sidebar-link.is-active .sidebar-icon {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 5px 12px -7px rgba(37, 99, 235, 0.9);
}
.sidebar-count {
  margin-inline-start: auto;
  min-width: 18px;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: #cbd5e1;
  font-size: 0.54rem;
  text-align: center;
}
.sidebar-link.is-active .sidebar-count { background: rgba(255, 255, 255, 0.18); color: #fff; }

.sidebar-footer { position: relative; z-index: 1; margin-top: auto; display: grid; gap: 0.55rem; }
.sidebar-support {
  padding: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-support-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #dbeafe;
  font-size: 0.68rem;
  font-weight: 800;
}
.sidebar-support p { margin: 0.32rem 0 0.55rem; color: #8799b2; font-size: 0.58rem; line-height: 1.65; }
.sidebar-support-links { display: grid; gap: 0.34rem; }
.sidebar-support a {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: #93c5fd;
  font-size: 0.59rem;
  font-weight: 800;
}
.sidebar-protection {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  color: #64748b;
  font-size: 0.53rem;
}
.sidebar-protection svg { color: #34d399; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Main column */
.dash-main { min-width: 0; }

/* Demo / preview strip */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 1.05rem;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(238, 242, 255, 0.78));
  box-shadow: 0 10px 30px -24px rgba(37, 99, 235, 0.32);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: fadeUp 320ms ease both;
}
.demo-banner__icon {
  display: grid;
  width: 34px; height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1d4ed8;
}
.demo-banner__icon svg { width: 16px; height: 16px; }
.demo-banner__copy { min-width: 0; flex: 1; }
.demo-banner__copy strong {
  display: block;
  color: #1e3a8a;
  font-size: 0.75rem;
  font-weight: 900;
}
.demo-banner__copy p {
  margin: 0.13rem 0 0;
  color: #64748b;
  font-size: 0.65rem;
  line-height: 1.55;
}
.demo-banner__actions { display: flex; gap: 0.4rem; flex: 0 0 auto; }

/* Page header */
.page-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0.2rem 1rem;
  animation: fadeUp 380ms ease both;
}
.page-header__copy { min-width: 0; }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.42rem;
  color: #2563eb;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.page-eyebrow svg { width: 13px; height: 13px; }
.page-title {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.page-title span {
  background: linear-gradient(120deg, #1d4ed8, #2563eb 48%, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-subtitle {
  max-width: 680px;
  margin: 0.42rem 0 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.75;
}
.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.page-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 0.28rem 0.5rem;
  background: rgba(255, 255, 255, 0.52);
  color: #64748b;
  font-size: 0.6rem;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.page-meta__item svg { width: 12px; height: 12px; color: #2563eb; }
.page-meta__item.is-live { color: #047857; }
.page-meta__item.is-live svg { color: #10b981; }
.page-header__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  flex: 0 0 auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  border: 1px solid transparent;
  border-radius: 0.78rem;
  padding: 0.58rem 0.8rem;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease, border-color 170ms ease, color 170ms ease;
}
.btn svg { width: 14px; height: 14px; stroke-width: 2.2; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-primary {
  border-color: rgba(37, 99, 235, 0.4);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 52%),
    linear-gradient(135deg, #1e40af, #2563eb 58%, #3b82f6);
  color: #fff;
  box-shadow:
    0 12px 28px -14px rgba(37, 99, 235, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}
.btn-primary:hover {
  box-shadow:
    0 16px 34px -14px rgba(37, 99, 235, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-glass {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.62);
  color: #334155;
  box-shadow:
    0 7px 18px -14px rgba(15, 23, 42, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.94); color: #1d4ed8; }

.btn-dark {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  box-shadow: 0 12px 26px -16px rgba(15, 23, 42, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-dark:hover { background: linear-gradient(135deg, #172033, #273449); }

.btn-emerald {
  background: linear-gradient(135deg, #047857, #10b981);
  border-color: rgba(16, 185, 129, 0.35);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(16, 185, 129, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-amber {
  background: linear-gradient(135deg, #b45309, #f59e0b);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fff;
  box-shadow: 0 10px 24px -14px rgba(245, 158, 11, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-danger {
  border-color: rgba(244, 63, 94, 0.2);
  background: rgba(255, 241, 242, 0.8);
  color: #be123c;
}
.btn-danger:hover { background: rgba(255, 228, 230, 0.92); }
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: #64748b;
}
.btn-ghost:hover { background: rgba(241, 245, 249, 0.8); color: #1d4ed8; }
.btn-sm { border-radius: 0.6rem; padding: 0.38rem 0.55rem; font-size: 0.6rem; gap: 0.28rem; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-block { width: 100%; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.2rem;
  background: transparent;
  color: #2563eb;
  font-size: 0.62rem;
  font-weight: 800;
}
.text-btn:hover { color: #1e40af; text-decoration: underline; text-underline-offset: 3px; }
.text-btn svg { width: 12px; height: 12px; }

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.metric-card {
  position: relative;
  overflow: hidden;
  padding: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 1.3rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.58));
  box-shadow:
    0 16px 42px -30px rgba(15, 23, 42, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: transform 210ms ease, box-shadow 210ms ease, border-color 210ms ease;
  animation: fadeUp 420ms ease both;
}
.metric-card:nth-child(2) { animation-delay: 45ms; }
.metric-card:nth-child(3) { animation-delay: 90ms; }
.metric-card:nth-child(4) { animation-delay: 135ms; }
.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(191, 219, 254, 0.95);
  box-shadow:
    0 24px 52px -30px rgba(37, 99, 235, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.metric-card::before {
  content: "";
  position: absolute;
  top: -45px; left: -30px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--metric-glow, rgba(37, 99, 235, 0.12));
  filter: blur(18px);
}
.metric-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
}
.metric-icon {
  display: grid;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.8rem;
  background: var(--metric-bg, linear-gradient(135deg, #dbeafe, #e0e7ff));
  color: var(--metric-color, #1d4ed8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.metric-icon svg { width: 17px; height: 17px; stroke-width: 2.1; }
.metric-label {
  margin-top: 0.68rem;
  color: #64748b;
  font-size: 0.63rem;
  font-weight: 800;
}
.metric-value-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.13rem;
}
.metric-value {
  color: var(--navy);
  font-size: 1.72rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.1;
}
.metric-unit { color: #94a3b8; font-size: 0.58rem; font-weight: 700; }
.metric-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.metric-note {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  color: #64748b;
  font-size: 0.56rem;
  font-weight: 700;
}
.metric-note svg { width: 11px; height: 11px; }
.metric-note.is-up { color: #047857; }
.metric-note.is-warn { color: #b45309; }
.metric-progress {
  height: 4px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}
.metric-progress span {
  display: block;
  height: 100%;
  width: var(--progress, 50%);
  border-radius: inherit;
  background: var(--metric-bar, linear-gradient(90deg, #2563eb, #60a5fa));
  box-shadow: 0 0 12px var(--metric-glow, rgba(37, 99, 235, 0.42));
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.metric-card.tone-emerald { --metric-glow: rgba(16, 185, 129, 0.14); --metric-bg: linear-gradient(135deg, #d1fae5, #ecfdf5); --metric-color: #047857; --metric-bar: linear-gradient(90deg, #059669, #34d399); }
.metric-card.tone-amber { --metric-glow: rgba(245, 158, 11, 0.15); --metric-bg: linear-gradient(135deg, #fef3c7, #fffbeb); --metric-color: #b45309; --metric-bar: linear-gradient(90deg, #d97706, #fbbf24); }
.metric-card.tone-violet { --metric-glow: rgba(139, 92, 246, 0.14); --metric-bg: linear-gradient(135deg, #ede9fe, #f5f3ff); --metric-color: #6d28d9; --metric-bar: linear-gradient(90deg, #7c3aed, #a78bfa); }
.metric-card.tone-cyan { --metric-glow: rgba(6, 182, 212, 0.14); --metric-bg: linear-gradient(135deg, #cffafe, #ecfeff); --metric-color: #0e7490; --metric-bar: linear-gradient(90deg, #0891b2, #22d3ee); }
.metric-card.tone-rose { --metric-glow: rgba(244, 63, 94, 0.12); --metric-bg: linear-gradient(135deg, #ffe4e6, #fff1f2); --metric-color: #be123c; --metric-bar: linear-gradient(90deg, #e11d48, #fb7185); }

/* Content scaffolding */
.dashboard-content { display: flex; flex-direction: column; gap: 0.9rem; }
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(280px, 0.88fr);
  gap: 0.9rem;
  align-items: start;
}
.content-grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.dash-section { scroll-margin-top: 7.6rem; animation: fadeUp 430ms ease both; }

.glass-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.35rem;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.62));
  box-shadow:
    0 18px 48px -34px rgba(15, 23, 42, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}
.glass-card--flush { padding: 0; }
.glass-card--dark {
  border-color: rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.26), transparent 38%),
    linear-gradient(150deg, rgba(17, 28, 51, 0.97), rgba(15, 23, 42, 0.94));
  color: #e2e8f0;
  box-shadow: 0 24px 58px -34px rgba(15, 23, 42, 0.76), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.glass-card--accent {
  border-color: rgba(191, 219, 254, 0.8);
  background:
    radial-gradient(circle at 0% 0%, rgba(219, 234, 254, 0.9), transparent 36%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(239, 246, 255, 0.7));
}
.glass-card--gold {
  border-color: rgba(253, 230, 138, 0.75);
  background:
    radial-gradient(circle at 0% 0%, rgba(254, 243, 199, 0.9), transparent 38%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 251, 235, 0.68));
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.card-head__copy { min-width: 0; }
.card-head__title-row { display: flex; align-items: center; gap: 0.45rem; }
.card-head-icon {
  display: grid;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 0.65rem;
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
}
.card-head-icon svg { width: 14px; height: 14px; }
.card-head h2, .card-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: -0.015em;
}
.card-head p {
  margin: 0.22rem 0 0;
  color: #7b8aa1;
  font-size: 0.62rem;
  line-height: 1.6;
}
.card-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.24rem;
  color: #2563eb;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.card-actions { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; }
.glass-card--dark .card-head h2,
.glass-card--dark .card-head h3 { color: #fff; }
.glass-card--dark .card-head p { color: #94a3b8; }
.glass-card--dark .card-head-icon { background: rgba(255, 255, 255, 0.08); color: #93c5fd; }

.card-body { position: relative; z-index: 1; }
.card-divider { height: 1px; margin: 0.8rem 0; background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.22), transparent); }

/* Tables */
.table-shell {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.72);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.42);
}
.table-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.3) transparent; }
.table-scroll::-webkit-scrollbar { height: 5px; }
.table-scroll::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 999px; }
.data-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: right;
}
.data-table th {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.78);
  background: rgba(248, 250, 252, 0.64);
  color: #8493a8;
  font-size: 0.56rem;
  font-weight: 800;
  white-space: nowrap;
}
.data-table td {
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  color: #475569;
  font-size: 0.64rem;
  font-weight: 600;
  vertical-align: middle;
}
.data-table tbody tr { transition: background 150ms ease; }
.data-table tbody tr:hover { background: rgba(239, 246, 255, 0.6); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.24rem; }
.row-title {
  display: block;
  color: #1e293b;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.4;
}
.row-sub {
  display: block;
  margin-top: 0.12rem;
  color: #94a3b8;
  font-size: 0.54rem;
  font-weight: 600;
  white-space: nowrap;
}
.person-cell { display: flex; align-items: center; gap: 0.45rem; min-width: 126px; }
.person-avatar {
  width: 30px; height: 30px;
  flex: 0 0 30px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  box-shadow: 0 4px 8px -6px rgba(15, 23, 42, 0.35);
}
.avatar-xs { width: 28px; height: 28px; border-radius: 0.5rem; overflow: hidden; flex: 0 0 28px; }
.avatar-sm { width: 38px; height: 38px; border-radius: 0.7rem; overflow: hidden; flex: 0 0 38px; }
.table-empty { padding: 1.3rem; color: #94a3b8; font-size: 0.67rem; text-align: center; }
.table-link { color: #1d4ed8; font-weight: 800; }
.table-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.mobile-table-hint { display: none; color: #94a3b8; font-size: 0.54rem; padding: 0.4rem 0.65rem 0; }

/* Status + pills */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.54rem;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
}
.status-badge::before {
  content: "";
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.status--green { color: #047857; border-color: rgba(16, 185, 129, 0.18); background: rgba(209, 250, 229, 0.58); }
.status--amber { color: #b45309; border-color: rgba(245, 158, 11, 0.2); background: rgba(254, 243, 199, 0.6); }
.status--red { color: #be123c; border-color: rgba(244, 63, 94, 0.18); background: rgba(255, 228, 230, 0.58); }
.status--blue { color: #1d4ed8; border-color: rgba(37, 99, 235, 0.16); background: rgba(219, 234, 254, 0.65); }
.status--violet { color: #6d28d9; border-color: rgba(139, 92, 246, 0.17); background: rgba(237, 233, 254, 0.65); }
.status--slate { color: #475569; border-color: rgba(148, 163, 184, 0.2); background: rgba(241, 245, 249, 0.72); }
.status--cyan { color: #0e7490; border-color: rgba(6, 182, 212, 0.18); background: rgba(207, 250, 254, 0.62); }

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 0.2rem 0.42rem;
  background: rgba(255, 255, 255, 0.52);
  color: #64748b;
  font-size: 0.52rem;
  font-weight: 700;
}
.mini-pill svg { width: 10px; height: 10px; }
.mini-pill--blue { color: #1d4ed8; background: rgba(219, 234, 254, 0.62); border-color: rgba(191, 219, 254, 0.7); }
.mini-pill--gold { color: #a16207; background: rgba(254, 243, 199, 0.66); border-color: rgba(253, 230, 138, 0.68); }

/* Case spotlight */
.case-spotlight {
  position: relative;
  overflow: hidden;
  padding: 1.05rem;
  border: 1px solid rgba(147, 197, 253, 0.2);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.32), transparent 42%),
    radial-gradient(circle at 0% 100%, rgba(124, 58, 237, 0.18), transparent 42%),
    linear-gradient(150deg, #101a2f, #0f172a 58%, #0b1222);
  color: #e2e8f0;
  box-shadow:
    0 24px 58px -32px rgba(15, 23, 42, 0.78),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.case-spotlight::after {
  content: "";
  position: absolute;
  left: -35px; bottom: -60px;
  width: 180px; height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(255, 255, 255, 0.02), 0 0 0 50px rgba(255, 255, 255, 0.014);
  pointer-events: none;
}
.spotlight-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.spotlight-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #93c5fd;
  font-size: 0.57rem;
  font-weight: 800;
}
.spotlight-kicker::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
}
.case-ref {
  border: 1px solid rgba(147, 197, 253, 0.18);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  background: rgba(37, 99, 235, 0.14);
  color: #bfdbfe;
  font-family: "Tajawal", sans-serif;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.case-spotlight h3 {
  position: relative;
  z-index: 1;
  margin: 0.62rem 0 0;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}
.case-spotlight__sub {
  position: relative;
  z-index: 1;
  margin: 0.28rem 0 0;
  color: #94a3b8;
  font-size: 0.65rem;
  line-height: 1.65;
}
.case-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.68rem;
}
.case-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.5rem;
  padding: 0.26rem 0.42rem;
  background: rgba(255, 255, 255, 0.045);
  color: #cbd5e1;
  font-size: 0.56rem;
  font-weight: 600;
}
.case-meta svg { width: 11px; height: 11px; color: #93c5fd; }
.case-steps {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 1rem;
}
.case-step {
  position: relative;
  padding-top: 0.9rem;
  color: #64748b;
  font-size: 0.52rem;
  font-weight: 700;
  text-align: center;
}
.case-step::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.09);
}
.case-step:first-child::before { right: auto; left: 0; width: 50%; }
.case-step:last-child::before { width: 50%; }
.case-step::after {
  content: "";
  position: absolute;
  top: -4px; right: calc(50% - 5px);
  width: 10px; height: 10px;
  border: 2px solid #0f172a;
  border-radius: 50%;
  background: #334155;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.case-step.is-done { color: #86efac; }
.case-step.is-done::before { background: rgba(52, 211, 153, 0.45); }
.case-step.is-done::after { background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.case-step.is-current { color: #fff; }
.case-step.is-current::after {
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18), 0 0 14px rgba(96, 165, 250, 0.8);
  animation: pulseStep 1.8s ease-in-out infinite;
}
.case-step.is-current::before { background: linear-gradient(90deg, rgba(52, 211, 153, 0.45), rgba(96, 165, 250, 0.55)); }
@keyframes pulseStep {
  0%, 100% { box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14), 0 0 10px rgba(96, 165, 250, 0.6); }
  50% { box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.08), 0 0 18px rgba(96, 165, 250, 0.85); }
}
.spotlight-lawyer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.spotlight-lawyer__person { display: flex; align-items: center; gap: 0.45rem; }
.spotlight-lawyer__person strong { display: block; color: #e2e8f0; font-size: 0.63rem; }
.spotlight-lawyer__person span { display: block; margin-top: 0.1rem; color: #7e90aa; font-size: 0.52rem; }

/* Upcoming appointment */
.upcoming-card { position: relative; overflow: hidden; }
.upcoming-main {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.date-block {
  display: grid;
  width: 68px; height: 76px;
  flex: 0 0 68px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(147, 197, 253, 0.24);
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.date-day { color: #fff; font-size: 1.55rem; font-weight: 900; line-height: 1; }
.date-month { margin-top: 0.18rem; color: #93c5fd; font-size: 0.52rem; font-weight: 800; }
.upcoming-body { min-width: 0; flex: 1; }
.upcoming-body h3 { margin: 0; color: #fff; font-size: 0.83rem; font-weight: 900; line-height: 1.4; }
.upcoming-body p { margin: 0.22rem 0 0; color: #94a3b8; font-size: 0.59rem; line-height: 1.5; }
.upcoming-meta { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }
.upcoming-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: #cbd5e1;
  font-size: 0.53rem;
  font-weight: 600;
}
.upcoming-meta svg { width: 10px; height: 10px; color: #93c5fd; }
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.7rem;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 999px;
  padding: 0.24rem 0.48rem;
  background: rgba(16, 185, 129, 0.1);
  color: #86efac;
  font-size: 0.54rem;
  font-weight: 800;
}
.countdown svg { width: 11px; height: 11px; }
.countdown.is-soon { color: #fde68a; border-color: rgba(251, 191, 36, 0.18); background: rgba(245, 158, 11, 0.1); }
.upcoming-actions { display: flex; gap: 0.35rem; margin-top: 0.75rem; }

/* Timeline */
.timeline { position: relative; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 50px 18px minmax(0, 1fr);
  gap: 0.42rem;
  align-items: start;
  padding: 0.55rem 0;
}
.timeline-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.7rem;
  right: 58px;
  bottom: -0.1rem;
  width: 1px;
  background: linear-gradient(rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0.04));
}
.timeline-date { color: #94a3b8; font-size: 0.53rem; font-weight: 700; text-align: left; direction: ltr; padding-top: 0.18rem; }
.timeline-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 18px; height: 18px;
  place-items: center;
  border: 1px solid rgba(191, 219, 254, 0.8);
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
}
.timeline-dot svg { width: 9px; height: 9px; }
.timeline-dot.is-green { border-color: rgba(167, 243, 208, 0.8); background: #ecfdf5; color: #059669; }
.timeline-dot.is-amber { border-color: rgba(253, 230, 138, 0.9); background: #fffbeb; color: #d97706; }
.timeline-content { min-width: 0; }
.timeline-content strong { display: block; color: #1e293b; font-size: 0.64rem; font-weight: 800; line-height: 1.45; }
.timeline-content span { display: block; margin-top: 0.12rem; color: #8493a8; font-size: 0.54rem; line-height: 1.55; }

/* Activity */
.activity-list { display: flex; flex-direction: column; gap: 0.56rem; }
.activity-item { display: flex; align-items: flex-start; gap: 0.5rem; }
.activity-icon {
  display: grid;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 0.6rem;
  background: rgba(219, 234, 254, 0.62);
  color: #1d4ed8;
}
.activity-icon svg { width: 13px; height: 13px; }
.activity-icon.is-green { background: rgba(209, 250, 229, 0.7); color: #047857; }
.activity-icon.is-amber { background: rgba(254, 243, 199, 0.72); color: #b45309; }
.activity-icon.is-violet { background: rgba(237, 233, 254, 0.75); color: #6d28d9; }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong { display: block; color: #334155; font-size: 0.62rem; font-weight: 800; line-height: 1.45; }
.activity-copy span { display: block; margin-top: 0.1rem; color: #94a3b8; font-size: 0.52rem; }
.activity-copy p { margin: 0.12rem 0 0; color: #64748b; font-size: 0.55rem; line-height: 1.55; }

/* Source links */
.source-list { display: flex; flex-direction: column; gap: 0.38rem; }
.source-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 0.75rem;
  padding: 0.45rem 0.5rem;
  background: rgba(255, 255, 255, 0.48);
  color: #475569;
  font-size: 0.6rem;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.source-link:hover {
  transform: translateX(-2px);
  border-color: rgba(191, 219, 254, 0.9);
  background: rgba(239, 246, 255, 0.82);
  color: #1d4ed8;
}
.source-link__icon {
  display: grid;
  width: 26px; height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 0.48rem;
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
}
.source-link__icon svg { width: 12px; height: 12px; }
.source-link span { flex: 1; }
.source-link small { color: #94a3b8; font-size: 0.5rem; font-weight: 600; }
.source-link > svg { width: 11px; height: 11px; color: #94a3b8; }

/* Charts */
.donut-wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.donut {
  position: relative;
  display: grid;
  width: 126px; height: 126px;
  flex: 0 0 126px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#2563eb 0 var(--seg-1, 38%), #7c3aed var(--seg-1, 38%) var(--seg-2, 64%), #10b981 var(--seg-2, 64%) var(--seg-3, 84%), #f59e0b var(--seg-3, 84%) 100%);
  box-shadow: 0 12px 28px -20px rgba(37, 99, 235, 0.5);
}
.donut::before {
  content: "";
  position: absolute;
  inset: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 0 0 1px rgba(226, 232, 240, 0.8);
}
.donut-hole { position: relative; z-index: 1; text-align: center; }
.donut-hole strong { display: block; color: var(--navy); font-size: 1.45rem; font-weight: 900; line-height: 1; }
.donut-hole span { display: block; margin-top: 0.15rem; color: #94a3b8; font-size: 0.52rem; font-weight: 700; }
.donut-legend { display: flex; flex: 1; min-width: 128px; flex-direction: column; gap: 0.42rem; }
.legend-item { display: flex; align-items: center; gap: 0.35rem; color: #64748b; font-size: 0.58rem; font-weight: 600; }
.legend-swatch { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; }
.legend-item strong { margin-inline-start: auto; color: #334155; font-size: 0.6rem; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.32rem;
  height: 96px;
  padding-top: 0.5rem;
}
.bar-item { display: flex; height: 100%; flex: 1; flex-direction: column; justify-content: flex-end; gap: 0.25rem; }
.bar {
  width: 100%;
  min-height: 6px;
  border-radius: 0.38rem 0.38rem 0.16rem 0.16rem;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: 0 5px 12px -8px rgba(37, 99, 235, 0.55);
  transition: height 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-item:nth-child(2n) .bar { background: linear-gradient(180deg, #a78bfa, #7c3aed); box-shadow: 0 5px 12px -8px rgba(124, 58, 237, 0.5); }
.bar-label { color: #94a3b8; font-size: 0.48rem; text-align: center; }

/* Courses */
.course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; }
.course-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.course-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.4); }
.course-top { display: flex; align-items: flex-start; gap: 0.45rem; }
.course-icon {
  display: grid;
  width: 32px; height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 0.62rem;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1d4ed8;
}
.course-icon svg { width: 14px; height: 14px; }
.course-card h3 { margin: 0; color: #1e293b; font-size: 0.67rem; font-weight: 900; line-height: 1.4; }
.course-card p { margin: 0.12rem 0 0; color: #94a3b8; font-size: 0.53rem; }
.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}
.progress-fill {
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
  transition: width 500ms cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-fill.is-green { background: linear-gradient(90deg, #059669, #34d399); box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.progress-fill.is-gold { background: linear-gradient(90deg, #b45309, #fbbf24); box-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }
.course-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; color: #64748b; font-size: 0.52rem; font-weight: 700; }
.course-actions { display: flex; gap: 0.3rem; }
.certificate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  color: #047857;
  font-size: 0.52rem;
  font-weight: 800;
}
.certificate-badge svg { width: 11px; height: 11px; }

/* Subscription */
.subscription-card {
  position: relative;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid rgba(253, 230, 138, 0.3);
  border-radius: 1.35rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 180, 74, 0.18), transparent 42%),
    linear-gradient(150deg, #111c33, #0f172a);
  color: #e2e8f0;
  box-shadow: 0 22px 50px -32px rgba(15, 23, 42, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid rgba(253, 230, 138, 0.22);
  border-radius: 999px;
  padding: 0.22rem 0.48rem;
  background: rgba(217, 180, 74, 0.12);
  color: #fde68a;
  font-size: 0.53rem;
  font-weight: 800;
}
.plan-name { margin: 0.65rem 0 0; color: #fff; font-size: 1.05rem; font-weight: 900; }
.plan-price { display: flex; align-items: baseline; gap: 0.25rem; margin-top: 0.2rem; }
.plan-price strong { color: #fde68a; font-size: 1.35rem; font-weight: 900; }
.plan-price span { color: #94a3b8; font-size: 0.55rem; }
.usage-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.8rem; }
.usage-item { display: flex; flex-direction: column; gap: 0.22rem; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; color: #cbd5e1; font-size: 0.55rem; font-weight: 700; }
.usage-head span:last-child { color: #94a3b8; font-size: 0.5rem; }
.usage-item .progress-track { background: rgba(255, 255, 255, 0.09); }
.usage-item .progress-fill { background: linear-gradient(90deg, #d9b44a, #fde68a); box-shadow: 0 0 10px rgba(217, 180, 74, 0.35); }

/* Empty states */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  text-align: center;
}
.empty-icon {
  display: grid;
  width: 42px; height: 42px;
  place-items: center;
  border-radius: 0.85rem;
  background: rgba(219, 234, 254, 0.6);
  color: #2563eb;
}
.empty-icon svg { width: 18px; height: 18px; }
.empty-state strong { color: #475569; font-size: 0.7rem; font-weight: 800; }
.empty-state p { max-width: 280px; margin: 0; color: #94a3b8; font-size: 0.58rem; line-height: 1.6; }

/* Document cards */
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.document-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.48);
}
.document-icon {
  display: grid;
  width: 32px; height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 0.55rem;
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
  font-size: 0.55rem;
  font-weight: 900;
}
.document-icon svg { width: 14px; height: 14px; }
.document-copy { min-width: 0; flex: 1; }
.document-copy strong { display: block; overflow: hidden; color: #334155; font-size: 0.59rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.document-copy span { display: block; margin-top: 0.08rem; color: #94a3b8; font-size: 0.5rem; }

/* Filters */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-bottom: 0.65rem; }
.filter-input {
  display: flex;
  min-width: 160px;
  flex: 1;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 0.65rem;
  padding: 0.38rem 0.5rem;
  background: rgba(255, 255, 255, 0.62);
}
.filter-input:focus-within { border-color: rgba(37, 99, 235, 0.32); box-shadow: var(--focus-ring); }
.filter-input svg { width: 13px; height: 13px; color: #94a3b8; }
.filter-input input { width: 100%; border: 0; outline: 0; background: transparent; color: #334155; font-size: 0.61rem; }
.filter-select {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 0.65rem;
  padding: 0.38rem 0.55rem;
  background: rgba(255, 255, 255, 0.62);
  color: #475569;
  font-size: 0.6rem;
  font-weight: 700;
  outline: 0;
}
.filter-select:focus { border-color: rgba(37, 99, 235, 0.32); box-shadow: var(--focus-ring); }
.search-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.58rem;
  font-weight: 700;
}
.search-summary strong { color: #1d4ed8; }

/* Small utilities */
.is-hidden { display: none !important; }
.w-full { width: 100%; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.text-muted { color: #64748b; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.inline-flex { display: inline-flex; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.55rem; }

/* Footer */
.dash-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: 1.2rem;
  padding: 0.9rem 0.2rem 0.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.dash-footer-brand { display: flex; align-items: center; gap: 0.5rem; }
.footer-mark {
  display: grid;
  width: 32px; height: 32px;
  place-items: center;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  box-shadow: 0 7px 16px -10px rgba(37, 99, 235, 0.6);
}
.footer-mark svg { width: 14px; height: 14px; }
.dash-footer-brand p { margin: 0; color: #475569; font-size: 0.62rem; font-weight: 800; }
.dash-footer-brand span { display: block; margin-top: 0.1rem; color: #94a3b8; font-size: 0.5rem; }
.dash-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.dash-footer-links a, .dash-footer-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #8493a8;
  font-size: 0.55rem;
  font-weight: 700;
  transition: color 150ms ease;
}
.dash-footer-links a:hover, .dash-footer-links button:hover { color: #1d4ed8; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Modal + forms
   -------------------------------------------------------------------------- */
.dash-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 220ms ease, visibility 220ms ease;
}
.dash-modal.is-open { visibility: visible; opacity: 1; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}
.modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(780px, 100%);
  max-height: min(90vh, 900px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 1.6rem;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 255, 0.93));
  box-shadow:
    0 40px 100px -30px rgba(15, 23, 42, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  transform: translateY(14px) scale(0.985);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}
.dash-modal.is-open .modal-dialog { transform: translateY(0) scale(1); }
.modal-dialog.is-wide { width: min(920px, 100%); }
.modal-dialog.is-narrow { width: min(520px, 100%); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 1rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.74);
  background: rgba(255, 255, 255, 0.58);
}
.modal-head-copy { display: flex; align-items: flex-start; gap: 0.6rem; min-width: 0; }
.modal-icon {
  display: grid;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  color: #1d4ed8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.modal-icon svg { width: 17px; height: 17px; }
.modal-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.modal-head p { margin: 0.18rem 0 0; color: #7b8aa1; font-size: 0.63rem; line-height: 1.55; }
.modal-body { overflow: auto; padding: 1rem 1.1rem 1.1rem; }

.dash-form { display: flex; flex-direction: column; gap: 0.8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.form-field { display: flex; min-width: 0; flex-direction: column; gap: 0.28rem; }
.form-field--full { grid-column: 1 / -1; }
.form-field label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #475569;
  font-size: 0.62rem;
  font-weight: 800;
}
.form-field label .req { color: #e11d48; }
.form-field label svg { width: 12px; height: 12px; color: #2563eb; }
.input-shell {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid rgba(203, 213, 225, 0.78);
  border-radius: 0.7rem;
  padding: 0.02rem 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 170ms ease, box-shadow 170ms ease, background 170ms ease;
}
.input-shell:focus-within {
  border-color: rgba(37, 99, 235, 0.5);
  background: #fff;
  box-shadow: var(--focus-ring), 0 0 0 1px rgba(37, 99, 235, 0.14);
}
.input-shell > svg { width: 14px; height: 14px; color: #94a3b8; flex: 0 0 14px; }
.input-shell input,
.input-shell select,
.input-shell textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1e293b;
  font-size: 0.69rem;
  font-weight: 600;
}
.input-shell input,
.input-shell select { height: 2.45rem; }
.input-shell textarea { min-height: 5.3rem; padding: 0.55rem 0; resize: vertical; line-height: 1.7; }
.input-shell input::placeholder,
.input-shell textarea::placeholder { color: #a8b4c4; font-weight: 500; }
.input-shell select {
  appearance: none;
  cursor: pointer;
  padding-left: 1.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.2rem center;
}
.input-shell.is-textarea { align-items: flex-start; }
.input-shell.is-textarea > svg { margin-top: 0.72rem; }
.form-help { color: #94a3b8; font-size: 0.54rem; line-height: 1.5; }
.form-field.has-error .input-shell { border-color: rgba(244, 63, 94, 0.55); box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.08); }
.form-field.has-error .form-help { color: #e11d48; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 0.7rem;
  padding: 0.55rem 0.6rem;
  background: rgba(248, 250, 252, 0.62);
}
.check-row input { width: 15px; height: 15px; accent-color: #2563eb; margin-top: 0.1rem; }
.check-row label { color: #64748b; font-size: 0.58rem; font-weight: 600; line-height: 1.6; }
.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  padding-top: 0.2rem;
}
.form-note {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  border: 1px solid rgba(191, 219, 254, 0.7);
  border-radius: 0.7rem;
  padding: 0.5rem 0.6rem;
  background: rgba(239, 246, 255, 0.72);
  color: #475569;
  font-size: 0.55rem;
  line-height: 1.6;
}
.form-note svg { width: 13px; height: 13px; color: #2563eb; flex: 0 0 13px; margin-top: 0.05rem; }
.form-note--gold { border-color: rgba(253, 230, 138, 0.72); background: rgba(255, 251, 235, 0.78); }
.form-note--gold svg { color: #b45309; }

/* Detail rows inside modal */
.detail-list { display: flex; flex-direction: column; gap: 0.42rem; }
.detail-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.48rem 0.55rem;
  border: 1px solid rgba(241, 245, 249, 0.9);
  border-radius: 0.65rem;
  background: rgba(248, 250, 252, 0.55);
}
.detail-row dt { color: #8493a8; font-size: 0.57rem; font-weight: 700; }
.detail-row dd { margin: 0; color: #334155; font-size: 0.6rem; font-weight: 800; text-align: left; }
.detail-note {
  padding: 0.62rem 0.7rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.55);
  color: #475569;
  font-size: 0.61rem;
  line-height: 1.75;
}

/* Certificate */
.certificate-sheet {
  position: relative;
  overflow: hidden;
  padding: 1.3rem;
  border: 1px solid rgba(217, 180, 74, 0.45);
  border-radius: 1.1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 180, 74, 0.16), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(37, 99, 235, 0.12), transparent 38%),
    linear-gradient(160deg, #fffef8, #fffdf4);
  text-align: center;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.65), inset 0 0 0 7px rgba(217, 180, 74, 0.18);
}
.certificate-sheet::before,
.certificate-sheet::after {
  content: "";
  position: absolute;
  width: 120px; height: 120px;
  border: 1px solid rgba(217, 180, 74, 0.22);
  border-radius: 50%;
}
.certificate-sheet::before { top: -50px; right: -50px; box-shadow: 0 0 0 14px rgba(217, 180, 74, 0.04); }
.certificate-sheet::after { bottom: -60px; left: -50px; box-shadow: 0 0 0 18px rgba(37, 99, 235, 0.03); }
.certificate-mark {
  display: inline-grid;
  width: 46px; height: 46px;
  place-items: center;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff;
  box-shadow: 0 10px 22px -12px rgba(37, 99, 235, 0.65);
}
.certificate-mark svg { width: 20px; height: 20px; }
.certificate-eyebrow { margin: 0.6rem 0 0; color: #a9861c; font-size: 0.56rem; font-weight: 900; letter-spacing: 0.12em; }
.certificate-sheet h3 { margin: 0.35rem 0 0; color: #0f172a; font-size: 1.2rem; font-weight: 900; }
.certificate-sheet > p { margin: 0.25rem 0 0; color: #64748b; font-size: 0.63rem; }
.certificate-name {
  margin: 0.8rem 0 0.2rem;
  color: #1d4ed8;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}
.certificate-course { margin: 0.2rem auto 0; max-width: 390px; color: #334155; font-size: 0.78rem; font-weight: 800; line-height: 1.7; }
.certificate-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.7rem;
  border-top: 1px dashed rgba(217, 180, 74, 0.45);
}
.certificate-meta span { color: #8493a8; font-size: 0.53rem; }
.certificate-meta strong { display: block; margin-top: 0.1rem; color: #334155; font-size: 0.58rem; }
.certificate-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.certificate-sign { color: #8493a8; font-size: 0.52rem; text-align: right; }
.certificate-sign strong { display: block; margin-top: 0.18rem; color: #334155; font-size: 0.58rem; }
.certificate-seal {
  display: grid;
  width: 66px; height: 66px;
  place-items: center;
  border: 2px solid rgba(217, 180, 74, 0.45);
  border-radius: 50%;
  color: #a9861c;
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1.3;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 4px rgba(217, 180, 74, 0.08);
}

/* --------------------------------------------------------------------------
   Notifications drawer
   -------------------------------------------------------------------------- */
.notifications-panel {
  position: fixed;
  top: 5.2rem;
  left: 1rem;
  z-index: 110;
  display: flex;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(620px, calc(100vh - 6.5rem));
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 1.35rem;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(248, 250, 255, 0.94));
  box-shadow: 0 30px 75px -28px rgba(15, 23, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.985);
  transform-origin: top left;
  transition: opacity 200ms ease, visibility 200ms ease, transform 200ms ease;
}
.notifications-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.notifications-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem 0.6rem;
}
.notifications-head h2 { margin: 0; color: var(--navy); font-size: 0.9rem; font-weight: 900; }
.notifications-head .icon-btn { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 0.6rem; }
.notifications-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.9rem 0.6rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
  color: #8493a8;
  font-size: 0.55rem;
  font-weight: 700;
}
.notifications-list { overflow: auto; padding: 0.45rem; }
.notification-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.48rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.55rem;
  background: transparent;
  text-align: right;
  transition: background 160ms ease, border-color 160ms ease;
}
.notification-item:hover { background: rgba(239, 246, 255, 0.65); border-color: rgba(191, 219, 254, 0.45); }
.notification-item.is-unread { background: rgba(239, 246, 255, 0.5); }
.notification-item.is-unread::after {
  content: "";
  position: absolute;
  top: 0.7rem; left: 0.55rem;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.notification-item__icon {
  display: grid;
  width: 29px; height: 29px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 0.55rem;
  background: rgba(219, 234, 254, 0.7);
  color: #1d4ed8;
}
.notification-item__icon svg { width: 13px; height: 13px; }
.notification-item__icon.is-green { background: rgba(209, 250, 229, 0.7); color: #047857; }
.notification-item__icon.is-amber { background: rgba(254, 243, 199, 0.72); color: #b45309; }
.notification-item__copy { min-width: 0; flex: 1; }
.notification-item__copy strong { display: block; color: #334155; font-size: 0.6rem; font-weight: 800; line-height: 1.45; }
.notification-item__copy p { margin: 0.12rem 0 0; color: #8493a8; font-size: 0.53rem; line-height: 1.55; }
.notification-item__copy time { display: block; margin-top: 0.22rem; color: #a8b4c4; font-size: 0.48rem; }
.notifications-empty { padding: 1.4rem 1rem; color: #94a3b8; font-size: 0.6rem; text-align: center; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.dash-toast {
  position: fixed;
  bottom: 1.1rem;
  left: 1.1rem;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(390px, calc(100vw - 2rem));
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.95rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 50%),
    rgba(15, 23, 42, 0.94);
  color: #e2e8f0;
  box-shadow: 0 24px 55px -22px rgba(15, 23, 42, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.985);
  transition: opacity 220ms ease, visibility 220ms ease, transform 220ms ease;
}
.dash-toast.is-visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.toast-icon {
  display: grid;
  width: 32px; height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 0.62rem;
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
}
.toast-icon svg { width: 15px; height: 15px; }
.dash-toast[data-type="error"] .toast-icon { background: rgba(244, 63, 94, 0.16); color: #fda4af; }
.dash-toast[data-type="info"] .toast-icon { background: rgba(96, 165, 250, 0.16); color: #93c5fd; }
.dash-toast[data-type="warning"] .toast-icon { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.dash-toast p { margin: 0; color: #fff; font-size: 0.67rem; font-weight: 800; line-height: 1.45; }
.dash-toast span:not(.toast-icon) { display: block; margin-top: 0.1rem; color: #94a3b8; font-size: 0.51rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1420px) {
  .dash-search input { width: 108px; }
  .session-name { max-width: 88px; }
  .role-pill { padding-inline: 0.55rem; }
}

@media (max-width: 1280px) {
  :root { --sidebar-width: 264px; }
  .home-btn { display: none; }
  .dash-search { display: none; }
  .role-pill__label { display: none; }
  .role-pill { padding: 0.48rem; }
  .role-pill__icon { width: 24px; height: 24px; }
  .role-pill svg { width: 14px; height: 14px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid { grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.9fr); }
}

@media (max-width: 1100px) {
  .session-copy { display: none; }
  .session-chip { padding: 0.24rem; }
  .session-chevron { display: none; }
  .brand-sub { display: none; }
  .role-pill__label { display: inline; }
  .role-pill { padding: 0.5rem 0.58rem; }
}

@media (max-width: 1024px) {
  html { scroll-padding-top: 7.2rem; }
  .dashboard-app { padding-inline: 0.75rem; }
  .dash-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.55rem;
  }
  .topbar-menu-btn { display: inline-grid; }
  .dash-brand { gap: 0.45rem; }
  .brand-copy { display: none; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .role-pill__label { display: none; }
  .role-pill { padding: 0.5rem; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-sidebar {
    position: fixed;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 70;
    width: min(300px, calc(100vw - 2rem));
    height: calc(100vh - 1.2rem);
    max-height: none;
    transform: translateX(112%);
    transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  }
  .dash-sidebar.is-open { transform: translateX(0); }
  .dash-main { grid-column: 1 / -1; }
  .page-header { padding-top: 0.7rem; }
  .content-grid { grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.9fr); }
  .notifications-panel { top: 4.8rem; left: 0.75rem; }
}

@media (max-width: 820px) {
  .content-grid, .content-grid--even { grid-template-columns: minmax(0, 1fr); }
  .page-header { flex-direction: column; }
  .page-header__actions { width: 100%; justify-content: flex-start; }
  .course-grid { grid-template-columns: minmax(0, 1fr); }
  .document-grid { grid-template-columns: minmax(0, 1fr); }
  .demo-banner { align-items: flex-start; flex-wrap: wrap; }
  .demo-banner__actions { width: 100%; padding-right: 2.7rem; }
}

@media (max-width: 700px) {
  .dash-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.55rem;
    border-radius: 1.3rem;
  }
  .topbar-brand { grid-column: 1; grid-row: 1; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .role-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: flex-start;
    justify-content: flex-start;
    width: max-content;
    max-width: 100%;
    margin-top: 0.1rem;
    padding: 0;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }
  .role-pill__label { display: inline; }
  .role-pill { padding: 0.46rem 0.54rem; font-size: 0.63rem; }
  .brand-copy { display: flex; }
  .brand-sub { display: none; }
  .page-title { font-size: 1.5rem; }
  .metrics-grid { gap: 0.55rem; }
  .metric-card { padding: 0.8rem; border-radius: 1.1rem; }
  .metric-value { font-size: 1.45rem; }
  .glass-card { padding: 0.8rem; border-radius: 1.15rem; }
  .case-spotlight, .subscription-card { padding: 0.85rem; }
  .modal-head { padding: 0.85rem; }
  .modal-body { padding: 0.85rem; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .certificate-sheet { padding: 1rem 0.7rem; }
  .certificate-name { font-size: 1.12rem; }
  .certificate-course { font-size: 0.68rem; }
  .dash-footer { align-items: flex-start; flex-direction: column; }
  .dash-footer-links { gap: 0.5rem; }
}

@media (max-width: 540px) {
  .dashboard-app { padding: 0.5rem 0.5rem 1.5rem; }
  .dash-topbar { top: 0.45rem; }
  .brand-copy { display: none; }
  .role-pill { padding: 0.44rem 0.5rem; font-size: 0.6rem; }
  .role-pill__icon { width: 20px; height: 20px; }
  .metrics-grid { grid-template-columns: minmax(0, 1fr); }
  .metric-card { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 0.55rem; }
  .metric-top { display: contents; }
  .metric-icon { grid-column: 1; grid-row: 1 / span 3; }
  .metric-label { grid-column: 2; grid-row: 1; margin-top: 0; }
  .metric-value-row { grid-column: 2; grid-row: 2; margin-top: 0; }
  .metric-value { font-size: 1.3rem; }
  .metric-foot { grid-column: 2 / -1; grid-row: 3; margin-top: 0.15rem; }
  .metric-card::before { display: none; }
  .page-meta__item { font-size: 0.55rem; }
  .page-header__actions .btn { flex: 1; }
  .case-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.35rem; }
  .case-step:nth-child(2)::before { display: none; }
  .case-step:nth-child(3)::after { top: 0.55rem; }
  .spotlight-lawyer { align-items: flex-start; flex-direction: column; }
  .upcoming-main { align-items: flex-start; }
  .date-block { width: 58px; height: 66px; flex-basis: 58px; }
  .date-day { font-size: 1.3rem; }
  .timeline-item { grid-template-columns: 44px 18px minmax(0, 1fr); }
  .timeline-item:not(:last-child)::after { right: 52px; }
  .donut-wrap { justify-content: center; }
  .donut { width: 110px; height: 110px; flex-basis: 110px; }
  .plan-price strong { font-size: 1.15rem; }
  .dash-footer-links a, .dash-footer-links button { font-size: 0.52rem; }
  .toast-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .dash-toast { left: 0.5rem; bottom: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Certificate print
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Readability, contrast + component polish
   -------------------------------------------------------------------------- */
.role-pill {
  padding: 0.55rem 0.68rem;
  font-size: 0.78rem;
}
.role-pill__icon { width: 22px; height: 22px; border-radius: 8px; }
.role-pill svg { width: 14px; height: 14px; }
.dash-search { height: 42px; padding-inline: 0.78rem; }
.dash-search input { width: 148px; font-size: 0.8rem; }
.dash-search kbd { font-size: 0.6rem; }
.session-name { max-width: 124px; font-size: 0.78rem; }
.session-role { font-size: 0.62rem; }
.session-menu__head strong { font-size: 0.88rem; }
.session-menu__head span { font-size: 0.68rem; }
.session-menu__item { font-size: 0.78rem; }

.sidebar-user-name { font-size: 0.93rem; }
.sidebar-user-role { font-size: 0.7rem; }
.sidebar-user-org { font-size: 0.61rem; }
.sidebar-badge { font-size: 0.58rem; padding: 0.25rem 0.47rem; }
.sidebar-return { font-size: 0.68rem; }
.sidebar-group-label { font-size: 0.58rem; }
.sidebar-link { padding: 0.52rem 0.55rem; font-size: 0.82rem; }
.sidebar-icon { width: 32px; height: 32px; flex-basis: 32px; border-radius: 0.62rem; }
.sidebar-link svg { width: 15px; height: 15px; }
.sidebar-count { font-size: 0.6rem; }
.sidebar-support-head { font-size: 0.75rem; }
.sidebar-support p { font-size: 0.65rem; }
.sidebar-support a { font-size: 0.66rem; }
.sidebar-protection { font-size: 0.59rem; }

.demo-banner { padding: 0.78rem 0.9rem; }
.demo-banner__copy strong { font-size: 0.84rem; }
.demo-banner__copy p { font-size: 0.71rem; }
.page-eyebrow { font-size: 0.69rem; }
.page-subtitle { font-size: 0.87rem; color: #5b6b82; }
.page-meta__item { font-size: 0.66rem; padding: 0.3rem 0.56rem; }
.btn { padding: 0.62rem 0.86rem; font-size: 0.76rem; border-radius: 0.82rem; }
.btn svg { width: 15px; height: 15px; }
.btn-sm { padding: 0.42rem 0.6rem; font-size: 0.68rem; }
.btn-sm svg { width: 13px; height: 13px; }
.text-btn { font-size: 0.69rem; }
.text-btn svg { width: 13px; height: 13px; }

.metric-card { padding: 1.05rem; }
.metric-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 0.9rem; }
.metric-icon svg { width: 19px; height: 19px; }
.metric-label { margin-top: 0.75rem; font-size: 0.72rem; }
.metric-value { font-size: 1.9rem; }
.metric-unit { font-size: 0.65rem; }
.metric-note { font-size: 0.63rem; }
.metric-note svg { width: 12px; height: 12px; }
.metric-progress { height: 5px; }

.glass-card { padding: 1.1rem; }
.card-head { margin-bottom: 0.85rem; }
.card-head-icon { width: 32px; height: 32px; flex-basis: 32px; }
.card-head-icon svg { width: 15px; height: 15px; }
.card-head h2, .card-head h3 { font-size: 0.98rem; }
.card-head p { margin-top: 0.25rem; font-size: 0.69rem; color: #6f7f96; }
.card-eyebrow { font-size: 0.6rem; }
.data-table { min-width: 680px; }
.data-table th { padding: 0.62rem 0.7rem; font-size: 0.62rem; }
.data-table td { padding: 0.68rem 0.7rem; font-size: 0.7rem; }
.row-title { font-size: 0.74rem; }
.row-sub { font-size: 0.61rem; }
.table-empty { font-size: 0.72rem; }
.mobile-table-hint { font-size: 0.6rem; }
.table-link { color: #1e40af; }

.status-badge { padding: 0.24rem 0.5rem; font-size: 0.6rem; }
.mini-pill { padding: 0.24rem 0.47rem; font-size: 0.58rem; }
.text-muted { color: #5b6b82; }

.case-spotlight { padding: 1.2rem; }
.spotlight-kicker { font-size: 0.64rem; }
.case-ref { font-size: 0.61rem; }
.case-spotlight h3 { font-size: 1.24rem; }
.case-spotlight__sub { font-size: 0.71rem; }
.case-meta span { font-size: 0.62rem; padding: 0.3rem 0.48rem; }
.case-meta svg { width: 12px; height: 12px; }
.case-step { font-size: 0.58rem; }
.spotlight-lawyer__person strong { font-size: 0.7rem; }
.spotlight-lawyer__person span { font-size: 0.58rem; }
.upcoming-body h3 { font-size: 0.91rem; }
.upcoming-body p { font-size: 0.65rem; }
.upcoming-meta span { font-size: 0.59rem; }
.countdown { font-size: 0.61rem; }
.timeline-date { font-size: 0.59rem; }
.timeline-content strong { font-size: 0.71rem; }
.timeline-content span { font-size: 0.6rem; }
.activity-copy strong { font-size: 0.69rem; }
.activity-copy span { font-size: 0.58rem; }
.activity-copy p { font-size: 0.62rem; }
.source-link { font-size: 0.66rem; padding: 0.5rem 0.55rem; }
.source-link small { font-size: 0.55rem; }
.legend-item { font-size: 0.64rem; }
.legend-item strong { font-size: 0.66rem; }
.donut-hole span { font-size: 0.58rem; }
.bar-label { font-size: 0.54rem; }

.course-card { padding: 0.82rem; }
.course-card h3 { font-size: 0.76rem; }
.course-card p { font-size: 0.6rem; }
.course-meta { font-size: 0.59rem; }
.certificate-badge { font-size: 0.59rem; }
.plan-name { font-size: 1.15rem; }
.plan-price strong { font-size: 1.45rem; }
.plan-price span { font-size: 0.61rem; }
.plan-badge { font-size: 0.59rem; }
.usage-head { font-size: 0.62rem; }
.usage-head span:last-child { font-size: 0.56rem; }
.empty-state strong { font-size: 0.77rem; }
.empty-state p { font-size: 0.65rem; }
.document-copy strong { font-size: 0.66rem; }
.document-copy span { font-size: 0.57rem; }
.filter-input { min-height: 38px; padding: 0.42rem 0.55rem; }
.filter-input input { font-size: 0.68rem; }
.filter-select { min-height: 38px; padding: 0.42rem 0.6rem; font-size: 0.67rem; }
.search-summary { font-size: 0.64rem; }
.dash-footer-brand p { font-size: 0.68rem; }
.dash-footer-brand span { font-size: 0.56rem; }
.dash-footer-links a, .dash-footer-links button { font-size: 0.61rem; }

.modal-head h2 { font-size: 1.08rem; }
.modal-head p { font-size: 0.7rem; }
.form-field label { font-size: 0.68rem; }
.input-shell input, .input-shell select, .input-shell textarea { font-size: 0.76rem; }
.input-shell > svg { width: 15px; height: 15px; flex-basis: 15px; }
.form-help { font-size: 0.6rem; }
.check-row label { font-size: 0.64rem; }
.form-note { font-size: 0.62rem; }
.detail-row dt { font-size: 0.63rem; }
.detail-row dd { font-size: 0.67rem; }
.detail-note { font-size: 0.67rem; }
.certificate-sheet > p { font-size: 0.7rem; }
.certificate-course { font-size: 0.84rem; }
.certificate-meta span { font-size: 0.59rem; }
.certificate-meta strong { font-size: 0.64rem; }
.certificate-sign { font-size: 0.58rem; }
.certificate-sign strong { font-size: 0.64rem; }

.notifications-head h2 { font-size: 1rem; }
.notifications-toolbar { font-size: 0.61rem; }
.notification-item__copy strong { font-size: 0.67rem; }
.notification-item__copy p { font-size: 0.6rem; }
.notification-item__copy time { font-size: 0.54rem; }
.notifications-empty { font-size: 0.67rem; }
.dash-toast p { font-size: 0.74rem; }
.dash-toast span:not(.toast-icon) { font-size: 0.58rem; }

/* Inline status selector used inside tables */
.table-select {
  min-width: 124px;
  max-width: 168px;
  height: 32px;
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 0.55rem;
  padding: 0 1.45rem 0 0.55rem;
  appearance: none;
  background-color: rgba(255, 255, 255, 0.72);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 0.42rem center;
  color: #334155;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.table-select:hover { background-color: #fff; border-color: rgba(147, 197, 253, 0.9); }
.table-select:focus {
  outline: 0;
  border-color: rgba(37, 99, 235, 0.5);
  background-color: #fff;
  box-shadow: var(--focus-ring);
}

/* Guest icon inside the topbar account pill */
.session-avatar--guest {
  display: grid;
  place-items: center;
  color: #1d4ed8;
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
}
.session-avatar--guest svg { width: 16px; height: 16px; stroke-width: 2.1; }

/* Keep controls comfortable on smaller screens */
@media (max-width: 700px) {
  .role-pill { padding: 0.5rem 0.56rem; font-size: 0.72rem; }
  .role-pill__icon { width: 21px; height: 21px; }
  .page-title { font-size: 1.62rem; }
  .metric-value { font-size: 1.38rem; }
  .card-head h2, .card-head h3 { font-size: 0.92rem; }
  .data-table th { font-size: 0.6rem; }
  .data-table td { font-size: 0.68rem; }
  .table-select { height: 30px; font-size: 0.63rem; }
}

@media (max-width: 540px) {
  .metric-value { font-size: 1.4rem; }
  .metric-label { font-size: 0.74rem; }
  .metric-note { font-size: 0.62rem; }
  .page-header__actions .btn { font-size: 0.72rem; }
}

/* Elegant empty state when no registered professional can receive a request */
.professional-empty {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 1.25rem 0.6rem 0.35rem;
  text-align: center;
}
.professional-empty__icon {
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid rgba(147, 197, 253, 0.5);
  border-radius: 1.1rem;
  color: #1d4ed8;
  background: linear-gradient(145deg, rgba(239, 246, 255, 0.96), rgba(224, 231, 255, 0.72));
  box-shadow: 0 18px 40px -28px rgba(37, 99, 235, 0.65), inset 0 1px 0 #fff;
}
.professional-empty__icon svg { width: 1.4rem; height: 1.4rem; }
.professional-empty strong { color: #0f172a; font-size: 0.94rem; font-weight: 900; }
.professional-empty p {
  max-width: 27rem;
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.9;
}
.professional-empty__hint {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(203, 213, 225, 0.6);
  border-radius: 0.7rem;
  color: #64748b;
  background: rgba(248, 250, 252, 0.7);
  font-size: 0.64rem;
  font-weight: 600;
}
.professional-empty__hint svg { width: 13px; height: 13px; color: #2563eb; }
.professional-empty .form-actions { width: 100%; justify-content: center; margin-top: 0.55rem; }

/* Locked account role + guest dashboard gate */
.role-switcher { gap: 0.55rem; }
.role-pill.is-locked {
  cursor: default;
  padding-inline-end: 0.62rem;
  border-color: rgba(37, 99, 235, 0.28);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(255, 255, 255, 0.68));
  box-shadow: 0 12px 28px -20px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.role-lock-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-inline-start: 0.1rem;
  border-radius: 50%;
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.9);
}
.role-lock-icon svg { width: 10px; height: 10px; }
.role-locked-note {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.role-locked-note svg { width: 14px; height: 14px; color: #2563eb; }

body.is-guest .dash-sidebar { display: none; }
body.is-guest .dashboard-layout { grid-template-columns: minmax(0, 1fr); }
body.is-guest .dash-search,
body.is-guest .notification-btn { display: none; }
body.is-guest #mobileSidebarToggle { display: none; }
body.is-guest .role-switcher { display: none; }
body.is-guest .dash-topbar { grid-template-columns: minmax(0, 1fr) auto; }
body.is-guest .dash-main { padding-top: 1rem; }

.auth-gate {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 9rem);
  padding: clamp(1rem, 3vw, 2.4rem);
}
.auth-gate[hidden] { display: none; }
.auth-gate-card {
  position: relative;
  width: min(72rem, 100%);
  overflow: hidden;
  padding: clamp(1.4rem, 3vw, 2.8rem);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 2rem;
  background:
    radial-gradient(circle at 92% 0%, rgba(37, 99, 235, 0.14), transparent 38%),
    radial-gradient(circle at 0% 100%, rgba(217, 180, 74, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 250, 255, 0.62));
  box-shadow: 0 40px 100px -54px rgba(15, 23, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
}
.auth-gate-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -10%;
  top: -30%;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.22), transparent 66%);
  pointer-events: none;
}
.auth-gate-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.3rem;
}
.auth-gate-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(145deg, #1d4ed8, #0f172a);
  box-shadow: 0 16px 30px -18px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.auth-gate-mark svg { width: 1.25rem; height: 1.25rem; }
.auth-gate-brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.auth-gate-brand-copy strong { color: #0f172a; font-size: 1.15rem; font-weight: 900; }
.auth-gate-brand-copy small { color: #64748b; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.08em; direction: ltr; }
.auth-gate-eyebrow {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.36rem 0.7rem;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(239, 246, 255, 0.82);
  font-size: 0.7rem;
  font-weight: 800;
}
.auth-gate-eyebrow svg { width: 14px; height: 14px; }
.auth-gate-card h1 {
  position: relative;
  margin: 0.9rem 0 0.45rem;
  color: #0f172a;
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.auth-gate-lead {
  position: relative;
  max-width: 54rem;
  margin: 0;
  color: #475569;
  font-size: clamp(0.82rem, 1.6vw, 0.98rem);
  font-weight: 500;
  line-height: 1.95;
}
.auth-gate-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}
.auth-gate-actions .btn { min-height: 2.9rem; padding-inline: 1.15rem; }
.auth-gate-roles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1.55rem;
}
.auth-gate-role {
  display: flex;
  align-items: flex-start;
  gap: 0.68rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(203, 213, 225, 0.62);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
.auth-gate-role__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.7rem;
  color: #1d4ed8;
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.96), rgba(238, 242, 255, 0.9));
}
.auth-gate-role__icon svg { width: 1rem; height: 1rem; }
.auth-gate-role strong { display: block; color: #0f172a; font-size: 0.8rem; font-weight: 900; }
.auth-gate-role p { margin: 0.22rem 0 0; color: #64748b; font-size: 0.66rem; font-weight: 500; line-height: 1.7; }
.auth-gate-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid rgba(203, 213, 225, 0.55);
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 600;
}
.auth-gate-foot svg { flex: 0 0 auto; width: 15px; height: 15px; color: #10b981; }

@media (max-width: 980px) {
  .auth-gate-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .auth-gate { min-height: auto; padding: 0.75rem 0; }
  .auth-gate-card { padding: 1.15rem; border-radius: 1.4rem; }
  .auth-gate-roles { grid-template-columns: 1fr; gap: 0.5rem; }
  .auth-gate-actions { flex-direction: column; }
  .auth-gate-actions .btn { width: 100%; justify-content: center; }
  .role-locked-note { display: none; }
  .auth-gate-foot { align-items: flex-start; line-height: 1.7; }
}

/* ==========================================================================
   Golden legal library — floating action + gold glass modal
   ========================================================================== */
.library-fab {
  position: fixed;
  left: 1.35rem;
  bottom: 1.35rem;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.72rem;
  min-height: 3.45rem;
  padding: 0.48rem 0.55rem 0.48rem 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 237, 160, 0.72);
  border-radius: 999px;
  color: #2b1d02;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.52), transparent 32%),
    linear-gradient(135deg, #fde68a 0%, #e7b928 28%, #c69212 58%, #f7d76c 78%, #b9820b 100%);
  box-shadow:
    0 20px 44px -18px rgba(120, 78, 0, 0.62),
    0 6px 18px -10px rgba(202, 138, 4, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(120, 70, 0, 0.25);
  cursor: pointer;
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms ease, filter 220ms ease;
}
.library-fab[hidden] { display: none; }
.library-fab:hover {
  transform: translateY(-3px) scale(1.035);
  filter: saturate(115%) brightness(1.04);
  box-shadow:
    0 0 25px rgba(234, 179, 8, 0.5),
    0 26px 54px -20px rgba(120, 78, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.library-fab:active { transform: translateY(-1px) scale(0.99); }
.library-fab:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.5); outline-offset: 4px; }
.library-fab__glow {
  position: absolute;
  inset: -60% auto auto -12%;
  width: 9rem;
  height: 9rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75), transparent 66%);
  opacity: 0.65;
  pointer-events: none;
  animation: library-fab-shimmer 5.5s ease-in-out infinite;
}
.library-fab__icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 2.5rem;
  place-items: center;
  border-radius: 50%;
  color: #ffe9a1;
  background: linear-gradient(145deg, #3b2b08, #1c1505);
  box-shadow: 0 7px 16px -8px rgba(28, 20, 3, 0.75), inset 0 1px 0 rgba(255, 240, 180, 0.28);
}
.library-fab__icon svg { width: 1.2rem; height: 1.2rem; }
.library-fab__copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.16; }
.library-fab__copy strong { font-size: 0.78rem; font-weight: 900; letter-spacing: -0.01em; }
.library-fab__copy small { margin-top: 0.16rem; color: rgba(63, 43, 3, 0.76); font-size: 0.53rem; font-weight: 700; }
.library-fab__count {
  position: absolute;
  top: -0.22rem;
  right: -0.16rem;
  z-index: 2;
  display: grid;
  min-width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border: 2px solid #f8e7a2;
  border-radius: 999px;
  color: #fff;
  background: #1d4ed8;
  font-size: 0.58rem;
  font-weight: 900;
}
.library-fab__count[hidden] { display: none; }
@keyframes library-fab-shimmer {
  0%, 100% { transform: translate(-10%, -8%) scale(0.9); opacity: 0.4; }
  50% { transform: translate(18%, 6%) scale(1.12); opacity: 0.78; }
}

.dash-modal.is-library .modal-dialog {
  border-color: rgba(217, 180, 74, 0.55);
  background:
    radial-gradient(circle at 100% 0%, rgba(253, 230, 138, 0.34), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(202, 138, 4, 0.12), transparent 44%),
    linear-gradient(150deg, rgba(255, 254, 249, 0.98), rgba(254, 250, 235, 0.96));
  box-shadow:
    0 44px 110px -32px rgba(50, 35, 4, 0.62),
    0 0 60px -24px rgba(234, 179, 8, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}
.dash-modal.is-library .modal-head {
  border-bottom-color: rgba(217, 180, 74, 0.38);
  background:
    linear-gradient(135deg, rgba(35, 28, 12, 0.98), rgba(58, 45, 15, 0.94) 62%, rgba(90, 66, 11, 0.9));
}
.dash-modal.is-library .modal-head h2 { color: #fff7d6; }
.dash-modal.is-library .modal-head p { color: rgba(254, 240, 191, 0.7); }
.dash-modal.is-library .modal-icon {
  color: #3a2a05;
  background: linear-gradient(145deg, #fef3c7, #fbbf24 44%, #d4a017);
  box-shadow: 0 12px 26px -16px rgba(202, 138, 4, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.dash-modal.is-library .modal-close {
  color: #fef3c7;
  border-color: rgba(253, 230, 138, 0.26);
  background: rgba(255, 255, 255, 0.08);
}
.dash-modal.is-library .modal-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.library-modal { display: flex; flex-direction: column; gap: 0.68rem; }
.library-toolbar { display: flex; align-items: stretch; gap: 0.55rem; }
.library-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  min-height: 2.85rem;
  padding: 0 0.78rem;
  border: 1px solid rgba(202, 138, 4, 0.3);
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 12px 26px -24px rgba(120, 78, 0, 0.55);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.library-search:focus-within {
  border-color: rgba(217, 180, 74, 0.8);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.12), 0 16px 30px -26px rgba(120, 78, 0, 0.6);
}
.library-search > svg { flex: 0 0 auto; width: 17px; height: 17px; color: #b8860b; }
.library-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292014;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
}
.library-search input::placeholder { color: #a18052; font-weight: 600; }
.library-search kbd {
  flex: 0 0 auto;
  padding: 0.15rem 0.4rem;
  border: 1px solid rgba(180, 140, 55, 0.26);
  border-radius: 0.4rem;
  color: #9a7426;
  background: rgba(254, 243, 199, 0.7);
  font-size: 0.56rem;
  font-weight: 800;
  direction: ltr;
}
.library-fav-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  padding: 0 0.85rem;
  border: 1px solid rgba(202, 138, 4, 0.28);
  border-radius: 0.95rem;
  color: #79520b;
  background: rgba(255, 255, 255, 0.6);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 900;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.library-fav-filter svg { width: 15px; height: 15px; }
.library-fav-filter:hover { background: rgba(254, 243, 199, 0.92); border-color: rgba(202, 138, 4, 0.55); }
.library-fav-filter.is-active {
  color: #fffbea;
  border-color: rgba(120, 78, 0, 0.4);
  background: linear-gradient(135deg, #b8860b, #8a6107);
  box-shadow: 0 10px 22px -14px rgba(120, 78, 0, 0.8);
}
.library-chips {
  display: flex;
  gap: 0.34rem;
  overflow-x: auto;
  padding-bottom: 0.12rem;
  scrollbar-width: none;
}
.library-chips::-webkit-scrollbar { display: none; }
.library-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding: 0.46rem 0.66rem;
  border: 1px solid rgba(202, 184, 148, 0.42);
  border-radius: 999px;
  color: #786345;
  background: rgba(255, 255, 255, 0.46);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
}
.library-chip svg { width: 13px; height: 13px; }
.library-chip:hover { color: #7b5409; border-color: rgba(202, 138, 4, 0.4); background: rgba(255, 251, 235, 0.9); }
.library-chip.is-active {
  color: #fffbea;
  border-color: rgba(120, 78, 0, 0.42);
  background: linear-gradient(135deg, #a97a0b, #7b5409);
  box-shadow: 0 9px 18px -14px rgba(70, 45, 2, 0.74), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.library-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: #7b6a50;
  font-size: 0.62rem;
  font-weight: 800;
}
.library-meta__source { display: inline-flex; align-items: center; gap: 0.3rem; color: #a1844c; font-weight: 600; }
.library-meta__source svg { width: 13px; height: 13px; }
.library-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  max-height: min(48vh, 520px);
  overflow-y: auto;
  padding: 0.1rem 0.16rem 0.15rem 0.1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(202, 138, 4, 0.4) transparent;
}
.library-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid rgba(214, 195, 156, 0.55);
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(255, 252, 242, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 18px 32px -30px rgba(92, 62, 9, 0.55);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.library-card:hover {
  transform: translateY(-2px);
  border-color: rgba(202, 138, 4, 0.46);
  box-shadow: 0 0 0 1px rgba(253, 230, 138, 0.4), 0 24px 44px -30px rgba(92, 62, 9, 0.62);
}
.library-card__head { display: flex; align-items: flex-start; gap: 0.55rem; }
.library-card__icon {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 2.15rem;
  place-items: center;
  border: 1px solid rgba(217, 180, 74, 0.35);
  border-radius: 0.7rem;
  color: #8a6107;
  background: linear-gradient(145deg, rgba(254, 243, 199, 0.95), rgba(251, 230, 152, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.library-card__icon svg { width: 1rem; height: 1rem; }
.library-card__title { min-width: 0; flex: 1; }
.library-card__cat { display: block; color: #a17b2b; font-size: 0.54rem; font-weight: 900; letter-spacing: 0.02em; }
.library-card__title h3 { margin: 0.16rem 0 0; color: #2f2411; font-size: 0.8rem; font-weight: 900; line-height: 1.45; }
.library-card__title small { display: block; margin-top: 0.15rem; color: #98825c; font-size: 0.56rem; font-weight: 700; line-height: 1.5; }
.library-card > p { margin: 0; color: #6a5b43; font-size: 0.66rem; font-weight: 500; line-height: 1.78; }
.library-star {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  flex: 0 0 1.85rem;
  place-items: center;
  border: 1px solid rgba(199, 175, 124, 0.48);
  border-radius: 0.62rem;
  color: #a48a58;
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition: color 170ms ease, background 170ms ease, border-color 170ms ease, transform 170ms ease;
}
.library-star svg { width: 14px; height: 14px; }
.library-star:hover { transform: translateY(-1px); color: #a97a0b; border-color: rgba(202, 138, 4, 0.55); background: #fffbeb; }
.library-star.is-active { color: #fff8dd; border-color: rgba(120, 78, 0, 0.45); background: linear-gradient(145deg, #d4a017, #9a6d08); }
.library-tags { display: flex; flex-wrap: wrap; gap: 0.26rem; }
.library-tags span {
  padding: 0.18rem 0.4rem;
  border: 1px solid rgba(221, 206, 176, 0.54);
  border-radius: 999px;
  color: #826b45;
  background: rgba(255, 253, 246, 0.72);
  font-size: 0.53rem;
  font-weight: 700;
}
.library-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.48rem;
  border-top: 1px solid rgba(221, 206, 176, 0.48);
}
.library-card__foot a,
.library-card__foot span { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.56rem; font-weight: 800; }
.library-card__foot a { color: #8a6107; }
.library-card__foot a:hover { color: #4c3504; text-decoration: underline; text-underline-offset: 2px; }
.library-card__foot span { color: #a08a61; font-weight: 600; }
.library-card__foot svg { width: 12px; height: 12px; }
.library-empty {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding: 2.2rem 1rem;
  text-align: center;
}
.library-empty__icon {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  place-items: center;
  border: 1px solid rgba(217, 180, 74, 0.4);
  border-radius: 1rem;
  color: #a97a0b;
  background: rgba(254, 243, 199, 0.62);
}
.library-empty__icon svg { width: 1.45rem; height: 1.45rem; }
.library-empty strong { color: #3f3117; font-size: 0.88rem; font-weight: 900; }
.library-empty p { max-width: 22rem; margin: 0; color: #8b7858; font-size: 0.68rem; line-height: 1.8; }
.library-empty .btn { margin-top: 0.35rem; }
.library-footnote {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(217, 180, 74, 0.26);
  color: #9a8766;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.7;
}
.library-footnote svg { flex: 0 0 auto; width: 13px; height: 13px; margin-top: 0.08rem; color: #b8860b; }

@media (max-width: 820px) {
  .library-results { grid-template-columns: minmax(0, 1fr); max-height: 52vh; }
  .library-meta { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
}
@media (max-width: 700px) {
  .library-fab {
    left: 0.85rem;
    bottom: 0.85rem;
    min-height: 3.2rem;
    padding: 0.42rem;
    border-radius: 50%;
  }
  .library-fab__copy { display: none; }
  .library-fab__icon { width: 2.4rem; height: 2.4rem; flex-basis: 2.4rem; }
  .library-fab__count { top: -0.2rem; right: -0.15rem; }
  .library-toolbar { flex-direction: column; }
  .library-fav-filter { justify-content: center; min-height: 2.5rem; }
  .library-search { min-height: 2.55rem; }
  .library-search kbd { display: none; }
  .dash-modal.is-library .modal-head p { display: none; }
}
@media (max-width: 480px) {
  .library-card { padding: 0.68rem; }
  .library-results { max-height: 50vh; }
}

@media print {
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  .certificate-sheet, .certificate-sheet * { visibility: visible !important; }
  .certificate-sheet {
    position: fixed;
    inset: 0;
    margin: auto;
    width: 100%;
    max-width: 720px;
    height: fit-content;
    border: 2px solid #d9b44a;
    box-shadow: none;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .modal-head, .form-actions, .modal-backdrop { display: none !important; }
}

