:root {
  /* Light dental theme */
  --bg: #f3f4f6;
  --bg-soft: #f9fafb;
  --card: #ffffff;

  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.08);
  --accent-strong: #0f766e;

  --border-subtle: #e5e7eb;

  --text-main: #111827;
  --text-soft: #6b7280;

  --danger: #ef4444;

  --status-received: #1f2937;
  --status-inprogress: #0369a1;
  --status-designing: #7c3aed;
  --status-manufacturing: #c2410c;
  --status-qc: #b45309;
  --status-complete: #15803d;
}

/* RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* GLOBAL */

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #e5f3ff 0, var(--bg) 55%);
  color: var(--text-main);
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* MAIN APP CHROME */

.app-chrome {
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* HEADER */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    #f9fafb 0,
    #e0f2fe 40%,
    #ecfdf5 100%
  );
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-line img {
  height: 34px;
  width: auto;
}

.brand-text-main {
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #0f172a;
}

.brand-text-sub {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.session-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.session-pill {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.session-pill span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}

.btn-ghost {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: #111827;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-ghost:hover {
  background: #f3f4f6;
}

/* BODY */

.app-body {
  padding: 1.4rem 1.75rem 1.9rem;
  background: linear-gradient(
    to bottom,
    var(--bg-soft) 0,
    #ffffff 45%,
    var(--bg-soft) 100%
  );
}

.section-header {
  margin-bottom: 0.9rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

/* CASES TABLE */

.table-shell {
  margin-top: 0.9rem;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.table-header-row,
.table-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr 0.9fr 0.9fr 0.7fr;
  padding: 0.7rem 1.25rem;
  font-size: 0.82rem;
  align-items: center;
}

.table-header-row {
  background: #f3f4f6;
  border-bottom: 1px solid var(--border-subtle);
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.table-row {
  border-bottom: 1px solid #f1f5f9;
}

.table-row:nth-child(even) {
  background: #f9fafb;
}

.table-row:last-child {
  border-bottom: none;
}

.cell-main {
  font-weight: 500;
  color: #111827;
}

.cell-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* STATUS BADGES */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

/* Individual statuses – tuned for light background */

.status-Received {
  background: rgba(15, 23, 42, 0.04);
  color: var(--status-received);
}
.status-Received .status-dot {
  background: var(--status-received);
}

.status-In\ Progress {
  background: rgba(56, 189, 248, 0.12);
  color: var(--status-inprogress);
}
.status-In\ Progress .status-dot {
  background: var(--status-inprogress);
}

.status-Designing {
  background: rgba(129, 140, 248, 0.14);
  color: var(--status-designing);
}
.status-Designing .status-dot {
  background: var(--status-designing);
}

.status-Manufacturing {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-manufacturing);
}
.status-Manufacturing .status-dot {
  background: var(--status-manufacturing);
}

.status-Quality\ Check {
  background: rgba(234, 179, 8, 0.15);
  color: var(--status-qc);
}
.status-Quality\ Check .status-dot {
  background: var(--status-qc);
}

.status-Complete {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-complete);
}
.status-Complete .status-dot {
  background: var(--status-complete);
}

/* FILE COUNT PILL */

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.13rem 0.6rem;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: #111827;
}

/* SMALL BUTTON (View case) */

.btn-small {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #ffffff;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-small:hover {
  filter: brightness(1.05);
}

/* LOGIN PAGE */

.login-shell {
  max-width: 420px;
  margin: 6vh auto;
  padding: 2.4rem 2.25rem 2rem;
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.9rem;
}

.login-brand-logos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-brand-logos img {
  height: 32px;
  width: auto;
}

.login-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: center;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--text-soft);
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  background: #f9fafb;
  color: var(--text-main);
}

.login-form input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
  background: #ffffff;
}

.login-form .field {
  margin-bottom: 0.95rem;
}

.login-btn-row {
  margin-top: 1.1rem;
}

.login-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #ffffff;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.login-btn:hover {
  filter: brightness(1.05);
}

.login-error {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--danger);
}

/* CASE DETAIL */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 1.25rem;
}

.detail-card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1.1rem 1.1rem 1.2rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.05);
}

.detail-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: #0f172a;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}

.detail-label {
  color: var(--text-soft);
}

.detail-value {
  color: var(--text-main);
}

.detail-notes {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.84rem;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.detail-notes strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #111827;
}

.detail-files-list {
:root {
  /* Light dental theme */
  --bg: #f3f4f6;
  --bg-soft: #f9fafb;
  --card: #ffffff;

  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.08);
  --accent-strong: #0f766e;

  --border-subtle: #e5e7eb;

  --text-main: #111827;
  --text-soft: #6b7280;

  --danger: #ef4444;

  --status-received: #1f2937;
  --status-inprogress: #0369a1;
  --status-designing: #7c3aed;
  --status-manufacturing: #c2410c;
  --status-qc: #b45309;
  --status-complete: #15803d;
}

/* RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* GLOBAL */

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #e5f3ff 0, var(--bg) 55%);
  color: var(--text-main);
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* MAIN APP CHROME */

.app-chrome {
  background: var(--card);
  border-radius: 1.25rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* HEADER */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(
    135deg,
    #f9fafb 0,
    #e0f2fe 40%,
    #ecfdf5 100%
  );
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-line img {
  height: 34px;
  width: auto;
}

.brand-text-main {
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #0f172a;
}

.brand-text-sub {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.session-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.session-pill {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid rgba(34, 197, 94, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.session-pill span:first-child {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}

.btn-ghost {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: #111827;
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-ghost:hover {
  background: #f3f4f6;
}

/* BODY */

.app-body {
  padding: 1.4rem 1.75rem 1.9rem;
  background: linear-gradient(
    to bottom,
    var(--bg-soft) 0,
    #ffffff 45%,
    var(--bg-soft) 100%
  );
}

.section-header {
  margin-bottom: 0.9rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
}

/* CASES TABLE */

.table-shell {
  margin-top: 0.9rem;
  background: #ffffff;
  border-radius: 0.9rem;
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}

.table-header-row,
.table-row {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr 0.9fr 0.9fr 0.7fr;
  padding: 0.7rem 1.25rem;
  font-size: 0.82rem;
  align-items: center;
}

.table-header-row {
  background: #f3f4f6;
  border-bottom: 1px solid var(--border-subtle);
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.table-row {
  border-bottom: 1px solid #f1f5f9;
}

.table-row:nth-child(even) {
  background: #f9fafb;
}

.table-row:last-child {
  border-bottom: none;
}

.cell-main {
  font-weight: 500;
  color: #111827;
}

.cell-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* STATUS BADGES */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

/* Individual statuses – tuned for light background */

.status-Received {
  background: rgba(15, 23, 42, 0.04);
  color: var(--status-received);
}
.status-Received .status-dot {
  background: var(--status-received);
}

.status-In\ Progress {
  background: rgba(56, 189, 248, 0.12);
  color: var(--status-inprogress);
}
.status-In\ Progress .status-dot {
  background: var(--status-inprogress);
}

.status-Designing {
  background: rgba(129, 140, 248, 0.14);
  color: var(--status-designing);
}
.status-Designing .status-dot {
  background: var(--status-designing);
}

.status-Manufacturing {
  background: rgba(248, 113, 113, 0.15);
  color: var(--status-manufacturing);
}
.status-Manufacturing .status-dot {
  background: var(--status-manufacturing);
}

.status-Quality\ Check {
  background: rgba(234, 179, 8, 0.15);
  color: var(--status-qc);
}
.status-Quality\ Check .status-dot {
  background: var(--status-qc);
}

.status-Complete {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-complete);
}
.status-Complete .status-dot {
  background: var(--status-complete);
}

/* FILE COUNT PILL */

.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0.13rem 0.6rem;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: #111827;
}

/* SMALL BUTTON (View case) */

.btn-small {
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #ffffff;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-small:hover {
  filter: brightness(1.05);
}

/* LOGIN PAGE */

.login-shell {
  max-width: 420px;
  margin: 6vh auto;
  padding: 2.4rem 2.25rem 2rem;
  background: #ffffff;
  border-radius: 1.5rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.9rem;
}

.login-brand-logos {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.login-brand-logos img {
  height: 32px;
  width: auto;
}

.login-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
  text-align: center;
}

.login-form label {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  color: var(--text-soft);
}

.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  background: #f9fafb;
  color: var(--text-main);
}

.login-form input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.2);
  background: #ffffff;
}

.login-form .field {
  margin-bottom: 0.95rem;
}

.login-btn-row {
  margin-top: 1.1rem;
}

.login-btn {
  width: 100%;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #ffffff;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.login-btn:hover {
  filter: brightness(1.05);
}

.login-error {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--danger);
}

/* CASE DETAIL */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.1fr);
  gap: 1.25rem;
}

.detail-card {
  background: #ffffff;
  border-radius: 0.9rem;
  padding: 1.1rem 1.1rem 1.2rem;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.05);
}

.detail-heading {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: #0f172a;
}

.detail-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
}

.detail-label {
  color: var(--text-soft);
}

.detail-value {
  color: var(--text-main);
}

.detail-notes {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.84rem;
  color: var(--text-soft);
  white-space: pre-wrap;
}

.detail-notes strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #111827;
}

.detail-files-list {
  list-style: none;
  margin-top: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-main);
}

.detail-files-list li + li {
  margin-top: 0.18rem;
}

.detail-files-empty {
  font-size: 0.84rem;
  color: var(--text-soft);
}

/* STATUS CHANGE FORM */

.status-form {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
}

.status-form label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.status-form select {
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: #f9fafb;
  color: var(--text-main);
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
}

.status-form button {
  border-radius: 999px;
  border: none;
  background: rgba(14, 165, 233, 0.12);
  color: #0369a1;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.status-form button:hover {
  background: rgba(14, 165, 233, 0.2);
}

/* BACK LINK */

.back-link {
  font-size: 0.8rem;
  color: var(--text-soft);
  text-decoration: none;
}

.back-link:hover {
  color: #111827;
}

/* RESPONSIVE TWEAKS */

@media (max-width: 900px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-header-row,
  .table-row {
    grid-template-columns: 1.2fr 1.2fr 1.2fr 0.9fr 0.9fr 0.7fr;
    padding-inline: 1rem;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding-inline: 1rem;
  }

  .app-body {
    padding-inline: 1.25rem;
  }

  .table-header-row,
  .table-row {
    grid-template-columns: 1.4fr 1.2fr 0.9fr 0.9fr;
  }

  .table-header-row > :nth-child(3),
  .table-header-row > :nth-child(6),
  .table-row > :nth-child(3),
  .table-row > :nth-child(6) {
    display: none;
  }

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