/* ========================================================
   Willen — Sailing Syndicate
   Shared nautical theme
   ======================================================== */

:root {
  --deep-navy: #0a2035;
  --navy: #0f3252;
  --navy-light: #16466b;
  --ocean: #1c7293;
  --ocean-light: #2f9bc7;
  --brass: #c9a154;
  --brass-light: #e3c581;
  --sail: #f6f2e7;
  --sail-dim: #ece4d0;
  --rope: #8a6a45;
  --ink: #16283a;
  --danger: #b6432c;
  --good: #2f7d5a;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--sail);
  color: var(--ink);
  margin: 0;
}

h1, h2, h3, h4, .brand {
  font-family: 'Cormorant Garamond', serif;
}

/* ---------- Wave divider ---------- */
.wave-divider {
  display: block;
  width: 100%;
  line-height: 0;
}
.wave-divider svg { width: 100%; height: 40px; display: block; }

/* ---------- Rope rule ---------- */
.rope-rule {
  height: 6px;
  background-image: repeating-linear-gradient(
    -45deg,
    var(--rope) 0px, var(--rope) 4px,
    var(--brass-light) 4px, var(--brass-light) 8px
  );
  border-radius: 3px;
  opacity: 0.85;
}

/* ---------- Top nav ---------- */
.willen-nav {
  background: linear-gradient(180deg, var(--deep-navy), var(--navy));
  border-bottom: 3px solid var(--brass);
}
.willen-nav a.nav-link {
  color: #cfe0ec;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
  padding-bottom: 2px;
}
.willen-nav a.nav-link:hover,
.willen-nav a.nav-link.active {
  color: var(--brass-light);
}
.willen-nav a.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--brass);
  border-radius: 2px;
}
.brand-mark {
  color: var(--sail);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.brand-mark .accent { color: var(--brass-light); }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid #e4dcc8;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(10,32,53,0.06);
}
.card-navy {
  background: linear-gradient(160deg, var(--navy), var(--deep-navy));
  color: var(--sail);
  border-radius: 14px;
  border: 1px solid var(--navy-light);
}

/* ---------- Buttons ---------- */
.btn-brass {
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  color: var(--deep-navy);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(201,161,84,0.35);
}
.btn-brass:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,161,84,0.45); }

.btn-ghost {
  background: transparent;
  color: var(--sail);
  border: 1.5px solid rgba(246,242,231,0.4);
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: var(--brass-light); background: rgba(255,255,255,0.05); }

/* ---------- Inputs ---------- */
.input-nautical {
  background: rgba(255,255,255,0.9);
  border: 1px solid #cbd5c0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  width: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}
.input-nautical:focus {
  outline: none;
  border-color: var(--ocean);
  box-shadow: 0 0 0 3px rgba(28,114,147,0.15);
}

/* ---------- Badges ---------- */
.badge-paid { background: rgba(47,125,90,0.12); color: var(--good); }
.badge-due  { background: rgba(182,67,44,0.12); color: var(--danger); }
.badge-role { background: rgba(201,161,84,0.15); color: var(--rope); }
.badge-watch { background: rgba(28,114,147,0.12); color: var(--ocean); }
.badge { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; letter-spacing: 0.02em; }

/* ---------- Compass rose decoration ---------- */
.compass-bg {
  position: absolute;
  opacity: 0.06;
  pointer-events: none;
}

/* ---------- Anchor icon ---------- */
.icon-circle {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--ocean-light), var(--ocean));
  color: #fff; font-size: 1.3rem;
}

/* ---------- Footer ---------- */
.willen-footer {
  background: var(--deep-navy);
  color: rgba(246,242,231,0.6);
}

/* ---------- Checklist ---------- */
.checklist-item {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed #ddd3ba;
}
.checklist-item input[type="checkbox"] {
  accent-color: var(--ocean);
  width: 18px; height: 18px; margin-top: 2px;
}
.checklist-item.checked span { text-decoration: line-through; opacity: 0.5; }

/* Tables inside scrollable cards keep readable column widths on
   small screens — the card scrolls sideways instead of clipping */
.overflow-x-auto > table { min-width: 560px; }

/* Always-visible scrollbar so nobody misses the hidden columns */
.overflow-x-auto { scrollbar-width: thin; scrollbar-color: var(--brass) var(--sail-dim); }
.overflow-x-auto::-webkit-scrollbar { height: 8px; -webkit-appearance: none; }
.overflow-x-auto::-webkit-scrollbar-track { background: var(--sail-dim); border-radius: 4px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: var(--brass); border-radius: 4px; }

/* Swipe hint shown under tables that overflow (added by shared.js) */
.swipe-hint {
  font-size: 0.72rem;
  color: var(--rope);
  text-align: center;
  padding: 6px 0 2px;
  animation: swipe-nudge 1.6s ease-in-out infinite;
}
@keyframes swipe-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}

/* ---------- Modal dialogs (replaces browser confirm/alert) ---------- */
.willen-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 32, 53, 0.65);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: modal-fade 0.15s ease-out;
}
/* iOS Safari zooms the page in when a tapped input's font is under 16px */
.willen-modal input, .willen-modal select, .willen-modal textarea { font-size: 16px; }
.willen-modal {
  background: var(--sail);
  border: 1px solid var(--brass);
  border-top: 4px solid var(--brass);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  max-width: 420px; width: 100%;
  padding: 1.6rem;
  animation: modal-pop 0.18s ease-out;
}
.willen-modal h3 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--navy);
}
.willen-modal p {
  margin: 0 0 1.3rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #3d4a55;
}
.willen-modal-btns { display: flex; gap: 0.7rem; justify-content: flex-end; flex-wrap: wrap; }
.willen-modal-btns .btn-cancel {
  background: transparent; color: var(--navy);
  border: 1.5px solid #cbd5c0; border-radius: 999px;
  padding: 0.6rem 1.4rem; font-weight: 500; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.85rem;
}
.willen-modal-btns .btn-cancel:hover { border-color: var(--ocean); }
.willen-modal-btns .btn-ok {
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  color: var(--deep-navy); border: none; border-radius: 999px;
  padding: 0.6rem 1.5rem; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 0.85rem;
  box-shadow: 0 4px 14px rgba(201,161,84,0.35);
}
.willen-modal-btns .btn-ok.danger {
  background: linear-gradient(180deg, #cc5a41, var(--danger));
  color: #fff;
  box-shadow: 0 4px 14px rgba(182,67,44,0.35);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-pop { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Utility */
.text-brass { color: var(--brass); }
.text-ocean { color: var(--ocean); }
.bg-sail-dim { background: var(--sail-dim); }
