:root {
  --bg: #07111f;
  --bg-2: #0d1b30;
  --surface: rgba(13, 22, 37, 0.84);
  --surface-strong: rgba(14, 23, 39, 0.96);
  --surface-soft: rgba(24, 42, 70, 0.64);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 197, 61, 0.16);
  --text: #eef3fb;
  --muted: #9aaac2;
  --primary: #f2aa12;
  --primary-2: #ffc841;
  --primary-3: #132745;
  --warning: #ffd36d;
  --danger: #f06b5f;
  --success: #46d39b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    radial-gradient(circle at top right, rgba(255, 200, 65, 0.18), transparent 26%),
    radial-gradient(circle at top left, rgba(25, 55, 98, 0.28), transparent 34%),
    linear-gradient(180deg, #07111f 0%, #0b1627 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.008)),
    radial-gradient(circle at 18% 10%, rgba(255, 200, 65, 0.06), transparent 20%);
  pointer-events: none;
}

.bg-scene {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.25)),
    repeating-linear-gradient(90deg, transparent, transparent 110px, rgba(255, 255, 255, 0.015) 111px, transparent 112px);
  opacity: 0.35;
  pointer-events: none;
}

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

input,
select,
textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(220, 236, 240, 0.44);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 200, 65, 0.62);
  box-shadow: 0 0 0 4px rgba(255, 200, 65, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

option {
  color: #0f171c;
}

textarea {
  resize: vertical;
  min-height: 112px;
}

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

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.stack {
  display: grid;
}

.gap-m {
  gap: 16px;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 28px;
}

.card-glass,
.card-panel,
.card-soft {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-glass {
  background: linear-gradient(180deg, rgba(14, 23, 39, 0.94), rgba(8, 14, 25, 0.9));
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
}

.card-panel {
  background: linear-gradient(180deg, rgba(16, 26, 44, 0.96), rgba(11, 20, 35, 0.94));
  border-radius: var(--radius-lg);
  padding: 22px;
}

.card-soft {
  background: linear-gradient(180deg, rgba(27, 44, 71, 0.5), rgba(16, 28, 46, 0.48));
  border-radius: var(--radius-lg);
  padding: 18px;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #141d29;
  box-shadow: 0 10px 24px rgba(255, 200, 65, 0.25);
}

.btn-secondary {
  background: rgba(19, 39, 69, 0.56);
  color: var(--text);
  border-color: rgba(255, 200, 65, 0.12);
}

.btn-danger {
  background: linear-gradient(135deg, #d95b51, #f07f63);
  color: #fff;
  box-shadow: 0 10px 24px rgba(240, 107, 95, 0.22);
}

.btn-warn {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #141d29;
  box-shadow: 0 10px 24px rgba(255, 200, 65, 0.18);
  border-color: rgba(255, 200, 65, 0.22);
}

.btn-warn:disabled {
  opacity: 0.42;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn-small {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.login-screen {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
}

.login-stage {
  width: min(1280px, 100%);
  padding: 38px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.logo-wordmark {
  display: block;
  max-width: 100%;
  height: auto;
}

.logo-wordmark-login {
  width: clamp(220px, 28vw, 360px);
  flex: 0 0 auto;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.28));
}

.brand-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: block;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

.logo-wordmark-sidebar {
  width: 132px;
  margin-bottom: 4px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.22));
}

.login-copy {
  max-width: 760px;
}

.login-panels {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 22px;
}

.login-showcase,
.login-card {
  min-height: 100%;
}

.showcase-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary-2);
  box-shadow: 0 0 14px rgba(255, 200, 65, 0.75);
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.mini-phone {
  min-height: 220px;
  border-radius: 30px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(11, 18, 24, 0.96), rgba(26, 40, 48, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.mini-phone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 18px;
  border-radius: 0 0 18px 18px;
  background: rgba(0, 0, 0, 0.45);
}

.mini-phone.highlight {
  background: linear-gradient(180deg, rgba(24, 47, 82, 0.96), rgba(13, 28, 48, 0.94));
  color: #fff;
  border-color: rgba(255, 200, 65, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 200, 65, 0.08);
}

.mini-label {
  display: inline-flex;
  margin-top: 32px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-phone strong {
  display: block;
  font-size: 1.16rem;
  margin: 12px 0 10px;
}

.mini-phone p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 22px;
  min-height: calc(100vh - 56px);
}

.sidebar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 200, 65, 0.1);
  color: var(--text);
  border-color: rgba(255, 200, 65, 0.18);
}

.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 200, 65, 0.08);
  color: var(--primary);
  font-size: 1rem;
}

.sidebar-foot {
  margin-top: auto;
}

.sidebar-foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.main-stage {
  display: grid;
  gap: 18px;
}

.topbar {
  padding: 22px 26px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 200, 65, 0.03);
}

.topbar h2 {
  margin-bottom: 8px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status-chip,
.date-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.92rem;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.overview-grid,
.content-grid {
  display: grid;
  gap: 18px;
}

.projects-page {
  gap: 20px;
}

.project-management-grid {
  display: grid;
  grid-template-columns: minmax(370px, 460px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 260px;
  gap: 18px;
  padding: 24px;
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-copy h3 {
  font-size: clamp(1.7rem, 2.6vw, 2.4rem);
  margin-bottom: 10px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.auto-break-hint {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 184, 0, 0.10);
  border: 1px solid rgba(255, 184, 0, 0.16);
  color: #f7cf69;
  font-weight: 600;
}

.hero-stat {
  display: grid;
  align-content: center;
}

.hero-stat span {
  color: var(--muted);
  margin-bottom: 10px;
}

.hero-stat strong {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 10px;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  display: grid;
  gap: 12px;
  min-height: 120px;
}

.metric-card span {
  color: var(--muted);
}

.form-hint {
  margin: 0 0 18px;
}

.metric-card strong {
  font-size: 2rem;
}

.detail-grid,
.bottom-grid,
.two-col-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.projects-layout {
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
}

.schedule-editor-panel,
.project-form-panel,
.project-overview-panel {
  min-height: auto;
}

.reports-layout {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-head h3 {
  margin-bottom: 0;
}

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

.info-tile {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.info-tile span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.info-tile strong {
  display: block;
  font-size: 1rem;
}

.timeline-list,
.report-list,
.project-card-list {
  display: grid;
  gap: 12px;
}

.project-card-list {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.timeline-item,
.report-item,
.project-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.project-card {
  background: linear-gradient(180deg, rgba(19, 33, 56, 0.92), rgba(13, 25, 42, 0.96));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.timeline-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
}

.timeline-time {
  border-radius: 14px;
  background: rgba(255, 200, 65, 0.1);
  border: 1px solid rgba(255, 200, 65, 0.14);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 800;
  min-height: 64px;
}

.timeline-body strong {
  display: block;
  margin-bottom: 6px;
}

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

.module-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.module-card:hover {
  border-color: rgba(255, 200, 65, 0.18);
  background: rgba(255, 200, 65, 0.07);
}

.module-icon {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 200, 65, 0.1);
  color: var(--primary);
  margin-bottom: 16px;
}

.module-card strong {
  display: block;
  margin-bottom: 8px;
}

.module-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.week-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.week-board--top {
  margin-top: 10px;
}

.day-column {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  min-height: 280px;
}

.day-column header {
  margin-bottom: 14px;
}

.day-column h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-column span {
  color: var(--muted);
  font-size: 0.85rem;
}

.day-block {
  border-radius: 14px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(27, 53, 92, 0.95), rgba(17, 34, 58, 0.92));
  color: #ffffff;
  font-size: 0.88rem;
  margin-bottom: 10px;
  min-height: 72px;
  border: 1px solid rgba(255, 200, 65, 0.12);
}

.day-block .block-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.day-block .block-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-block .block-time {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
}

.day-block small {
  display: block;
  opacity: 0.86;
  margin-top: 6px;
}

.day-empty {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.88rem;
  padding-top: 10px;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
}

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.project-card-head,
.report-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.project-overview-panel .section-head {
  margin-bottom: 20px;
}

.project-card strong,
.report-item strong {
  font-size: 1rem;
}

.form-panel,
.table-panel,
.project-list-panel,
.report-list-panel,
.info-panel,
.timeline-panel,
.modules-panel,
.schedule-panel {
  min-height: 100%;
}


.pill-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
}

.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.project-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

.schedule-row {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(18, 31, 52, 0.94), rgba(12, 23, 40, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.schedule-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.schedule-day strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
}

.schedule-day span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.schedule-field span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.schedule-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: auto;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
}

.schedule-switch.is-enabled {
  border-color: rgba(255, 200, 65, 0.22);
  background: rgba(255, 200, 65, 0.08);
}

.schedule-switch input {
  width: 18px;
  height: 18px;
}

.project-form-panel form {
  display: grid;
  gap: 14px;
}

.project-form-panel .inline-actions {
  margin-top: 6px;
}

.project-list-panel .project-card .eyebrow {
  margin-bottom: 10px;
}

.project-card .project-actions {
  margin-top: 16px;
}

.project-card .project-actions .btn {
  flex: 1 1 120px;
}

.error-text {
  margin: 0;
  color: #ff9ca8;
}

.empty-state {
  border-radius: 18px;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 1220px) {
  .project-management-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    padding: 18px;
  }

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

  .sidebar-foot {
    margin-top: 0;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    padding: 18px;
  }

  .login-panels,
  .hero-panel,
  .metric-row,
  .detail-grid,
  .bottom-grid,
  .two-col-layout,
  .project-management-grid,
  .projects-layout,
  .reports-layout {
    grid-template-columns: 1fr;
  }

  .showcase-grid,
  .module-grid,
  .week-board,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .schedule-times,
  .schedule-row-top,
  .crew-form-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .project-actions,
  .inline-actions {
    flex-direction: column;
  }

  .login-stage,
  .card-panel,
  .card-soft,
  .topbar,
  .sidebar {
    padding: 16px;
  }

  .login-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .logo-wordmark-login {
    width: min(280px, 100%);
  }

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

  .hero-actions,
  .sidebar-foot-row {
    flex-direction: column;
    align-items: stretch;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .timeline-time {
    min-height: 50px;
  }
}


.booking-layout {
  align-items: start;
}

.crew-panel {
  grid-column: 1 / -1;
}

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

.crew-list {
  display: grid;
  gap: 14px;
}

.crew-card {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.crew-card-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.crew-card-main p {
  margin: 6px 0 0;
}

.crew-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.two-input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.soft-sep {
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 1rem 0;
}

.info-box {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.contact-list,
.chat-list,
.upload-gallery {
  display: grid;
  gap: 0.85rem;
}

.contact-card,
.chat-item,
.upload-item,
.order-item,
.doc-item,
.position-item {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.contact-card strong,
.chat-item strong,
.upload-item strong,
.order-item strong,
.doc-item strong,
.position-item strong {
  display: block;
  margin-bottom: 0.3rem;
}

.upload-gallery {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 1rem;
}

.upload-thumb {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 0.5rem;
}

.signature-pad {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.98);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  cursor: crosshair;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-user-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-user-table th,
.admin-user-table td {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.user-stat-badge {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 178, 24, 0.16);
  color: #ffcf5a;
  font-size: 0.75rem;
}

@media (max-width: 980px) {
  .two-input-row {
    grid-template-columns: 1fr;
  }
}


.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.65rem 1rem;
}

.compact-grid {
  margin-top: 0.25rem;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-table th,
.matrix-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  text-align: left;
}

.matrix-table th {
  font-size: 0.78rem;
  color: var(--text-muted, #aab4c5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Light redesign overrides for company-facing UI ===== */
:root {
  --bg: #f4f7fb;
  --bg-2: #edf2f8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: #f7f9fc;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(214, 156, 26, 0.26);
  --text: #17212f;
  --muted: #64748b;
  --primary: #c98b11;
  --primary-2: #e9b949;
  --primary-3: #fff5da;
  --warning: #d99000;
  --danger: #d95b51;
  --success: #169b63;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(233, 185, 73, 0.16), transparent 24%),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.07), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #eef3f9 100%);
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.2)),
    radial-gradient(circle at 18% 10%, rgba(233, 185, 73, 0.08), transparent 16%);
}

.bg-scene {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(90deg, transparent, transparent 110px, rgba(15, 23, 42, 0.018) 111px, transparent 112px);
  opacity: 1;
}

input,
select,
textarea {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(201, 139, 17, 0.45);
  box-shadow: 0 0 0 4px rgba(233, 185, 73, 0.14);
  background: #fffdf8;
}

label {
  color: #334155;
}

.card-glass,
.card-panel,
.card-soft {
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow);
}

.card-glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,250,252,0.9));
  backdrop-filter: blur(14px);
}

.card-panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.card-soft {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.login-stage {
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.login-showcase {
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.mini-phone,
.mini-phone.highlight {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 28px rgba(15,23,42,0.06);
}

.mini-label,
.mini-phone p {
  color: #64748b;
}

.workspace {
  grid-template-columns: 290px minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,248,252,0.96));
}

.nav-list {
  gap: 8px;
}

.nav-item {
  padding: 13px 14px;
  color: #475569;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(180deg, #fff8e8, #fffdf7);
  color: var(--text);
  border-color: rgba(201, 139, 17, 0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.nav-icon {
  background: rgba(233, 185, 73, 0.14);
  color: #a96f00;
}

.main-stage {
  gap: 16px;
}

.topbar {
  position: sticky;
  top: 28px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 30px rgba(15,23,42,0.06);
}

.status-chip,
.date-chip,
.pill {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.08);
}

.tab-panel {
  padding-bottom: 8px;
}

.hero-panel {
  background:
    radial-gradient(circle at top right, rgba(233, 185, 73, 0.12), transparent 26%),
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.hero-copy h3,
.topbar h2,
.section-head h3,
.metric-card strong,
.hero-stat strong {
  color: #0f172a;
}

.auto-break-hint {
  background: #fff7df;
  border-color: rgba(201, 139, 17, 0.2);
  color: #8a5d00;
}

.metric-card,
.day-column,
.timeline-item,
.report-item,
.project-card,
.module-card,
.schedule-row,
.crew-card,
.info-tile {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  opacity: 0.9;
}

.metric-card span,
.info-tile span,
.day-column span,
th,
.module-card p,
.project-card p,
.report-item p,
.timeline-body p,
.empty-state,
.table-empty {
  color: #64748b;
}

.timeline-time,
.module-icon {
  background: #fff5da;
  border-color: rgba(201, 139, 17, 0.18);
  color: #9a6800;
}

.module-card:hover {
  border-color: rgba(201, 139, 17, 0.2);
  background: linear-gradient(180deg, #fffbf1, #ffffff);
}

.day-block {
  background: linear-gradient(180deg, #fff8e6, #ffffff);
  color: var(--text);
  border-color: rgba(201, 139, 17, 0.16);
}

.day-block .block-time,
.day-block small,
.day-empty {
  color: #64748b;
}

.table-wrap {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
}

th,
td {
  border-bottom-color: rgba(15, 23, 42, 0.07);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
}

tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.7);
}

tr:hover td {
  background: #fff9e9;
}

.btn-secondary {
  background: #f8fafc;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.09);
}

.btn-ghost {
  background: #ffffff;
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.10);
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: #fff8e8;
  border-color: rgba(201, 139, 17, 0.2);
}

.sidebar-foot {
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.soft-sep {
  border: 0;
  height: 1px;
  background: rgba(15, 23, 42, 0.08);
  margin: 26px 0;
}

.empty-state {
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.08);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.table-empty {
  text-align: center;
}

.company-status-banner {
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(201, 139, 17, 0.18);
  background: #fff8e8;
  color: #8a5d00;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(201,139,17,0.08);
}

.company-status-banner.is-canceled {
  border-color: rgba(217, 91, 81, 0.18);
  background: #fff1ef;
  color: #a33b34;
}

@media (max-width: 1220px) {
  .sidebar,
  .topbar {
    position: static;
  }
}

@media (max-width: 720px) {
  .workspace {
    gap: 14px;
  }

  .topbar,
  .sidebar {
    top: 0;
  }

  .status-chip,
  .date-chip,
  .pill {
    width: 100%;
    justify-content: center;
  }
}


.geo-panel {
  grid-column: 1 / -1;
}

.geo-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 12px 0 18px;
}

.geo-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.6fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: start;
}

.geo-map {
  min-height: 380px;
  border: 1px solid rgba(25, 43, 74, 0.12);
  border-radius: 18px;
  overflow: hidden;
  background: #f5f7fb;
}

.geo-event-list {
  display: grid;
  gap: 12px;
  max-height: 380px;
  overflow: auto;
  padding-right: 4px;
}

.geo-event-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(25, 43, 74, 0.1);
  border-radius: 14px;
  background: #fff;
}

.geo-event-badge,
.geo-map-marker span {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #193b72;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 16px rgba(25, 59, 114, 0.22);
}

.geo-event-badge {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.geo-event-body p,
.geo-event-body small {
  margin: 4px 0 0;
}

.geo-map-marker {
  background: transparent;
  border: none;
}

@media (max-width: 960px) {
  .geo-layout {
    grid-template-columns: 1fr;
  }

  .geo-map,
  .geo-event-list {
    max-height: none;
  }
}


.workforce-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.workforce-filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0 18px;
}

.workforce-search {
  grid-column: span 1;
}

.workforce-table-wrap table tbody tr.workforce-row {
  cursor: pointer;
}

.workforce-table-wrap table tbody tr.workforce-row:hover {
  background: rgba(36, 99, 235, 0.06);
}

.workforce-table-wrap table tbody tr.workforce-row.is-selected {
  background: rgba(36, 99, 235, 0.1);
}

.workforce-detail-panel {
  position: sticky;
  top: 20px;
}

.workforce-detail-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.compact-head h4 {
  margin: 0;
  font-size: 1rem;
}

.workforce-geo-map {
  min-height: 240px;
  margin-bottom: 12px;
}

@media (max-width: 1180px) {
  .workforce-layout {
    grid-template-columns: 1fr;
  }

  .workforce-detail-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .workforce-filter-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .workforce-filter-row {
    grid-template-columns: 1fr;
  }
}


.workforce-filter-row--extended {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.workforce-filter-row--extended .workforce-search {
  grid-column: span 2;
}

@media (max-width: 980px) {
  .workforce-filter-row--extended .workforce-search {
    grid-column: span 1;
  }
}


/* --- Running time indicator (after clock-in) --- */
.hero-panel.is-running {
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.10);
}

.running-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
  user-select: none;
}

.running-indicator .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(16, 185, 129);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: crewclockPulse 1.2s infinite;
}

.running-indicator .elapsed {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.running-indicator .hint {
  font-weight: 500;
  opacity: 0.75;
  font-size: 0.92em;
}

@keyframes crewclockPulse {
  0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.00); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.00); }
}

/* Global running chip in topbar (visible on every tab) */
.running-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-weight: 600;
  user-select: none;
}

.running-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(16, 185, 129);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: crewclockPulse 1.2s infinite;
}

.running-chip .elapsed {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* Offline / Sync chip */
.offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-weight: 600;
  user-select: none;
}

.offline-chip .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(245, 158, 11);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
  animation: crewclockPulse 1.4s infinite;
}

.offline-chip .count {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  opacity: 0.95;
}

.offline-chip.has-queue {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.33);
}

.offline-chip.is-offline {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.40);
}

/* CrewClock chat rework */
.chat-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.15rem;
  min-height: 68vh;
  padding: 1rem;
}

.chat-sidebar-pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-right: 0.25rem;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.chat-section-head {
  padding: 0.25rem 0.25rem 0 0.25rem;
}

.chat-room-list {
  display: grid;
  gap: 0.65rem;
  overflow: auto;
  padding-right: 0.35rem;
}

.chat-room-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.chat-room-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255,197,61,0.35);
}

.chat-room-item.active {
  background: rgba(255,197,61,0.09);
  border-color: rgba(255,197,61,0.42);
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
}

.chat-room-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #0d1b2f;
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,197,61,0.95));
  flex-shrink: 0;
}

.chat-room-main {
  min-width: 0;
}

.chat-room-topline,
.chat-room-bottomline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.chat-room-name,
.chat-room-preview {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-room-name {
  font-weight: 700;
}

.chat-room-preview {
  color: rgba(255,255,255,0.66);
  font-size: 0.9rem;
}

.chat-room-time {
  color: rgba(255,255,255,0.52);
  font-size: 0.78rem;
  white-space: nowrap;
}

.chat-room-unread {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  padding: 0 0.45rem;
  display: inline-grid;
  place-items: center;
  background: #ffc53d;
  color: #0d1b2f;
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-main-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
}

.chat-conversation-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.chat-conversation-meta {
  min-width: 0;
}

.chat-conversation-meta h3,
.chat-conversation-meta p {
  margin: 0;
}

.chat-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 220px;
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
}

.chat-thread {
  min-height: 260px;
  max-height: calc(68vh - 150px);
  overflow: auto;
  padding: 0.4rem 0.2rem 0.4rem 0;
  display: grid;
  align-content: start;
  gap: 0.9rem;
}

.chat-date-divider {
  justify-self: center;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.68);
  font-size: 0.82rem;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
}

.chat-message-row.mine {
  justify-content: flex-end;
}

.chat-message-row.theirs {
  justify-content: flex-start;
}

.chat-message-card {
  max-width: min(78%, 680px);
  padding: 0.8rem 0.95rem 0.75rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12);
}

.chat-message-row.mine .chat-message-card {
  background: rgba(255,197,61,0.14);
  border-color: rgba(255,197,61,0.28);
}

.chat-message-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.chat-message-author strong {
  display: block;
  margin: 0;
}

.chat-message-time {
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
}

.chat-message-text {
  white-space: pre-wrap;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: end;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.chat-composer-field {
  display: block;
}

.chat-composer-field textarea {
  width: 100%;
  min-height: 54px;
  max-height: 180px;
  resize: none;
}

.chat-send-btn {
  min-width: 120px;
}

.chat-empty-thread {
  justify-self: center;
  text-align: center;
  padding: 1.5rem 1rem;
  color: rgba(255,255,255,0.65);
}

@media (max-width: 1100px) {
  .chat-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .chat-sidebar-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-right: 0;
    padding-bottom: 1rem;
  }

  .chat-room-list {
    grid-template-columns: 1fr;
    max-height: 280px;
  }

  .chat-thread {
    max-height: 50vh;
  }
}

@media (max-width: 720px) {
  .chat-message-card {
    max-width: 92%;
  }

  .chat-composer {
    grid-template-columns: 1fr;
  }

  .chat-send-btn {
    width: 100%;
  }
}

/* ===== CrewClock mobile-native polish ===== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

html,
body {
  overflow-x: hidden;
}

body {
  -webkit-text-size-adjust: 100%;
}

body.mobile-nav-open {
  overflow: hidden;
}

.app-shell,
.workspace,
.main-stage,
.tab-panel,
.card-panel,
.card-glass,
.card-soft,
.topbar,
.hero-panel,
.chat-shell,
.chat-main-pane,
.chat-sidebar-pane {
  min-width: 0;
}

.app-shell {
  padding: 24px;
  padding-top: max(24px, calc(var(--safe-top) + 16px));
  padding-right: max(24px, calc(var(--safe-right) + 16px));
  padding-bottom: max(24px, calc(var(--safe-bottom) + 16px));
  padding-left: max(24px, calc(var(--safe-left) + 16px));
}

.login-screen {
  min-height: calc(100vh - 48px);
}

.login-stage {
  width: min(620px, 100%);
  padding: 32px;
}

.login-panels,
.login-panels--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 440px;
}

.login-card {
  width: 100%;
}

.login-showcase {
  display: none !important;
}

.sidebar-mobile-head,
.mobile-nav-toggle,
.mobile-nav-backdrop,
.sidebar-close {
  display: none;
}

.sidebar-mobile-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sidebar-close,
.mobile-nav-toggle {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.96);
  color: #17212f;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.sidebar-close {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1rem;
}

.mobile-nav-toggle {
  position: fixed;
  left: max(16px, calc(var(--safe-left) + 12px));
  bottom: max(16px, calc(var(--safe-bottom) + 12px));
  width: 54px;
  height: 54px;
  padding: 0;
  z-index: 60;
  font-size: 1.2rem;
  place-items: center;
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(4px);
  z-index: 44;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.workspace {
  grid-template-columns: 290px minmax(0, 1fr);
  align-items: start;
}

.topbar {
  top: max(16px, calc(var(--safe-top) + 8px));
}

.chat-shell {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.chat-sidebar-pane {
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.chat-room-item,
.chat-message-card,
.chat-empty-state,
.chat-date-divider {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.chat-room-item.active {
  background: linear-gradient(180deg, #fff8e8, #ffffff);
  border-color: rgba(201, 139, 17, 0.26);
  box-shadow: 0 12px 28px rgba(201, 139, 17, 0.12);
}

.chat-room-avatar {
  color: #17212f;
  background: linear-gradient(135deg, #fffaf0, #f5d27d);
}

.chat-room-preview,
.chat-room-time,
.chat-message-time,
.chat-empty-thread,
.chat-date-divider {
  color: #64748b;
}

.chat-conversation-head,
.chat-composer {
  border-color: rgba(15, 23, 42, 0.08);
}

.chat-message-row.mine .chat-message-card {
  background: linear-gradient(180deg, #fff8e8, #fffdf6);
  border-color: rgba(201, 139, 17, 0.24);
}

.chat-message-row.theirs .chat-message-card {
  background: #ffffff;
}

.chat-message-text {
  color: #17212f;
}

.chat-empty-state,
.chat-empty-thread {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

@media (max-width: 1220px) {
  .workspace {
    grid-template-columns: 1fr !important;
  }

  .sidebar,
  .topbar {
    position: static;
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
    padding-top: max(14px, calc(var(--safe-top) + 8px));
    padding-right: max(14px, calc(var(--safe-right) + 8px));
    padding-bottom: max(18px, calc(var(--safe-bottom) + 10px));
    padding-left: max(14px, calc(var(--safe-left) + 8px));
  }

  .login-screen {
    min-height: calc(100vh - 28px);
  }

  .login-stage {
    width: 100%;
    max-width: 480px;
    padding: 22px;
    border-radius: 28px;
  }

  .login-brand {
    gap: 14px;
    margin-bottom: 18px;
  }

  .login-brand h1 {
    font-size: 1.65rem;
    line-height: 1.18;
    margin-bottom: 10px;
  }

  .login-copy {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .workspace {
    position: relative;
    gap: 14px;
  }

  .mobile-nav-toggle,
  .sidebar-mobile-head,
  .sidebar-close {
    display: grid;
  }

  .mobile-nav-toggle {
    display: grid;
  }

  .mobile-nav-backdrop {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: max(10px, calc(var(--safe-top) + 6px));
    left: max(10px, calc(var(--safe-left) + 6px));
    bottom: max(10px, calc(var(--safe-bottom) + 6px));
    width: min(84vw, 320px);
    max-width: 320px;
    z-index: 50;
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.24s ease;
    overflow: auto;
    padding: 16px;
    border-radius: 28px;
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  }

  .sidebar-brand {
    display: none;
  }

  .workspace.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .workspace.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .sidebar-foot {
    margin-top: 6px;
  }

  .main-stage {
    width: 100%;
  }

  .topbar {
    position: relative;
    top: 0;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
  }

  .topbar h2 {
    font-size: 1.7rem;
    line-height: 1.15;
  }

  .topbar-meta {
    width: 100%;
    gap: 10px;
  }

  .status-chip,
  .date-chip,
  .pill,
  .running-chip,
  .offline-chip {
    min-height: 42px;
  }

  .hero-panel,
  .metric-row,
  .detail-grid,
  .bottom-grid,
  .two-col-layout,
  .project-management-grid,
  .projects-layout,
  .reports-layout,
  .geo-layout,
  .workforce-layout,
  .chat-shell {
    grid-template-columns: 1fr !important;
  }

  .metric-row,
  .module-grid,
  .info-grid,
  .schedule-grid,
  .week-board,
  .workforce-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .chat-shell {
    gap: 14px;
    min-height: auto;
    padding: 16px;
  }

  .chat-sidebar-pane {
    border-right: 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding-right: 0;
    padding-bottom: 14px;
  }

  .chat-room-list {
    max-height: 240px;
    padding-right: 0;
  }

  .chat-thread {
    max-height: 48vh;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
    padding-top: max(10px, calc(var(--safe-top) + 4px));
    padding-right: max(10px, calc(var(--safe-right) + 4px));
    padding-bottom: max(12px, calc(var(--safe-bottom) + 6px));
    padding-left: max(10px, calc(var(--safe-left) + 4px));
  }

  .login-stage,
  .card-panel,
  .card-soft,
  .topbar,
  .sidebar,
  .chat-shell {
    padding: 14px;
  }

  .logo-wordmark-login {
    width: min(230px, 100%);
  }

  .login-brand h1 {
    font-size: 1.4rem;
  }

  .login-copy {
    display: none;
  }

  .topbar h2 {
    font-size: 1.45rem;
  }

  .topbar-meta,
  .hero-actions,
  .sidebar-foot-row,
  .project-actions,
  .inline-actions,
  .schedule-row-top,
  .chat-composer {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn,
  .project-actions .btn,
  .inline-actions .btn,
  .chat-send-btn {
    width: 100%;
  }

  .metric-row,
  .module-grid,
  .info-grid,
  .schedule-grid,
  .week-board,
  .workforce-filter-row,
  .crew-form-grid,
  .schedule-times,
  .two-input-row {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .chat-room-item {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0.8rem;
  }

  .chat-room-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .chat-message-card {
    max-width: 92%;
    border-radius: 18px;
  }

  .chat-thread {
    max-height: 44vh;
  }

  .mobile-nav-toggle {
    width: 50px;
    height: 50px;
  }
}


/* ===== CrewClock web landing + login split ===== */
.web-only {
  display: block;
}

body.is-native .web-only {
  display: none !important;
}

.landing-screen {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
}

.landing-stage {
  width: min(1280px, 100%);
  padding: 42px;
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.landing-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8px 6px;
}

.landing-wordmark {
  width: clamp(240px, 30vw, 390px);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.24));
}

.landing-copy h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.02;
  margin: 0;
  letter-spacing: -0.04em;
}

.landing-text {
  max-width: 720px;
  font-size: 1.05rem;
}

.landing-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.landing-preview {
  display: grid;
  gap: 16px;
}

.landing-feature {
  min-height: 0;
}

.landing-feature h3 {
  margin-bottom: 8px;
}

.login-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 18px;
}

body.is-web .app-shell {
  padding: 40px;
}

body.is-web .login-screen {
  min-height: calc(100vh - 56px);
}

body.is-web .login-stage {
  width: min(1280px, 100%);
  padding: 38px;
}

body.is-web .login-panels {
  grid-template-columns: 1.3fr 0.9fr;
  gap: 22px;
  max-width: none;
}

body.is-web .login-card {
  width: auto;
}

body.is-web .login-showcase {
  display: block !important;
}

body.is-native .app-shell {
  padding: 24px;
  padding-top: max(24px, calc(var(--safe-top) + 16px));
  padding-right: max(24px, calc(var(--safe-right) + 16px));
  padding-bottom: max(24px, calc(var(--safe-bottom) + 16px));
  padding-left: max(24px, calc(var(--safe-left) + 16px));
}

body.is-native .login-screen {
  min-height: calc(100vh - 48px);
}

body.is-native .login-stage {
  width: min(620px, 100%);
  padding: 32px;
}

body.is-native .login-panels,
body.is-native .login-panels--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 440px;
}

body.is-native .login-card {
  width: 100%;
}

body.is-native .login-showcase {
  display: none !important;
}

body.is-native .landing-screen {
  display: none !important;
}

@media (max-width: 1100px) {
  body.is-web .landing-hero,
  body.is-web .login-panels {
    grid-template-columns: minmax(0, 1fr);
  }

  body.is-web .landing-stage,
  body.is-web .login-stage {
    width: min(760px, 100%);
  }

  body.is-web .login-showcase {
    display: none !important;
  }
}

@media (max-width: 720px) {
  body.is-web .app-shell {
    padding: 18px;
  }

  .landing-stage,
  body.is-web .login-stage {
    padding: 24px;
    border-radius: 28px;
  }

  .landing-copy h1 {
    font-size: 2.35rem;
  }

  .landing-wordmark,
  .logo-wordmark-login {
    width: min(260px, 100%);
  }

  .login-toolbar {
    margin-bottom: 14px;
  }
}
