/**
 * JBR Demolition Works LLC — Client Portal
 * Modern premium SaaS design (light, minimal, construction-professional)
 * Fonts: Inter (self-hosted) — no external CDN
 */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f4f2;
  --bg-elevated: #ffffff;
  --bg-muted: #ecece8;
  --text: #141414;
  --text-secondary: #5c5c5c;
  --text-muted: #8a8a8a;
  --border: #e2e2de;
  --border-strong: #d0d0ca;
  --accent: #e85d04;
  --accent-soft: rgba(232, 93, 4, 0.1);
  --success: #1f7a4c;
  --success-bg: #e8f5ee;
  --warning: #9a6700;
  --warning-bg: #fff6e0;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --hold: #9a6700;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 24px rgba(20, 20, 20, 0.06);
  --shadow-sm: 0 1px 2px rgba(20, 20, 20, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  --header-h: 72px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: radial-gradient(rgba(20, 20, 20, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  letter-spacing: -0.01em;
}

a {
  color: var(--text);
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.75rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand-mark {
  width: 10px;
  height: 34px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}

.brand-text strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.15rem;
  align-items: center;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-pill);
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.main-nav .nav-logout {
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px 0;
}

.site-main {
  padding: 2rem 0 3.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.5);
}

/* Notifications */
.notif-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text);
}

.notif-bell:hover {
  border-color: var(--border-strong);
  background: #fff;
}

.notif-bell svg {
  width: 18px;
  height: 18px;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.notif-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 2rem));
  max-height: 420px;
  overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 120;
}

.notif-panel.is-open {
  display: block;
}

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
}

.notif-panel-head strong {
  font-size: 0.9rem;
}

.notif-panel-head button,
.notif-mark-all {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.notif-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0.85rem 1rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.notif-item:hover {
  background: var(--bg);
}

.notif-item.unread {
  background: var(--accent-soft);
}

.notif-item h4 {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.notif-item p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.notif-item time {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notif-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Auth */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-shell {
  width: min(100%, 440px);
}

.auth-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand .brand-mark {
  margin: 0 auto 1rem;
}

.auth-brand h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.auth-subtitle {
  margin: 0;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
}

.auth-note {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-help {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.auth-help .label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.55rem;
}

.auth-help a {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin: 0.2rem 0;
}

.auth-help a:hover {
  color: var(--accent);
}

.auth-form .field + .field {
  margin-top: 1rem;
}

/* Typography / layout */
.page-intro {
  margin-bottom: 1.5rem;
}

.page-intro-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-intro h1 {
  font-size: clamp(1.55rem, 3.5vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

/* Cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm);
}

.card.featured {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.eyebrow {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.card-head h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0;
}

.meta-grid dt,
.meta-inline dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.2rem;
  font-weight: 600;
}

.meta-grid dd,
.meta-inline dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1rem 0 0;
}

.status-highlight {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}

.status-highlight .label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.status-value,
.progress-value,
.next-value {
  margin: 0.25rem 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.status-value {
  color: var(--accent);
}

.card-actions {
  margin-top: 1.25rem;
}

.description-block {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.description-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.description-block p {
  margin: 0;
  color: var(--text-secondary);
}

/* Progress */
.progress-bar {
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--text);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.progress-bar-lg {
  height: 12px;
}

.progress-huge {
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  color: var(--text);
  line-height: 1;
}

.completed-banner {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: #fff;
  background: var(--text);
  border-radius: var(--radius-sm);
}

.status-card h2 {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.status-badge {
  display: inline-block;
  margin: 0;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
}

.status-badge.status-in-progress,
.pill-gold {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(232, 93, 4, 0.25);
}

.status-badge.status-completed {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(31, 122, 76, 0.2);
}

.status-badge.status-on-hold {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(154, 103, 0, 0.2);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0.85rem;
  position: relative;
  padding-bottom: 1.25rem;
}

.timeline-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-marker {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  position: relative;
  z-index: 1;
}

.timeline-item.status-completed .timeline-marker {
  border-color: var(--success);
  background: var(--success);
}

.timeline-item.status-completed .timeline-marker::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.timeline-item.status-in-progress .timeline-marker,
.timeline-item.is-current .timeline-marker {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.timeline-item.status-on-hold .timeline-marker {
  border-color: var(--warning);
  background: var(--warning);
}

.timeline-item.status-not-required {
  opacity: 0.5;
}

.timeline-item.status-not-required .timeline-marker {
  border-style: dashed;
  background: transparent;
}

.timeline-item.is-current .timeline-body {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid rgba(232, 93, 4, 0.18);
}

.timeline-body h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
}

.timeline-status {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.timeline-item.status-in-progress .timeline-status,
.timeline-item.is-current .timeline-status {
  color: var(--accent);
}

.timeline-item.status-completed .timeline-status {
  color: var(--success);
}

.timeline-item.status-on-hold .timeline-status {
  color: var(--warning);
}

.timeline-date {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Forms / buttons */
.field {
  display: block;
  margin-bottom: 1rem;
}

.field > span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(20, 20, 20, 0.08);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.form-hint {
  margin: -0.5rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
}

.btn-primary {
  background: var(--text);
  color: #fff;
}

.btn-primary:hover {
  background: #000;
  color: #fff;
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: rgba(180, 35, 24, 0.25);
  color: var(--danger);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Alerts */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.alert ul {
  margin: 0;
  padding-left: 1.1rem;
}

.alert-error {
  background: var(--danger-bg);
  border-color: rgba(180, 35, 24, 0.2);
  color: var(--danger);
}

.alert-success {
  background: var(--success-bg);
  border-color: rgba(31, 122, 76, 0.2);
  color: var(--success);
}

.alert-error a,
.alert-success a {
  color: inherit;
  text-decoration: underline;
}

/* Tables */
.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.search-bar .field-inline {
  flex: 1;
  min-width: 200px;
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: var(--bg);
  font-weight: 600;
}

.data-table .actions {
  white-space: nowrap;
}

.data-table .actions a {
  margin-right: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.data-table .actions a:hover {
  color: var(--accent);
}

.empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem !important;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.pill-ok {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(31, 122, 76, 0.2);
}

.pill-muted {
  background: var(--bg);
  color: var(--text-muted);
}

.danger-zone {
  border-color: rgba(180, 35, 24, 0.25);
}

.empty-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

/* Milestone admin */
.milestone-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.milestone-admin-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  align-items: end;
}

.milestone-admin-row.status-in-progress {
  border-color: rgba(232, 93, 4, 0.3);
  background: var(--accent-soft);
}

.milestone-admin-name {
  align-self: center;
}

.milestone-admin-name .pill {
  margin-left: 0.4rem;
}

.milestone-admin-row .field {
  margin: 0;
}

/* Photos */
.photo-upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--bg);
  margin-bottom: 1rem;
}

.photo-upload-zone input[type="file"] {
  width: 100%;
  font: inherit;
}

.upload-status {
  display: none;
  margin-top: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 500;
}

.upload-status.is-visible {
  display: block;
}

.upload-status.is-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.2);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.85rem;
}

.photo-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff;
}

.photo-card a,
.photo-card .photo-thumb {
  display: block;
  aspect-ratio: 1;
  background: var(--bg-muted);
  overflow: hidden;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-meta {
  padding: 0.65rem 0.7rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.photo-meta strong {
  display: block;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card .photo-actions {
  padding: 0 0.7rem 0.7rem;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 20, 20, 0.82);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: #fff;
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  font-weight: 700;
}

/* Mobile */
@media (max-width: 800px) {
  .nav-toggle {
    display: inline-block;
  }

  .header-actions {
    margin-left: auto;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .main-nav.is-open {
    display: flex;
  }

  .site-header {
    position: sticky;
  }

  .header-inner {
    position: relative;
    flex-wrap: wrap;
  }

  .milestone-admin-row {
    grid-template-columns: 1fr;
  }

  .data-table thead {
    display: none;
  }

  .data-table tr {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    border: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    font-weight: 600;
  }

  .data-table .actions {
    white-space: normal;
  }

  .notif-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: calc(var(--header-h) + 8px);
    width: auto;
  }
}

@media (max-width: 480px) {
  .auth-panel {
    padding: 1.5rem 1.15rem;
  }

  .card {
    padding: 1.1rem;
  }
}
