:root {
  --ink: #101318;
  --muted: #5b6270;
  --line: #e8e2d8;
  --paper: #fffdf9;
  --panel: rgba(255, 255, 255, 0.92);
  --nav: #101820;
  --nav-soft: #1b242d;
  --gold: #c88a22;
  --gold-2: #f0c36a;
  --danger: #c81e2b;
  --blue: #1f72d2;
  --orange: #dc6b1e;
  --beige: #d8a957;
  --cyan: #0f96b5;
  --gray: #828894;
  --yellow: #caa300;
  --shadow: 0 20px 50px rgba(34, 26, 15, 0.1);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(240, 195, 106, 0.18), transparent 34rem),
    linear-gradient(135deg, #fbfaf7 0%, #f6f1e9 100%);
}

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

button {
  cursor: pointer;
}

.login-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(240, 195, 106, 0.18), transparent 34rem),
    linear-gradient(135deg, #101820 0%, #17212b 46%, #f6f1e9 46%, #fbfaf7 100%);
}

.login-view[hidden],
.app-shell[hidden] {
  display: none;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(222, 216, 204, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
}

.login-panel .brand-mark {
  width: 58px;
  height: 58px;
}

.login-panel .brand-mark svg {
  width: 52px;
  height: 52px;
  stroke-width: 5.5;
}

.login-panel .brand-name {
  color: var(--ink);
}

.login-panel h1 {
  font-size: 2.35rem;
}

.login-error {
  margin: -4px 0 0;
  color: #a20f1a;
  font-weight: 800;
}

.form-success {
  margin: -4px 0 0;
  color: #246b2b;
  font-weight: 800;
}

.form-help {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.text-button {
  justify-self: start;
  min-height: 0;
  padding: 0;
  border: 0;
  color: #704307;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 20px;
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 32%),
    var(--nav);
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.12);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(16, 24, 32, 0.72);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.brand-mark svg {
  width: 70px;
  height: 70px;
  fill: none;
  stroke: var(--gold-2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  letter-spacing: 0;
}

.brand-name span {
  color: var(--gold-2);
}

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

.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.86);
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  color: white;
  background: linear-gradient(90deg, rgba(240, 195, 106, 0.35), rgba(255, 255, 255, 0.04));
}

.account-area {
  position: relative;
  margin-top: auto;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  color: white;
  background: transparent;
  text-align: left;
}

.sidebar-footer:hover,
.sidebar-footer[aria-expanded="true"] {
  padding: 14px 12px;
  border: 1px solid rgba(240, 195, 106, 0.28);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(240, 195, 106, 0.3), rgba(255, 255, 255, 0.04));
}

.account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(222, 216, 204, 0.35);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22);
}

.account-menu[hidden] {
  display: none;
}

.account-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #a20f1a;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.account-menu button:hover {
  background: #fff0f0;
}

.profile-chip {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  color: var(--gold-2);
  background: rgba(240, 195, 106, 0.1);
  font-weight: 700;
}

.profile-name {
  font-weight: 700;
}

.profile-subtitle {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
}

.main {
  min-width: 0;
  padding: 44px 48px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.topbar,
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.page-header > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(44vw, 560px);
  min-width: 280px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #ddd8cf;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 22px rgba(17, 20, 24, 0.04);
}

.search-box span {
  color: var(--muted);
  font-size: 1.35rem;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.filter-wrap {
  position: relative;
}

.filter-menu {
  position: absolute;
  right: 0;
  z-index: 5;
  width: 300px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(222, 216, 204, 0.95);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}

.filter-menu[hidden] {
  display: none;
}

.filter-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-menu-header button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  color: #704307;
  background: #fff3dd;
  font-weight: 800;
}

.filter-options {
  display: grid;
  max-height: 250px;
  overflow-y: auto;
  gap: 4px;
}

.filter-section {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.filter-section > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.filter-option {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--ink);
}

.filter-option:hover {
  background: #fff8ee;
}

.filter-option span {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: none;
}

.filter-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 22px;
  color: white;
  background: linear-gradient(180deg, #dca94e, #b87815);
  box-shadow: 0 10px 22px rgba(184, 120, 21, 0.22);
}

.secondary-button {
  padding: 0 16px;
  color: #704307;
  background: #fff3dd;
  border-color: #f0d5a8;
}

.ghost-button {
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border-color: #e4ded3;
}

.danger-button {
  padding: 0 16px;
  color: #a20f1a;
  background: #fff0f0;
  border-color: #f1b8bb;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  min-width: 44px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  border-color: #e4ded3;
}

.table-panel,
.form-section,
.settings-panel {
  overflow: hidden;
  border: 1px solid rgba(222, 216, 204, 0.9);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.table-wrap {
  overflow-x: auto;
}

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

th {
  padding: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: left;
  text-transform: uppercase;
}

th button {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 20px 24px;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 800;
  text-align: inherit;
  text-transform: inherit;
}

td {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr {
  transition: background 140ms ease, transform 140ms ease;
}

tbody tr:hover {
  background: #fff8ee;
}

tbody tr.case-row {
  cursor: pointer;
}

.case-name-cell {
  font-weight: 800;
}

.subtext {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
}

.date-cell {
  white-space: nowrap;
}

.date-cell.past-date {
  color: #a20f1a;
  font-weight: 850;
}

.event-display {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-display svg,
.event-display i {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}

.event-display svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.15;
}

.event-display.event-trial {
  color: #9a111b;
}

.event-display.event-hearing {
  color: #114f9b;
}

.event-display.event-discovery-due {
  color: #197a7a;
}

.event-display.event-response-due {
  color: #875500;
}

.event-display.event-pending {
  color: #6e2ea1;
}

.event-display.event-resolved {
  color: #2f7d32;
}

.event-display.event-monitor {
  color: #173a5e;
}

.event-display.event-under-advisement {
  color: #315c73;
}

.event-display.event-opposing-party-deadline {
  color: #df4a15;
}

.event-display.event-3rd-party-deadline {
  color: #6330a3;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 24px;
  color: var(--muted);
}

.empty-state {
  padding: 54px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state h2 {
  color: var(--ink);
}

.page-header {
  justify-content: flex-start;
}

.detail-layout {
  display: grid;
  gap: 18px;
}

.top-save-actions {
  display: flex;
  justify-content: flex-end;
}

.form-section,
.settings-panel {
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  min-height: 42px;
  margin-bottom: 18px;
}

.section-heading.split {
  justify-content: space-between;
  gap: 16px;
}

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

label {
  display: grid;
  gap: 8px;
}

label > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ded8cf;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fffefc;
  outline: 0;
}

textarea {
  min-height: 180px;
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 138, 34, 0.16);
}

.wide-field {
  grid-column: 1 / -1;
}

.input-with-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

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

.event-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 190px) minmax(130px, 160px) 44px;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffbf4;
}

.event-editor.date-disabled .event-date-label {
  opacity: 0.42;
}

.event-editor.time-disabled .event-time-label {
  opacity: 0.42;
}

.notes-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-actions > div {
  display: flex;
  gap: 10px;
}

.settings-panel {
  max-width: 620px;
  margin-bottom: 18px;
}

.settings-actions {
  margin-top: 18px;
}

#settingsSaved,
#dashboardDefaultsSaved {
  color: var(--muted);
  font-weight: 700;
}

.settings-fieldset {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-fieldset > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.choice-row,
.settings-checklist label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--ink);
  font-weight: 750;
}

.choice-row input,
.settings-checklist input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--gold);
}

.settings-checklist {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

#changePasswordSaved {
  color: #246b2b;
  font-weight: 800;
}

#inviteUserSaved {
  color: #246b2b;
  font-weight: 800;
}

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

.admin-users-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffbf4;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-name {
  font-weight: 850;
}

.admin-user-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #2f7d32;
  background: #e7f5e8;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-pill.inactive {
  color: #5b6270;
  background: #e7e8eb;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .brand {
    grid-auto-flow: column;
    justify-content: start;
    margin-bottom: 16px;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }

  .brand-mark svg {
    width: 44px;
    height: 44px;
    stroke-width: 5.5;
  }

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

  .sidebar-footer {
    display: none;
  }

  .account-area {
    display: none;
  }

  .main {
    padding: 30px 20px;
  }

  .topbar-actions {
    width: 100%;
  }

  .search-box {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .topbar-actions,
  .top-save-actions,
  .detail-actions,
  .detail-actions > div {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .danger-button {
    width: 100%;
  }

  .form-grid,
  .event-editor,
  .input-with-button {
    grid-template-columns: 1fr;
  }

  .event-editor .icon-button {
    width: 100%;
  }
}
