/* ============================================================
   CruiseOS owner dashboard
   Brand palette: plum #4A2634, gold #C9A86A, pale pink #FBF3F3
   ============================================================ */

:root {
  --plum: #4A2634;
  --plum-deep: #381B26;
  --plum-ink: #2B141D;
  --plum-soft: #6E4050;
  --gold: #C9A86A;
  --gold-dark: #B08F4F;
  --gold-soft: rgba(201, 168, 106, 0.16);
  --blush: #FBF3F3;
  --blush-2: #F5E6E6;
  --line: #EBD9D9;
  --text: #3A2230;
  --muted: #93707E;
  --white: #FFFFFF;
  --success: #35714F;
  --success-bg: #EAF4EE;
  --danger: #B3424A;
  --danger-bg: #FBECEC;
  --radius: 14px;
  --shadow: 0 8px 22px rgba(74, 38, 52, 0.07);
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--blush);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--plum-ink); }
h1 { font-size: 24px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-gold {
  background: var(--gold);
  color: var(--plum-ink);
}
.btn-gold:hover:not(:disabled) { background: #D6B87E; }

.btn-ghost {
  background: transparent;
  color: var(--plum);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--blush-2); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: #EBC8C8;
}
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-bg); }

.btn-block { width: 100%; }

.btn-link {
  background: none;
  border: 0;
  padding: 4px 6px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 600;
}
.btn-link:hover { color: var(--plum); }

/* ---------------- Brand mark ---------------- */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  flex: none;
}
.gold-mark {
  background: linear-gradient(135deg, #C9A86A, #E0C894);
  color: var(--plum-ink);
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; letter-spacing: 0.7px; text-transform: uppercase; opacity: 0.72; }

/* ============================================================
   AUTH PAGE (index.html)
   ============================================================ */

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(201, 168, 106, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(201, 168, 106, 0.10), transparent 60%),
    linear-gradient(150deg, var(--plum) 0%, var(--plum-deep) 60%, #2B141D 100%);
  padding: 28px 16px;
}

.auth-wrap { width: min(960px, 100%); }

.auth-card {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(20, 8, 13, 0.45);
}

/* Brand panel */
.auth-brand {
  background:
    radial-gradient(420px 300px at 110% -10%, rgba(201, 168, 106, 0.22), transparent 65%),
    linear-gradient(160deg, var(--plum) 0%, var(--plum-deep) 100%);
  color: #F4E3E8;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
}
.auth-brand .brand-name { color: var(--gold); font-size: 20px; }
.auth-brand .brand-sub { color: #E9CDA8; }
.auth-brand-top { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }

.auth-tagline {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.22;
  color: var(--white);
  margin-bottom: 12px;
  font-weight: 700;
}
.auth-lead { color: #DFC6CE; margin: 0 0 22px; font-size: 14.5px; }

.auth-features { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.auth-features li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: #F4E3E8;
}
.auth-features li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}
.auth-footnote {
  margin-top: auto;
  font-size: 12px;
  color: #C6A5B0;
  border-top: 1px solid rgba(201, 168, 106, 0.25);
  padding-top: 16px;
}

/* Form panel */
.auth-main { padding: 34px 38px; display: flex; flex-direction: column; }

.tabs {
  display: flex;
  gap: 6px;
  background: var(--blush);
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 26px;
}
.tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 10px 8px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.tab.active { background: var(--white); color: var(--plum); box-shadow: 0 2px 8px rgba(74, 38, 52, 0.10); }

.panel-title { font-size: 21px; margin-bottom: 4px; }
.panel-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--plum-soft);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  background: var(--white);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.22);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-note {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--blush);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 0 0 14px;
}

.form-alert {
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13.5px;
  margin: 2px 0 14px;
}
.form-alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F0CFCF; }
.form-alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #CDE4D6; }
.form-alert[hidden] { display: none; }

.auth-done { text-align: center; padding: 18px 6px; }
.auth-done-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-done h3 { margin-bottom: 8px; }
.auth-done p { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.auth-legal {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #C9B3BB;
}

/* ============================================================
   DASHBOARD LAYOUT (dashboard.html)
   ============================================================ */

.dash-body { background: var(--blush); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  background: linear-gradient(180deg, var(--plum) 0%, var(--plum-deep) 100%);
  color: #EDD9DE;
  z-index: 60;
  transition: transform 0.22s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(201, 168, 106, 0.28);
}
.sidebar-brand .brand-name { color: var(--white); }
.sidebar-brand .brand-sub { color: #D9AFA0; }

.sidebar-company { padding: 14px 8px 4px; }
.company-label {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3px;
}
.company-name {
  font-weight: 700;
  color: var(--white);
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.company-email {
  font-size: 12px;
  color: rgba(237, 217, 222, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #E8D3D9;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--white); }
.nav-item.active {
  background: var(--gold-soft);
  color: #EBCF96;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(201, 168, 106, 0.35);
}
.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(201, 168, 106, 0.22); }
.signout { color: #D9B3BE; }
.signout:hover { background: rgba(179, 66, 74, 0.22); color: #FFD9DE; }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 13, 0.5);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.topbar-menu {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 70;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--plum);
  font-size: 20px;
  box-shadow: var(--shadow);
}

.main {
  margin-left: 264px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 30px 34px 6px;
}
.view-subtitle { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.head-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--plum);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content { flex: 1; padding: 18px 34px 48px; width: 100%; max-width: 1200px; }

/* views */
.view[hidden] { display: none; }
.view { width: 100%; max-width: 1200px; padding: 18px 34px 48px; }

.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 16px;
}
.view-desc { color: var(--muted); margin: 0; font-size: 14px; max-width: 640px; }

/* alerts */
.page-alert {
  margin: 14px 34px 0;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
}
.page-alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid #F0CFCF; }
.page-alert.success { background: var(--success-bg); color: var(--success); border: 1px solid #CDE4D6; }
.page-alert[hidden] { display: none; }

/* cards */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px 6px;
}
.card-hint { font-size: 12.5px; color: var(--muted); }
.card-empty { margin-top: 14px; }

/* stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
}
.stat-accent { background: linear-gradient(160deg, var(--plum) 0%, var(--plum-deep) 100%); border: 0; }
.stat-accent .stat-label, .stat-accent .stat-sub { color: #D9B3BE; }
.stat-accent .stat-value { color: var(--gold); }
.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--plum-ink); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }

/* tables */
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 20px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--blush-2);
  vertical-align: middle;
  font-size: 14px;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--blush); }
.cell-main { font-weight: 600; color: var(--plum-ink); }
.cell-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-actions { text-align: right; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.row-actions .btn-link { color: var(--gold-dark); }
.row-actions .btn-link.danger { color: var(--danger); }
.row-actions .btn-link:hover { text-decoration: underline; }

/* badges */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.open { background: var(--success-bg); color: var(--success); }
.badge.scheduled { background: var(--gold-soft); color: var(--gold-dark); }
.badge.active { background: var(--plum); color: #F2D5E0; }
.badge.confirmed { background: #E3ECFB; color: #2F5E9E; }
.badge.cancelled { background: var(--danger-bg); color: var(--danger); }
.badge.default { background: var(--blush-2); color: var(--plum-soft); }

.lang-chip {
  display: inline-block;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  color: var(--plum-soft);
  margin: 1px 3px 1px 0;
}

/* empty states */
.empty-state { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty-state p { margin: 0; }
.card .empty-state { border: 0; }
.card-empty {
  background: var(--white);
  border: 1px dashed #E0C6C6;
  border-radius: var(--radius);
}

/* forms (dashboard) */
.view-toolbar + .form-card, .card + .form-card { margin-top: 0; }
.form-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.form-card[hidden] { display: none; }
.form-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.span-2 { grid-column: span 2; }
.form-grid .field { margin-bottom: 12px; }
.form-grid .field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--plum-soft);
  margin-bottom: 6px;
}
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--white);
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 106, 0.22);
}
textarea { resize: vertical; }

.check-field { display: flex; align-items: flex-start; margin-top: 6px; }
.check-line { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; }
.check-line input { width: auto; margin-top: 2px; accent-color: var(--gold); }
.check-line span { font-size: 13.5px; color: var(--plum-soft); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-card .form-alert { margin-top: 4px; }

/* boats grid */
.boat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.boat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.boat-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.boat-name { font-weight: 700; color: var(--plum-ink); font-size: 15.5px; margin: 0 0 2px; }
.boat-type { font-size: 12px; color: var(--gold-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; }
.boat-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.boat-meta span {
  font-size: 12.5px;
  background: var(--blush);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 9px;
  color: var(--plum-soft);
}
.boat-desc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.boat-card-actions { margin-top: auto; display: flex; justify-content: flex-end; gap: 4px; border-top: 1px solid var(--blush-2); padding-top: 10px; }

/* crew list */
.crew-list { display: grid; gap: 10px; }
.crew-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.crew-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--plum), var(--plum-soft));
  color: var(--gold);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.crew-info { flex: 1; min-width: 0; }
.crew-name { font-weight: 700; color: var(--plum-ink); font-size: 15px; }
.crew-role { font-size: 12.5px; color: var(--gold-dark); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.crew-langs { margin-top: 3px; }
.crew-side { display: flex; align-items: center; gap: 10px; flex: none; }
.crew-phone { font-size: 13px; color: var(--muted); white-space: nowrap; }

.table-note { font-size: 12.5px; color: var(--muted); margin: 0; padding: 10px 20px 16px; border-top: 1px solid var(--blush-2); }
.total-row td { font-weight: 700; color: var(--plum-ink); background: var(--blush); border-top: 2px solid var(--line); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .boat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 60px rgba(0, 0, 0, 0.4); }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .topbar-menu { display: block; }
  .main { margin-left: 0; padding-top: 8px; }
  .content-head { padding: 16px 18px 4px; align-items: flex-start; flex-direction: column; }
  .page-alert { margin: 12px 18px 0; }
  .content, .view { padding: 14px 18px 40px; }
  .view-toolbar { flex-direction: column; align-items: stretch; }
  .view-toolbar .btn { align-self: flex-start; }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 23px; }
  .boat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .field-row { grid-template-columns: 1fr; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 24px; }
  .auth-main { padding: 26px 22px; }
  .auth-tagline { font-size: 25px; }
  .auth-footnote { margin-top: 8px; }
  .crew-side { display: none; }
}
