:root {
  --navy: #111c2f;
  --navy-2: #182844;
  --gold: #b99a58;
  --gold-soft: #efe5cf;
  --ink: #18202d;
  --muted: #697386;
  --line: #e7ebf1;
  --paper: #f7f8fb;
  --white: #ffffff;
  --success: #287a55;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
}

[hidden] {
  display: none !important;
}

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

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

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(17, 28, 47, 0.94), rgba(24, 40, 68, 0.9)),
    var(--navy);
}

.login-card {
  width: min(100%, 460px);
  background: var(--white);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.28);
}

.login-card h1 {
  font-size: 2.3rem;
  margin: 22px 0 10px;
}

.login-card > p {
  color: var(--muted);
  line-height: 1.55;
}

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

.login-brand .brand-mark {
  background: var(--navy);
  color: var(--gold-soft);
}

.sidebar {
  background: var(--navy);
  color: var(--white);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand,
.attorney-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold-soft);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand strong,
.attorney-card strong {
  display: block;
  font-size: 1rem;
}

.brand span,
.attorney-card span,
.sidebar-footer span {
  color: rgba(255, 255, 255, 0.67);
  display: block;
  font-size: 0.85rem;
  margin-top: 3px;
}

.attorney-card {
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
}

.attorney-card img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  object-position: 58% 30%;
  border: 2px solid rgba(185, 154, 88, 0.75);
}

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

nav a {
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 650;
}

nav a.active,
nav a:hover {
  background: rgba(185, 154, 88, 0.18);
  color: var(--white);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 22px;
}

.sidebar-footer strong {
  display: block;
  margin-top: 4px;
}

.sidebar-footer a {
  color: rgba(255, 255, 255, 0.72);
  display: inline-block;
  font-size: 0.85rem;
  margin-right: 10px;
  margin-top: 12px;
  text-decoration: none;
}

.sidebar-footer a:hover {
  color: var(--gold-soft);
}

main {
  padding: 32px;
  min-width: 0;
}

.admin-page {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar,
.panel-header,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar {
  margin-bottom: 26px;
}

p,
h1,
h2,
blockquote {
  margin: 0;
}

.topbar p,
.panel-header p,
.dialog-header p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  margin-top: 6px;
}

h2 {
  font-size: 1.12rem;
  margin-top: 5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

a.small-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-decoration: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.small-button {
  min-height: 42px;
  padding: 0 16px;
}

.primary-button {
  background: var(--gold);
  color: #11100d;
}

.secondary-button {
  background: var(--navy);
  color: var(--white);
}

.ghost-button,
.small-button {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
}

.account-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 12px;
  background: var(--white);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.summary-grid article,
.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(17, 28, 47, 0.06);
}

.summary-grid article {
  padding: 18px;
}

.summary-grid span {
  color: var(--muted);
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
}

.summary-grid strong {
  display: block;
  font-size: 2rem;
  margin: 9px 0 3px;
}

.summary-grid p,
.appointment-panel > p {
  color: var(--muted);
  font-size: 0.95rem;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin: 34px 0 18px;
}

.section-heading p {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-heading h2 {
  font-size: 1.45rem;
}

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

.compact-form {
  padding: 0;
  margin-top: 4px;
}

.compact-form button {
  margin-top: 16px;
}

.admin-search-panel {
  margin-bottom: 18px;
  padding: 22px;
}

.search-form {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 14px;
}

.search-form label,
.search-form button {
  margin-top: 0;
}

.search-results {
  margin-top: 14px;
}

.search-result-item {
  background: #fbfcfe;
}

.form-success {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 750;
  margin-top: 14px;
  min-height: 1.2em;
}

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

.admin-list-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.admin-list-item strong,
.admin-list-item span {
  display: block;
}

.admin-list-item span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.admin-list-item p,
.message-item p {
  color: #303a4a;
  line-height: 1.5;
  margin-top: 8px;
}

.client-account-row[data-active="0"] {
  background: #f8f2f2;
  border-color: #e6c9c9;
}

.office-task-row.priority-urgent,
.office-task-row.priority-high {
  border-left: 4px solid #b45b3d;
}

.office-task-row.status-done {
  background: #f1fbf6;
}

.office-task-row.status-deferred {
  background: #f6f7fa;
}

.admin-list-panel {
  align-self: stretch;
}

.document-manager-panel {
  grid-column: 1 / -1;
}

.document-manager-list {
  gap: 14px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 0.8fr) minmax(160px, 0.7fr);
  gap: 14px;
  align-items: end;
}

.document-row label {
  margin-top: 0;
}

.document-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.document-actions .primary-button,
.document-actions .ghost-button,
.document-actions .small-button {
  min-height: 38px;
  padding: 0 12px;
}

.drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.drop-zone {
  border: 2px dashed #c8d0dc;
  border-radius: 8px;
  background: #fbfcfe;
  cursor: pointer;
  min-height: 152px;
  padding: 18px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  background: #f7f1e4;
  border-color: var(--gold);
  transform: translateY(-1px);
}

.drop-zone strong,
.drop-zone span {
  display: block;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.drop-zone span {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 8px;
}

.drop-zone input {
  display: none;
}

.message-thread {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  max-height: 280px;
  overflow: auto;
}

.message-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.message-item strong,
.message-item span {
  display: block;
}

.message-item span {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 4px;
}

.message-compose {
  margin-top: 16px;
}

.panel {
  padding: 22px;
}

.case-panel,
.documents-panel {
  grid-column: span 1;
}

.documents-panel,
.library-panel {
  grid-column: 1;
}

.appointment-panel,
.message-panel {
  grid-column: 2;
}

.status-pill {
  background: #eaf6f0;
  color: var(--success);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}

.progress-line {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.step {
  position: relative;
  min-height: 84px;
  padding-top: 34px;
  color: var(--muted);
  font-weight: 700;
}

.step::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid #c9d0dc;
  position: absolute;
  top: 0;
  left: 0;
}

.step::after {
  content: "";
  height: 3px;
  background: #dbe0e8;
  position: absolute;
  top: 11px;
  left: 28px;
  right: 0;
}

.step:last-child::after {
  display: none;
}

.step.complete,
.step.current {
  color: var(--ink);
}

.step.complete::before,
.step.current::before,
.step.complete::after {
  border-color: var(--gold);
  background: var(--gold);
}

.step small {
  display: block;
  color: var(--muted);
  font-weight: 600;
  margin-top: 5px;
}

.appointment-date {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--navy);
  display: grid;
  place-items: center;
  align-content: center;
  margin: 24px 0 16px;
}

.appointment-date strong {
  font-size: 2rem;
  line-height: 1;
}

.appointment-date span {
  font-weight: 800;
  text-transform: uppercase;
}

.document-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.document-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.document-card strong,
.document-card span {
  display: block;
}

.document-card span {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 3px;
}

.document-card p {
  color: #303a4a;
  line-height: 1.45;
  margin-top: 8px;
}

.checklist-card {
  align-items: flex-start;
}

.checklist-card.status-approved {
  background: #f1fbf6;
  border-color: #cdebdc;
}

.checklist-card.status-waived {
  background: #f6f7fa;
}

.checklist-card.status-received {
  background: #f6f9ff;
  border-color: #d7e2f5;
}

.pdf-icon {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f5eee0;
  color: #7a5a22;
  font-weight: 900;
  flex: 0 0 auto;
}

.bank-details {
  background: #fffaf1;
  border: 1px solid #ead8b5;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
}

.bank-details strong,
.bank-details span,
.bank-details p {
  display: block;
}

.bank-details span,
.bank-details p {
  color: var(--muted);
  line-height: 1.5;
}

.bank-details dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.bank-details div {
  min-width: 0;
}

.bank-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.bank-details dd {
  font-weight: 800;
  margin: 4px 0 0;
}

blockquote {
  border-left: 4px solid var(--gold);
  padding-left: 16px;
  margin: 22px 0;
  color: #303a4a;
  line-height: 1.6;
}

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.topic-chips span {
  background: #f2f4f8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 750;
}

dialog {
  width: min(540px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 26px 70px rgba(17, 28, 47, 0.28);
}

dialog::backdrop {
  background: rgba(17, 28, 47, 0.48);
}

form {
  padding: 24px;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--ink);
  font-weight: 750;
}

.checkbox-row {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  background: #f7f8fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  line-height: 1.45;
}

.checkbox-row input {
  width: auto;
  margin-top: 4px;
}

.checkbox-row a {
  color: var(--navy);
  font-weight: 800;
}

.login-help,
.upload-note,
.form-error {
  font-size: 0.9rem;
}

.login-help {
  color: var(--muted);
  margin-top: 12px;
}

.login-help a {
  color: var(--navy);
  font-weight: 750;
}

.upload-note {
  color: var(--muted);
  margin-top: 14px;
}

.form-error {
  color: #9d2525;
  font-weight: 750;
  margin-top: 14px;
  min-height: 1.2em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.icon-button {
  width: 36px;
  height: 36px;
  background: #f2f4f8;
  font-size: 1.4rem;
}

.public-page {
  max-width: 920px;
  margin: 0 auto;
}

.public-hero {
  background: var(--navy);
  border-radius: 8px;
  color: var(--white);
  margin: 24px 0;
  padding: 34px;
}

.public-hero p {
  color: var(--gold-soft);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.public-hero span {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  margin-top: 12px;
}

.public-content {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
}

.public-content h2 {
  margin-top: 24px;
}

.public-content h2:first-child {
  margin-top: 0;
}

.public-content p,
.public-content li {
  color: #303a4a;
  line-height: 1.7;
  margin-top: 10px;
}

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

  .sidebar {
    position: static;
  }

  .summary-grid,
  .workspace-grid,
  .admin-grid,
  .bank-details dl {
    grid-template-columns: 1fr;
  }

  .documents-panel,
  .library-panel,
  .appointment-panel,
  .message-panel,
  .document-manager-panel {
    grid-column: auto;
  }

  .progress-line {
    grid-template-columns: 1fr;
  }

  .step {
    min-height: auto;
  }

  .step::after {
    display: none;
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .sidebar,
  main {
    padding: 24px;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .documents-panel,
  .library-panel,
  .appointment-panel,
  .message-panel,
  .document-manager-panel {
    grid-column: auto;
  }

  .document-row {
    grid-template-columns: 1fr;
  }

  .document-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  main,
  .sidebar {
    padding: 20px;
  }

  .topbar,
  .panel-header,
  .section-heading,
  .dialog-header,
  .search-form {
    align-items: flex-start;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}
