/* ============================================================
   TraX — Resort Management System
   Design system: navy sidebar, blue primary actions, a clean
   blue + white palette (no green), Inter type, soft cards.
   ============================================================ */
:root {
  --navy: #102b3f;
  --navy-2: #173e50;
  --navy-deep: #0b2130;
  /* Accent tokens kept by name but mapped to blue shades (blue/white theme). */
  --green: #1d4ed8;
  --green-2: #2563eb;
  --mint: #e8f0ff;
  --gold: #93b4ff;
  --blue: #387bff;
  --blue-dark: #2f6ae0;
  --ink: #1c2d3d;
  --body: #45545f;
  --muted: #718096;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #e4eaf2;
  --danger: #d92d20;
  --success: #1d4ed8;
  --warn: #c9871f;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 10px;
  --shadow: 0 14px 38px rgba(16, 43, 63, .10);
  --shadow-sm: 0 4px 18px rgba(16, 43, 63, .05);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 15px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* Brand mark (mountain logo) */
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
}
.brand-mark svg { width: 24px; height: 24px; display: block; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* Sidebar */
.sidebar {
  /* Solid deep navy matched to the logo image background so the image blends with no seam. */
  background: #02112e;
  color: #c7d6dd; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: block; margin: -16px -14px 2px; padding: 0; }
/* The exact, unmodified branding image. Full-bleed to the sidebar edges (MinioS technique) and the
   bottom edge fades into the sidebar colour, so the banner dissolves with no visible seam. */
.brand-logo-full {
  width: 100%; max-width: 100%; display: block;
  -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 76%, transparent 100%);
}

.nav-group-label { font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #6f8c95; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--radius-xs);
  font-size: 13.5px; font-weight: 600; color: #c3d4d7; transition: background .14s ease, color .14s ease;
}
.nav-item:hover { background: #ffffff12; color: #fff; }
.nav-item.active { background: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(56,123,255,.35); }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; flex: none; }

.sidebar-bottom { margin-top: auto; padding-top: 14px; }
.sidebar-resort {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-xs);
  background: #ffffff10; border: 1px solid #ffffff1f;
}
.sidebar-resort .avatar { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg,var(--green),var(--gold)); }
.sidebar-resort small { display: block; color: #8fa6ad; font-size: 11px; }
.sidebar-resort .nm { font-size: 13px; font-weight: 700; color: #fff; }

/* Main column */
.main { display: flex; flex-direction: column; min-width: 0; }

/* Topbar */
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 0 26px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input {
  width: 100%; border: 1px solid var(--line); background: #f7f9f8; border-radius: var(--radius-xs);
  padding: 10px 14px 10px 38px; font-size: 13px; outline: none; color: var(--ink);
}
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56,123,255,.12); background: #fff; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 2px; font-size: 22px; color: #879b9d; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 38px; height: 38px; cursor: pointer; font-size: 15px; }
.bell { position: relative; display: inline-grid; place-items: center; text-decoration: none; color: var(--ink); }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  display: grid; place-items: center; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800; }
.resort-picker-select {
  border: 1px solid var(--line); background: #f7f9f8; border-radius: var(--radius-xs);
  padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; outline: none;
}
.resort-picker-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56,123,255,.12); }
.profile { display: flex; align-items: center; gap: 10px; }
.profile .avatar { width: 36px; height: 36px; border-radius: 50%; }
.profile .pt { line-height: 1.2; }
.profile .pt strong { font-size: 13px; }
.profile .pt small { display: block; color: var(--muted); font-size: 11px; }

.avatar { border-radius: 50%; background: linear-gradient(135deg, var(--navy-2), var(--green)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* Content */
.content { padding: 24px 26px; max-width: 1320px; width: 100%; }
.page-intro { margin: 0 0 18px; color: var(--body); font-size: 14.5px; }
.page-title { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.6px; }

/* ---------- Welcome banner ---------- */
.banner {
  border-radius: var(--radius); min-height: 150px; color: #fff; padding: 26px 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, rgba(16,43,63,.94) 0%, rgba(23,62,80,.74) 52%, rgba(37,99,235,.34) 100%),
    linear-gradient(135deg, #16496e, #0e2540);
  background-size: cover; background-position: center;
}
.banner .eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 700; color: #a9c6ff; }
.banner h2 { font-size: 23px; letter-spacing: -.6px; margin: 8px 0 6px; }
.banner p { font-size: 13px; color: #e0eeea; margin: 0; max-width: 520px; }
.banner-badge { border: 1px solid #ffffff55; background: #ffffff18; border-radius: 12px; padding: 12px 15px; font-size: 12px; line-height: 1.7; text-align: right; }

/* ---------- Cards / panels / grid ---------- */
.card, .panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card { padding: 20px; }
.panel { padding: 20px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.two-col { grid-template-columns: minmax(0,1.4fr) minmax(300px,1fr); }

.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 14.5px; margin: 0; letter-spacing: -.2px; }
.panel-head a { font-size: 12px; color: var(--green); font-weight: 700; }

/* ---------- Metric cards ---------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.metric-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--mint); color: var(--green); font-size: 18px; }
.metric strong { font-size: 27px; display: block; margin: 12px 0 5px; letter-spacing: -1px; }
.metric strong .sub { font-size: 14px; color: #87979b; font-weight: 600; }
.metric-foot { font-size: 11.5px; color: var(--muted); }
.positive { color: var(--success); font-weight: 700; }

/* Legacy .stat support */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 27px; font-weight: 800; letter-spacing: -.6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 17px; font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-xs);
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.btn-primary { color: #fff; background: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { color: var(--navy); background: #fff; border-color: var(--line); }
.btn-ghost:hover { background: #eef3fb; border-color: #cdd9ec; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-green { background: #e0ecff; color: #1d4ed8; }
.badge-amber { background: #fbf0dc; color: #a9781c; }
.badge-blue  { background: #e8f0ff; color: #2f6ae0; }
.badge-grey  { background: #eef1f0; color: var(--muted); }
.badge-red   { background: #fde8e6; color: var(--danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8a999d; padding: 10px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 12px 10px; border-bottom: 1px solid #f0f3f2; color: var(--body); }
table.data tr:last-child td { border-bottom: none; }
.guest-cell { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--ink); }
.guest-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #e6edf8; color: #3a5068; font-size: 10px; font-weight: 700; flex: none; }

/* Section header (generic) */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.2px; }

/* Resort summary list */
.resort-list { display: flex; flex-direction: column; }
.resort-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #edf1f0; }
.resort-row:last-child { border-bottom: 0; }
.resort-thumb { width: 52px; height: 44px; border-radius: 9px; flex: none; background: linear-gradient(135deg,var(--green),var(--navy-2)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.resort-info { flex: 1; min-width: 0; }
.resort-info strong { display: block; font-size: 13px; margin-bottom: 4px; }
.resort-info small { color: var(--muted); font-size: 11.5px; }
.occupancy { font-weight: 800; color: var(--green); font-size: 14px; }

/* Quick actions grid */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick {
  display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 16px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--ink); text-align: center;
}
.quick:hover { border-color: var(--blue); background: #f7faff; }
.quick .qi { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; }
.qi.b1 { background: #e8f0ff; color: var(--blue); }
.qi.b2 { background: var(--mint); color: var(--green); }
.qi.b3 { background: #fbf0dc; color: var(--warn); }

/* ---------- Placeholder / empty ---------- */
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 44px 24px; color: var(--muted); }
.placeholder .ph-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--mint); color: var(--green); font-size: 22px; }
.placeholder h3 { margin: 4px 0 0; font-size: 16px; font-weight: 800; color: var(--ink); }
.placeholder p { margin: 0; max-width: 420px; font-size: 14px; line-height: 1.6; }

/* Money helpers */
.amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.amount.due { color: var(--danger); }
.amount.paid { color: var(--success); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .metrics, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.two-col { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; width: var(--sidebar-w); }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-grid !important; }
  .search { display: none; }
}
@media (max-width: 640px) {
  .metrics, .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 18px; }
  .banner { flex-direction: column; align-items: flex-start; }
  .banner-badge { text-align: left; }
}
.menu-toggle { display: none; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }

/* ---------- Super-admin portal (distinct dark console) ---------- */
.admin-sidebar { background: #111827; color: #cbd5e1; }
.admin-brand { display: flex !important; align-items: center; gap: 12px; margin: 0 0 6px !important; padding: 6px 6px 14px !important; border-bottom: 1px solid #ffffff14; }
.admin-brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg,#334155,#1e293b); border: 1px solid #ffffff1f; font-size: 20px; color: #93c5fd; }
.admin-brand-text strong { display: block; font-size: 17px; letter-spacing: -.3px; color: #fff; line-height: 1.1; }
.admin-brand-text small { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #8aa0b8; }
.admin-sidebar .nav-group-label { color: #64748b; }
.admin-sidebar .nav-item { color: #c3cfe0; }
.admin-sidebar .nav-item:hover { background: #ffffff10; color: #fff; }
.admin-sidebar .nav-item.active { background: #334155; color: #fff; box-shadow: none; }
.admin-sidebar .sidebar-resort { background: #ffffff0d; border-color: #ffffff1a; }
.admin-sidebar .sidebar-resort .avatar { background: linear-gradient(135deg,#475569,#1e293b); }
.admin-portal-tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; }
