:root {
  color-scheme: light;
  --bg: #eef4ff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --ink: #132238;
  --muted: #66768d;
  --line: rgba(19, 34, 56, 0.12);
  --accent: #2457d6;
  --accent-strong: #183ea5;
  --accent-soft: #e8efff;
  --success: #206241;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(36, 87, 214, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(96, 159, 255, 0.18), transparent 24%),
    linear-gradient(180deg, #f6f9ff 0%, var(--bg) 100%);
}

body.sidebar-open {
  overflow: hidden;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(10, 18, 34, 0.42);
}

.sidebar-backdrop[hidden] {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 18px 20px;
  border-right: 1px solid rgba(19, 34, 56, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 249, 255, 0.96));
  backdrop-filter: blur(16px);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 16px 32px rgba(36, 87, 214, 0.2);
}

.brand-mark svg,
.nav-icon svg,
.sidebar-icon-button svg {
  width: 20px;
  height: 20px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 14px;
}

.sidebar-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(19, 34, 56, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: 0 12px 26px rgba(19, 34, 56, 0.06);
}

.sidebar-close {
  display: none;
}

.sidebar-summary {
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(36, 87, 214, 0.14);
  background: linear-gradient(180deg, rgba(232, 239, 255, 0.88), rgba(255, 255, 255, 0.8));
  box-shadow: 0 20px 34px rgba(36, 87, 214, 0.08);
}

.sidebar-kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sidebar-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sidebar-metric {
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.sidebar-metric strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.sidebar-metric span,
.sidebar-summary-copy {
  color: var(--muted);
}

.sidebar-summary-copy {
  margin: 12px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

.sidebar-nav {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 4px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-group-label {
  margin: 0 0 2px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-item:hover {
  background: rgba(36, 87, 214, 0.07);
  transform: translateX(2px);
}

.nav-item.is-active {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 16px 28px rgba(36, 87, 214, 0.22);
}

.nav-item.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.nav-item.is-disabled:hover {
  background: transparent;
  transform: none;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(36, 87, 214, 0.08);
  color: var(--accent);
}

.nav-item.is-active .nav-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.nav-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-label {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-desc {
  color: var(--muted);
  font-size: 12px;
}

.nav-item.is-active .nav-desc {
  color: rgba(255, 255, 255, 0.82);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.1);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.nav-item.is-active .nav-badge {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.nav-badge-muted {
  background: rgba(19, 34, 56, 0.06);
  color: var(--muted);
}

.sidebar-footer {
  padding-top: 4px;
}

.sidebar-footer-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  background: rgba(255, 255, 255, 0.82);
}

.sidebar-footer-card h3,
.topbar-copy h2,
.hero h1,
.card h2,
.selection-head h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sidebar-footer-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.sidebar-footer-link {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.content-shell {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  background: rgba(238, 244, 255, 0.84);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(19, 34, 56, 0.08);
}

.sidebar-toggle {
  display: none;
}

.topbar-copy {
  min-width: 0;
}

.topbar-copy h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.topbar-note {
  margin: 10px 0 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.6;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(19, 34, 56, 0.08);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.topbar-status[data-state="error"] {
  color: #b54747;
  border-color: rgba(181, 71, 71, 0.18);
  background: rgba(255, 244, 244, 0.86);
}

.layout {
  padding: 24px;
}

.content-section {
  scroll-margin-top: 120px;
}

.hero,
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 40px rgba(12, 24, 47, 0.08);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  padding: 26px;
  border-radius: 28px;
}

.hero h1 {
  font-size: clamp(30px, 4vw, 52px);
  max-width: 820px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(36, 87, 214, 0.18);
}

.hero-link-secondary {
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  border: 1px solid rgba(36, 87, 214, 0.14);
  box-shadow: none;
}

.lead {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.home-primary,
.home-side {
  min-width: 0;
}

.home-side {
  display: grid;
  gap: 18px;
  align-content: start;
}

.home-primary-top,
.home-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.home-primary-top h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  max-width: 760px;
}

.home-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.08);
  border: 1px solid rgba(36, 87, 214, 0.1);
}

.home-view-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.home-view-button.is-active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 10px 22px rgba(12, 24, 47, 0.08);
}

.home-view-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.08);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.home-panel-head {
  margin-top: 22px;
  margin-bottom: 18px;
}

.home-panel-head h2 {
  font-size: 26px;
}

.home-panel-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.home-primary-list {
  gap: 10px;
}

.home-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 34, 56, 0.1);
}

.home-card.is-overdue {
  border-color: rgba(196, 72, 72, 0.22);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.92), rgba(255, 255, 255, 0.96));
}

.home-card.is-today {
  border-color: rgba(220, 120, 20, 0.28);
}

.home-card.is-pending {
  border-color: rgba(36, 87, 214, 0.24);
}

.home-card-main {
  min-width: 0;
}

.home-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.home-task-due {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(196, 72, 72, 0.1);
  color: #c44848;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-card.is-today .home-task-due {
  background: rgba(220, 120, 20, 0.12);
  color: #c16b0e;
}

.home-card.is-pending .home-task-due {
  background: rgba(36, 87, 214, 0.1);
  color: var(--accent);
}

.home-card-main h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
}

.home-card-meta,
.home-card-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.home-card-actions {
  display: grid;
  gap: 8px;
  min-width: 164px;
}

.home-approve-button {
  min-height: 46px;
  padding: 0 18px;
  font-size: 15px;
}

.home-action-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.home-action-row button {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.home-hearing-card {
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: stretch;
}

.home-hearing-date {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(36, 87, 214, 0.08);
  border: 1px solid rgba(36, 87, 214, 0.12);
  text-align: center;
}

.home-hearing-date strong {
  font-size: 15px;
}

.home-hearing-date span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.home-hearing-card h3 {
  margin: 0;
  font-size: 18px;
}

.home-side-head {
  align-items: center;
}

.home-refresh-button {
  min-height: 44px;
  padding: 0 16px;
}

.home-sync-status {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(19, 34, 56, 0.08);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.home-sync-status[data-state="ok"] {
  color: var(--success);
  background: rgba(32, 98, 65, 0.08);
  border-color: rgba(32, 98, 65, 0.14);
}

.home-sync-status[data-state="busy"] {
  color: var(--accent);
  background: rgba(36, 87, 214, 0.08);
  border-color: rgba(36, 87, 214, 0.14);
}

.home-sync-status[data-state="warn"] {
  color: #b54747;
  background: rgba(255, 244, 244, 0.9);
  border-color: rgba(181, 71, 71, 0.16);
}

.home-sync-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.home-sync-metrics article {
  padding: 14px;
  border-radius: 18px;
  background: rgba(36, 87, 214, 0.04);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.home-sync-metrics strong {
  display: block;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.home-sync-metrics span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.home-notification-list {
  gap: 10px;
}

.home-notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(19, 34, 56, 0.08);
  cursor: pointer;
}

.home-notification-item:hover {
  box-shadow: 0 12px 24px rgba(12, 24, 47, 0.06);
}

.home-notification-copy {
  min-width: 0;
}

.home-notification-copy strong,
.home-notification-copy span {
  display: block;
}

.home-notification-copy strong {
  font-size: 15px;
  line-height: 1.4;
}

.home-notification-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.home-notification-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.overview-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 34px rgba(12, 24, 47, 0.06);
}

.overview-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.overview-card strong {
  display: block;
  font-size: clamp(24px, 2.5vw, 34px);
  letter-spacing: -0.04em;
}

.overview-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

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

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

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

.card {
  border-radius: 24px;
  padding: 22px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.form-card {
  margin-top: 18px;
}

label {
  display: block;
  font-size: 14px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(19, 34, 56, 0.14);
  border-radius: 16px;
  background: #ffffff;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(12, 24, 47, 0.03);
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
  outline: 2px solid rgba(36, 87, 214, 0.24);
  outline-offset: 2px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid rgba(19, 34, 56, 0.14);
  border-radius: 16px;
  background: #ffffff;
}

.checkbox-row span {
  margin: 0;
}

.checkbox-row input {
  width: auto;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 24px rgba(36, 87, 214, 0.18);
}

button.secondary,
#refreshButton {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid rgba(19, 34, 56, 0.08);
  box-shadow: 0 12px 24px rgba(12, 24, 47, 0.06);
}

button.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(36, 87, 214, 0.18);
}

.selection-panel {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(36, 87, 214, 0.05);
  border: 1px solid rgba(36, 87, 214, 0.12);
}

.selection-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.selection-actions {
  display: flex;
  gap: 10px;
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}

.chip {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 14px;
  background: #fffdf9;
  border: 1px solid rgba(19, 34, 56, 0.12);
}

.chip input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.chip strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.stack-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stack-list.empty {
  color: var(--muted);
}

.list-item {
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(19, 34, 56, 0.1);
}

.list-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.list-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.top-grid,
.hearings-card,
.ai-card {
  margin-top: 18px;
}

.top-grid .hearings-card {
  margin-top: 0;
}

.notifications-card {
  margin-top: 18px;
}

.hearing-stack {
  gap: 18px;
}

.hearing-day-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hearing-day-heading {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(19, 34, 56, 0.06);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.hearing-day-list {
  display: grid;
  gap: 12px;
}

.hearing-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(19, 34, 56, 0.1);
}

.hearing-date-badge {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(36, 87, 214, 0.12), rgba(36, 87, 214, 0.06));
  border: 1px solid rgba(36, 87, 214, 0.16);
  text-align: center;
}

.hearing-date-badge strong {
  font-size: 16px;
}

.hearing-date-badge span {
  color: #3159c9;
  font-size: 14px;
  font-weight: 700;
}

.hearing-content h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.hearing-content p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.task-board-head {
  margin-bottom: 14px;
}

.task-board-section .section-note {
  margin-top: 8px;
}

.task-board-toolbar {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.task-toolbar-primary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.task-search {
  display: block;
}

.task-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-add-button,
.task-import-toggle {
  min-height: 52px;
  padding: 0 18px;
}

.task-add-button svg,
.task-import-toggle svg,
.task-export-icon svg {
  width: 18px;
  height: 18px;
}

.task-board-sticky-bar {
  position: sticky;
  top: 92px;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  background: rgba(246, 250, 255, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 30px rgba(12, 24, 47, 0.06);
}

.task-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.task-jump-button,
.task-export-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(12, 24, 47, 0.04);
}

.task-jump-button[data-task-jump="open"] {
  background: linear-gradient(180deg, rgba(210, 246, 226, 0.98), rgba(240, 255, 246, 0.96));
  border-color: rgba(40, 135, 84, 0.18);
  color: #1d6a42;
}

.task-jump-button[data-task-jump="completed"] {
  background: linear-gradient(180deg, rgba(233, 240, 255, 0.98), rgba(247, 250, 255, 0.96));
  border-color: rgba(68, 100, 181, 0.18);
  color: #47618f;
}

.task-jump-button[data-task-jump="deleted"] {
  background: linear-gradient(180deg, rgba(255, 233, 229, 0.98), rgba(255, 245, 244, 0.96));
  border-color: rgba(208, 93, 78, 0.18);
  color: #bf4e41;
}

.task-jump-button[data-task-jump="open"].is-active {
  background: linear-gradient(180deg, #31a267, #1f7f4d);
  color: #fff;
  box-shadow: 0 14px 24px rgba(31, 127, 77, 0.22);
}

.task-jump-button[data-task-jump="completed"].is-active {
  background: linear-gradient(180deg, #5a77c8, #4060b2);
  color: #fff;
  box-shadow: 0 14px 24px rgba(64, 96, 178, 0.22);
}

.task-jump-button[data-task-jump="deleted"].is-active {
  background: linear-gradient(180deg, #e06757, #c84c3d);
  color: #fff;
  box-shadow: 0 14px 24px rgba(200, 76, 61, 0.22);
}

.task-jump-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.08);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
}

.task-jump-button[data-task-jump="open"] .task-jump-count {
  background: rgba(31, 127, 77, 0.12);
}

.task-jump-button[data-task-jump="completed"] .task-jump-count {
  background: rgba(64, 96, 178, 0.12);
}

.task-jump-button[data-task-jump="deleted"] .task-jump-count {
  background: rgba(200, 76, 61, 0.12);
}

.task-jump-button.is-active .task-jump-count {
  background: rgba(255, 255, 255, 0.18);
}

.task-export {
  position: relative;
}

.task-import-toggle {
  background: rgba(255, 255, 255, 0.96);
}

.task-export-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 48px));
  padding: 10px;
  border-radius: 22px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 38px rgba(12, 24, 47, 0.12);
  display: grid;
  gap: 8px;
}

.task-export-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(19, 34, 56, 0.08);
  background: linear-gradient(180deg, rgba(36, 87, 214, 0.04), rgba(36, 87, 214, 0.02));
  color: var(--ink);
  text-align: left;
}

.task-export-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.task-export-icon.is-trello {
  background: rgba(0, 121, 191, 0.12);
  color: #0079bf;
}

.task-export-icon.is-todoist {
  background: rgba(226, 68, 51, 0.12);
  color: #e24433;
}

.task-export-icon.is-notion {
  background: rgba(19, 34, 56, 0.08);
  color: #111111;
}

.task-export-icon.is-excel {
  background: rgba(24, 123, 69, 0.12);
  color: #187b45;
}

.task-export-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.task-export-copy strong {
  font-size: 15px;
}

.task-export-copy small {
  color: var(--muted);
  font-size: 12px;
}

.task-board-list {
  display: grid;
  gap: 18px;
}

.task-board-list.empty {
  color: var(--muted);
}

.task-group-section {
  display: grid;
  gap: 14px;
  scroll-margin-top: 190px;
}

.task-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(36, 87, 214, 0.1);
  background: linear-gradient(180deg, rgba(232, 239, 255, 0.8), rgba(255, 255, 255, 0.92));
}

.task-group-section[data-task-group-section="open"] .task-group-head {
  border-color: rgba(31, 127, 77, 0.16);
  background: linear-gradient(180deg, rgba(221, 248, 232, 0.92), rgba(255, 255, 255, 0.98));
}

.task-group-section[data-task-group-section="completed"] .task-group-head {
  border-color: rgba(64, 96, 178, 0.14);
  background: linear-gradient(180deg, rgba(233, 240, 255, 0.92), rgba(255, 255, 255, 0.98));
}

.task-group-section[data-task-group-section="deleted"] .task-group-head {
  border-color: rgba(200, 76, 61, 0.14);
  background: linear-gradient(180deg, rgba(255, 235, 232, 0.92), rgba(255, 255, 255, 0.98));
}

.task-group-head h3 {
  margin: 0;
  font-size: 22px;
}

.task-group-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.task-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.08);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.task-group-section[data-task-group-section="open"] .task-group-count {
  background: rgba(31, 127, 77, 0.1);
  color: #1f7f4d;
}

.task-group-section[data-task-group-section="completed"] .task-group-count {
  background: rgba(64, 96, 178, 0.1);
  color: #4060b2;
}

.task-group-section[data-task-group-section="deleted"] .task-group-count {
  background: rgba(200, 76, 61, 0.1);
  color: #c84c3d;
}

.task-group-cards {
  display: grid;
  gap: 12px;
}

.task-board-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(19, 34, 56, 0.08);
  box-shadow: 0 16px 28px rgba(12, 24, 47, 0.05);
}

.task-board-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-board-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(19, 34, 56, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.task-board-card-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.task-board-card h3 {
  margin: 14px 0 0;
  font-size: 20px;
  line-height: 1.4;
}

.task-board-card-meta {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.task-board-card-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.task-board-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.task-board-empty {
  padding: 24px 18px;
  border-radius: 20px;
  border: 1px dashed rgba(36, 87, 214, 0.18);
  background: rgba(36, 87, 214, 0.03);
  color: var(--muted);
  text-align: center;
}

.task-item {
  gap: 8px;
}

.task-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 6px;
}

.task-source {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.task-item.list-item {
  padding: 14px 16px;
}

.task-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.4;
}

.task-item p {
  margin: 3px 0;
  line-height: 1.45;
}

.ai-grid {
  align-items: flex-start;
}

.ai-controls {
  display: grid;
  gap: 14px;
}

.ai-action-row {
  flex-wrap: wrap;
}

.ai-output {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(36, 87, 214, 0.08), rgba(36, 87, 214, 0.03));
  border: 1px solid rgba(36, 87, 214, 0.12);
  min-height: 100%;
}

.ai-output .section-note {
  margin-top: 0;
}

.ai-result {
  margin: 12px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  line-height: 1.7;
  color: var(--ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notifications-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 18px;
}

.notifications-search {
  display: block;
}

.notifications-search input {
  height: 100%;
}

.notifications-actions {
  display: flex;
  gap: 10px;
}

.tebligat-list {
  gap: 18px;
}

.tebligat-day-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tebligat-day-heading {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(36, 87, 214, 0.08);
  color: #2457d6;
  font-size: 14px;
  font-weight: 700;
  text-transform: capitalize;
}

.tebligat-day-list {
  display: grid;
  gap: 12px;
}

.tebligat-card {
  padding: 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(19, 34, 56, 0.1);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tebligat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(12, 24, 47, 0.08);
}

.tebligat-card-compact {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tebligat-card-compact.is-today {
  border-color: rgba(220, 120, 20, 0.32);
}

.tebligat-card-compact.is-soon {
  border-color: rgba(32, 98, 65, 0.26);
}

.tebligat-card-compact.is-overdue {
  border-color: rgba(36, 87, 214, 0.3);
}

.tebligat-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tebligat-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tebligat-type-chip,
.tebligat-recipient-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tebligat-type-chip {
  background: rgba(36, 87, 214, 0.1);
  color: #2457d6;
}

.tebligat-recipient-chip {
  background: rgba(36, 87, 214, 0.08);
  color: var(--accent);
}

.tebligat-card-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.tebligat-card h3 {
  margin: 0;
  font-size: 22px;
}

.tebligat-card-summary {
  display: grid;
  gap: 6px;
}

.tebligat-card-summary p,
.tebligat-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tebligat-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tebligat-meta-grid div {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(36, 87, 214, 0.04);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.tebligat-meta-grid strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tebligat-meta-grid span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.preview-modal[hidden] {
  display: none;
}

.task-editor-modal[hidden] {
  display: none;
}

.task-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 998;
}

.task-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.task-editor-dialog {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  margin: 40px auto;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fffdf9;
  box-shadow: 0 18px 40px rgba(12, 24, 47, 0.18);
}

.task-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.task-editor-head h3 {
  margin: 0;
  font-size: 22px;
}

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

.task-editor-actions {
  justify-content: space-between;
  margin-top: 8px;
}

.task-editor-delete {
  color: #b54747;
  border-color: rgba(181, 71, 71, 0.18);
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
}

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
}

.preview-modal-dialog {
  position: relative;
  width: min(1100px, calc(100vw - 32px));
  height: min(90vh, calc(100vh - 32px));
  margin: 16px auto;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #fffdf9;
  box-shadow: 0 18px 40px rgba(12, 24, 47, 0.18);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(19, 34, 56, 0.1);
}

.preview-modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.job-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.case-group {
  padding-bottom: 12px;
}

.case-header {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(32, 98, 65, 0.1), rgba(32, 98, 65, 0.05));
  border: 1px solid rgba(32, 98, 65, 0.16);
}

.case-header h3 {
  margin: 0 0 6px;
}

.case-header p {
  margin: 0;
  color: var(--muted);
}

.document-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.document-type-group {
  border: 1px solid rgba(19, 34, 56, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.document-type-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  text-align: left;
}

.document-type-toggle-main {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.document-type-toggle-meta {
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(36, 87, 214, 0.08);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.document-type-toggle-arrow {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s ease;
}

.document-type-group.is-open .document-type-toggle-arrow {
  transform: rotate(180deg);
}

.document-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 14px;
  transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.28s ease;
}

.document-type-group.is-open .document-type-list {
  max-height: 10000px;
  opacity: 1;
  padding: 0 14px 14px;
}

.document-entry {
  padding: 14px;
  border-radius: 16px;
  background: rgba(36, 87, 214, 0.04);
  border: 1px solid rgba(19, 34, 56, 0.08);
}

.document-entry h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.document-entry p {
  margin: 4px 0;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill.success {
  background: rgba(32, 98, 65, 0.12);
  color: var(--success);
}

.pill.pending {
  background: rgba(36, 87, 214, 0.1);
  color: var(--accent);
}

.pill.danger {
  background: rgba(181, 71, 71, 0.12);
  color: #b54747;
}

.status {
  min-height: 24px;
  color: var(--accent);
  font-size: 14px;
}

button.document-link,
a.document-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(36, 87, 214, 0.16);
  background: rgba(36, 87, 214, 0.06);
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button.document-link:hover,
a.document-link:hover {
  background: rgba(36, 87, 214, 0.12);
  border-color: rgba(36, 87, 214, 0.24);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(320px, calc(100vw - 28px));
    transform: translateX(-100%);
    transition: transform 0.24s ease;
    box-shadow: 0 24px 48px rgba(12, 24, 47, 0.16);
  }

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

  .sidebar-close,
  .sidebar-toggle {
    display: inline-flex;
  }

  .topbar {
    padding-left: 20px;
    padding-right: 20px;
  }

  .layout {
    padding: 20px;
  }

  .home-dashboard {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .grid.two,
  .grid.three,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .hero,
  .selection-head,
  .tebligat-card-top,
  .home-primary-top,
  .home-panel-head,
  .task-editor-head,
  .task-board-sticky-bar,
  .task-group-head,
  .task-board-card-top {
    flex-direction: column;
  }

  .topbar,
  .topbar-actions,
  .hero-actions,
  .notifications-actions,
  .home-side-head,
  .home-action-row,
  .task-board-card-actions {
    align-items: stretch;
  }

  .topbar-actions {
    width: 100%;
    justify-content: stretch;
  }

  .topbar-status,
  #refreshButton,
  .hero-link {
    width: 100%;
    justify-content: center;
  }

  .layout {
    padding: 18px;
  }

  .notifications-toolbar {
    grid-template-columns: 1fr;
  }

  .task-toolbar-primary {
    grid-template-columns: 1fr;
  }

  .task-toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hearing-card,
  .tebligat-meta-grid,
  .home-card,
  .home-hearing-card {
    grid-template-columns: 1fr;
  }

  .task-board-sticky-bar {
    top: 84px;
  }

  .task-jump-nav,
  .task-export,
  .task-toolbar-actions {
    width: 100%;
  }

  .task-jump-button,
  .task-export-toggle,
  .task-add-button {
    width: 100%;
  }

  .task-export-menu {
    width: 100%;
    left: 0;
    right: auto;
  }

  .task-board-card-actions button {
    width: 100%;
  }

  .tebligat-card-date {
    text-align: left;
  }

  .home-card-actions {
    min-width: 0;
  }

  .home-approve-button,
  .home-action-row button,
  .home-panel-link,
  .home-refresh-button {
    width: 100%;
    justify-content: center;
  }

  .home-sync-metrics {
    grid-template-columns: 1fr;
  }

  .home-notification-item {
    grid-template-columns: 1fr;
  }

  .home-notification-date {
    text-align: left;
  }

  .task-editor-dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    padding: 18px;
  }

  .preview-modal-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    margin: 10px auto;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: calc(100vw - 16px);
    padding: 20px 14px 18px;
  }

  .brand-copy strong {
    font-size: 20px;
  }

  .hero,
  .card,
  .overview-card {
    border-radius: 22px;
  }

  .hero,
  .card {
    padding: 18px;
  }

  .home-view-switch {
    width: 100%;
  }

  .home-view-button {
    flex: 1;
    justify-content: center;
  }

  .topbar {
    padding: 16px;
  }

  .layout {
    padding: 16px;
  }

  .selection-actions {
    flex-wrap: wrap;
  }

  .task-board-sticky-bar {
    top: 78px;
    padding: 10px;
  }

  .task-group-head,
  .task-board-card {
    padding: 16px;
  }
}
