:root {
  --bg: #f2f3f6;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(7, 18, 61, 0.1);
  --text: #07123d;
  --muted: #5b6178;
  --navy: #07123d;
  --navy-strong: #04091f;
  --sky: #4571b3;
  --gold: #c8aa6e;
  --gold-strong: #b3924f;
  --accent: #07123d;
  --accent-soft: rgba(7, 18, 61, 0.06);
  --accent-strong: #04091f;
  --success: #2a7b55;
  --radius: 16px;
  --shadow: 0 24px 60px rgba(7, 18, 61, 0.16);
  --shadow-sm: 0 1px 2px rgba(7, 18, 61, 0.06), 0 1px 3px rgba(7, 18, 61, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Rubik", sans-serif;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Barlow Condensed", sans-serif;
  margin: 0;
}

.hidden {
  display: none !important;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-strong));
  color: var(--navy-strong);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-name {
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

/* ---------- Login / Auth screen ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}

.auth-hero {
  padding: 56px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(160deg, var(--navy) 0%, #0a1a52 100%);
  color: #fff;
}

.auth-hero .brand-sub {
  color: rgba(255, 255, 255, 0.7);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-hero h1 {
  font-size: clamp(2.2rem, 3.4vw, 3.2rem);
  max-width: 14ch;
  font-weight: 700;
  line-height: 1.08;
}

.auth-copy {
  margin: 0;
  max-width: 46ch;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.feature-card {
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
}

.feature-card strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
}

.feature-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.section-label,
.card-label,
.status-label,
.topbar-eyebrow {
  display: block;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--sky);
  font-weight: 800;
}

.panel-header h2 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.panel-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form span {
  font-weight: 700;
  font-size: 0.9rem;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  background: #fff;
  transition: border-color 0.15s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--sky);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.primary-button {
  padding: 13px 18px;
  background: var(--navy);
  color: #fff;
}

.primary-button:hover {
  opacity: 0.92;
}

.secondary-button {
  padding: 9px 14px;
  background: rgba(7, 18, 61, 0.06);
  color: var(--accent-strong);
}

.form-feedback {
  min-height: 20px;
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
}

.form-feedback.error {
  color: #a23232;
}

.form-feedback.success {
  color: var(--success);
}

/* ---------- Dashboard app shell ---------- */

.app-shell {
  height: 100vh;
  display: flex;
  overflow: hidden;
}

.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
}

.sidebar-brand .brand-sub {
  color: rgba(255, 255, 255, 0.62);
}

.sidebar-nav {
  display: grid;
  gap: 4px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav-item.is-active {
  background: rgba(200, 170, 110, 0.16);
  color: var(--gold);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-strong);
  font-weight: 800;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  margin: 1px 0 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 32px;
  background: var(--panel-strong);
  border-bottom: 1px solid var(--line);
}

.app-topbar h1 {
  font-size: 1.7rem;
}

.status-pill {
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(200, 170, 110, 0.22);
  color: var(--navy-strong);
  font-weight: 800;
  font-size: 0.85rem;
  white-space: nowrap;
}

.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 40px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.case-card,
.info-card,
.panel-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.case-card {
  padding: 20px 24px;
}

.case-label {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--sky);
  font-weight: 800;
}

.case-card h2 {
  font-size: 1.5rem;
  word-break: break-word;
}

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

.info-card {
  padding: 20px 22px;
  min-width: 0;
}

.info-card h3 {
  font-size: 1.2rem;
  margin: 2px 0 6px;
  word-wrap: break-word;
}

.info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-height: 0;
}

.panel-card {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-header-row {
  margin-bottom: 14px;
}

.panel-header-row h3 {
  font-size: 1.2rem;
}

.scroll-list {
  display: grid;
  gap: 12px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}

.scroll-list::-webkit-scrollbar {
  width: 6px;
}

.scroll-list::-webkit-scrollbar-thumb {
  background: rgba(7, 18, 61, 0.16);
  border-radius: 999px;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 8px;
  background: var(--gold);
  box-shadow: 0 0 0 6px rgba(200, 170, 110, 0.18);
  flex-shrink: 0;
}

.timeline-content,
.document-item {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  min-width: 0;
}

.timeline-content h4,
.document-item h4 {
  margin: 2px 0 4px;
  font-family: "Rubik", sans-serif;
  font-size: 0.94rem;
  font-weight: 700;
  word-wrap: break-word;
}

.timeline-content p,
.document-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.timeline-date,
.document-meta {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--sky);
}

.document-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.document-badge {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(7, 18, 61, 0.08);
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 1080px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

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

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

  .auth-hero {
    padding: 40px 28px;
  }

  .auth-panel {
    padding: 32px 24px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .app-sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    padding: 14px 18px;
  }

  .sidebar-brand {
    border-bottom: 0;
    margin-bottom: 0;
    padding: 0;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-user {
    border-top: 0;
    padding-top: 0;
    margin-left: auto;
  }

  .user-meta {
    display: none;
  }

  .app-main {
    overflow: visible;
  }

  .app-content {
    overflow-y: visible;
  }

  .app-topbar {
    padding: 18px 20px;
    flex-wrap: wrap;
  }

  .app-content {
    padding: 20px 20px 32px;
  }

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

  .scroll-list {
    max-height: none;
    overflow-y: visible;
  }
}
