/* RO Classic — design tokens */
:root {
  --bg-deep: #07101f;
  --bg-night: #0a1428;
  --bg-mid: #0f1f3d;
  --bg-elevated: #16294d;
  --gold: #c9a961;
  --gold-bright: #f0d68a;
  --gold-soft: #e6cc7e;
  --gold-shadow: #5a4416;
  --ivory: #f5e9d0;
  --parchment: #e8dcc4;
  --text: #e8e1cf;
  --text-muted: #a89e84;
  --danger: #c45050;
  --success: #6fa86a;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-soft: 0 10px 40px rgba(0,0,0,0.45);
  --shadow-glow: 0 0 30px rgba(201,169,97,0.25);
  --gradient-gold: linear-gradient(180deg, #f0d68a 0%, #c9a961 50%, #8a6d2e 100%);
  --gradient-night: linear-gradient(180deg, #07101f 0%, #0f1f3d 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ivory);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: 1.1; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

a { color: var(--gold-soft); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-bright); }

p { margin: 0 0 1em; color: var(--text); }

/* === NAVIGATION === */
.nav-classic {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(7,16,31,0.96) 0%, rgba(7,16,31,0.7) 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201,169,97,0.18);
  padding: 0.6rem 0;
}
.nav-classic .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-brand img { height: 56px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.nav-menu { display: flex; align-items: center; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 0.6rem 0.4rem;
  color: var(--ivory);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
}
.nav-menu > li > a::after {
  content: '';
  position: absolute; left: 50%; bottom: 0;
  width: 0; height: 2px;
  background: var(--gradient-gold);
  transition: width 0.25s, left 0.25s;
}
.nav-menu > li:hover > a::after { width: 100%; left: 0; }
.nav-menu > li:hover > a { color: var(--gold-bright); }

.nav-menu .submenu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  background: rgba(15,31,61,0.96);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(201,169,97,0.25);
  border-radius: var(--radius);
  padding: 0.5rem 0;
  list-style: none;
  margin: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: var(--shadow-soft);
}
.nav-menu > li:hover .submenu { opacity: 1; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.submenu a {
  display: block;
  padding: 0.55rem 1.2rem;
  color: var(--text);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.submenu a:hover { background: rgba(201,169,97,0.12); color: var(--gold-bright); }

.nav-cta { display: flex; gap: 0.7rem; align-items: center; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-gold);
  color: #2a1f08;
  border-color: var(--gold-shadow);
  box-shadow: 0 4px 14px rgba(201,169,97,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(201,169,97,0.5), inset 0 1px 0 rgba(255,255,255,0.5);
  color: #2a1f08;
}
.btn-ghost {
  background: rgba(15,31,61,0.4);
  color: var(--ivory);
  border-color: rgba(201,169,97,0.4);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  background: rgba(201,169,97,0.12);
  border-color: var(--gold);
  color: var(--gold-bright);
}
.btn-lg { padding: 1rem 2.2rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* === HERO === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 8rem 1.5rem 4rem;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(7,16,31,0.45) 0%, rgba(7,16,31,0.85) 70%, var(--bg-deep) 100%);
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: 900px; }
.hero-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.5rem;
  display: inline-block;
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(201,169,97,0.35);
  border-radius: 999px;
  background: rgba(7,16,31,0.5);
}
.hero h1 {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55));
  margin-bottom: 1rem;
}
.hero-tagline {
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  color: var(--parchment);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: var(--gold);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  animation: bob 2s ease-in-out infinite;
}
.hero-scroll::after {
  content: '';
  display: block;
  width: 1px; height: 30px;
  margin: 0.6rem auto 0;
  background: linear-gradient(180deg, var(--gold) 0%, transparent 100%);
}
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* === SECTIONS === */
.section {
  position: relative;
  padding: 6rem 1.5rem;
  overflow: hidden;
}
.section .container { max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title .eyebrow {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}
.section-title h2 {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Town parallax backdrop */
.town-bg {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}

/* === CARDS === */
.card-classic {
  background: linear-gradient(180deg, rgba(15,31,61,0.6) 0%, rgba(7,16,31,0.85) 100%);
  border: 1px solid rgba(201,169,97,0.22);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.card-classic:hover {
  transform: translateY(-4px);
  border-color: rgba(201,169,97,0.5);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
}
.card-classic h3, .card-classic h4 { color: var(--gold-bright); }

/* === RATES PANEL === */
.rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.2rem;
}
.rate-tile {
  text-align: center;
  padding: 1.8rem 1rem;
  background: linear-gradient(180deg, rgba(15,31,61,0.7) 0%, rgba(7,16,31,0.9) 100%);
  border: 1px solid rgba(201,169,97,0.25);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.rate-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient-gold);
}
.rate-tile .label {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.rate-tile .value {
  font-family: 'Cinzel', serif;
  font-size: 2.6rem;
  font-weight: 700;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* === NEWS / FEATURE GRID === */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.feature-card {
  background: linear-gradient(180deg, rgba(15,31,61,0.6) 0%, rgba(7,16,31,0.9) 100%);
  border: 1px solid rgba(201,169,97,0.22);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
  display: flex; flex-direction: column;
}
.feature-card:hover { transform: translateY(-4px); border-color: rgba(201,169,97,0.5); }
.feature-card .img {
  aspect-ratio: 16 / 10;
  background-size: cover; background-position: center;
  border-bottom: 1px solid rgba(201,169,97,0.2);
}
.feature-card .body { padding: 1.4rem; flex: 1; display: flex; flex-direction: column; }
.feature-card h4 { color: var(--gold-bright); margin-bottom: 0.5rem; }
.feature-card .meta {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

/* === DOWNLOAD STRIP === */
.download-strip {
  background: var(--gradient-night);
  border-top: 1px solid rgba(201,169,97,0.25);
  border-bottom: 1px solid rgba(201,169,97,0.25);
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.download-strip::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url('/images/towns/prontera.svg');
  background-size: cover; background-position: center;
  opacity: 0.18;
}
.download-strip .container {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
  position: relative; z-index: 2;
}
.download-strip h2 { margin-bottom: 0.4rem; }

/* === FOOTER === */
.footer-classic {
  background: var(--bg-deep);
  border-top: 1px solid rgba(201,169,97,0.2);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}
.footer-classic .brand { margin-bottom: 1.2rem; }
.footer-classic .brand img { height: 70px; }
.footer-classic .copy {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1rem;
}

/* === FORMS === */
.form-card {
  background: linear-gradient(180deg, rgba(15,31,61,0.75) 0%, rgba(7,16,31,0.92) 100%);
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  max-width: 460px;
  margin: 0 auto;
}
.form-card h2 {
  text-align: center;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.6rem;
}
.form-control, input.form-control, select.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(7,16,31,0.6);
  border: 1px solid rgba(201,169,97,0.3);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, input.form-control:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.15);
}
.form-label, label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.alert, .alert-danger, .invalid-feedback, .text-danger {
  background: rgba(196,80,80,0.12);
  border: 1px solid rgba(196,80,80,0.4);
  color: #f0a8a8;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  margin: 0.5rem 0;
}
.alert ul { margin: 0; padding-left: 1.2rem; }

/* === DASHBOARD / TABLE === */
.dashboard-section { padding-top: 7rem; }
.padding-section { padding: 7rem 1.5rem 4rem; }
.card-bg-st {
  background: linear-gradient(180deg, rgba(15,31,61,0.7) 0%, rgba(7,16,31,0.9) 100%);
  border: 1px solid rgba(201,169,97,0.25);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.8rem;
  color: var(--text);
}
.card-bg-st h1, .card-bg-st h2, .card-bg-st h3, .card-bg-st h4 { color: var(--gold-bright); }
.card-bg-st .text-black { color: var(--gold-bright) !important; }

table.table {
  background: transparent !important;
  color: var(--text);
  border-collapse: collapse;
}
table.table thead th {
  background: rgba(15,31,61,0.7) !important;
  color: var(--gold) !important;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(201,169,97,0.3) !important;
  padding: 0.85rem 1rem !important;
}
table.table tbody td {
  background: rgba(7,16,31,0.5) !important;
  color: var(--text);
  border-color: rgba(201,169,97,0.12) !important;
  padding: 0.75rem 1rem !important;
}
table.table tbody tr:hover td { background: rgba(15,31,61,0.7) !important; }

/* DataTables overrides */
.dataTables_wrapper, .dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate { color: var(--text-muted) !important; }
.dataTables_filter input, .dataTables_length select {
  background: rgba(7,16,31,0.6) !important;
  border: 1px solid rgba(201,169,97,0.3) !important;
  color: var(--text) !important;
  border-radius: var(--radius);
  padding: 0.4rem 0.7rem;
}
.paginate_button { color: var(--gold) !important; }
.paginate_button.current { background: var(--gradient-gold) !important; color: #2a1f08 !important; border: none !important; }

/* Header bar buttons (dashboard quick actions) */
.header-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin: 1.5rem 0; }
.header-bar a {
  background: linear-gradient(180deg, rgba(15,31,61,0.7) 0%, rgba(7,16,31,0.85) 100%);
  border: 1px solid rgba(201,169,97,0.25);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--ivory);
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}
.header-bar a:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(201,169,97,0.18);
}

/* utility */
.text-white { color: var(--ivory) !important; }
.text-primary { color: var(--gold) !important; }
.text-success { color: var(--success) !important; }
.bg-light { background: rgba(15,31,61,0.5) !important; color: var(--text) !important; }

/* responsive */
@media (max-width: 880px) {
  .nav-menu { display: none; }
  .nav-classic .container { justify-content: space-between; }
  .hero { padding-top: 6rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .download-strip .container { flex-direction: column; text-align: center; }
}
/* Mobile hamburger toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(201,169,97,0.4);
  border-radius: var(--radius);
  width: 42px; height: 42px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; }

/* Login / register helper link */
.auth-helper {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.auth-helper a { color: var(--gold-soft); }

/* Form-wide tweaks for inner pages */
.padding-section { padding: 7rem 1.5rem 4rem; }

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: 76px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(7,16,31,0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201,169,97,0.25);
    padding: 1rem 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-menu.open { max-height: 80vh; overflow-y: auto; }
  .nav-menu > li { width: 100%; border-bottom: 1px solid rgba(201,169,97,0.12); }
  .nav-menu > li > a { padding: 1rem 1.5rem; }
  .nav-menu > li > a::after { display: none; }
  .nav-menu .submenu {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: rgba(15,31,61,0.5);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    display: none;
  }
  .nav-menu > li:hover .submenu,
  .nav-menu > li:focus-within .submenu { display: block; transform: none; }
  .submenu a { padding-left: 2.5rem; }
}

/* Admin panel — RO Classic palette override */
.admin-shell {
  padding-top: 6rem;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
}
.admin-side {
  background: linear-gradient(180deg, rgba(15,31,61,0.6) 0%, rgba(7,16,31,0.85) 100%);
  border-right: 1px solid rgba(201,169,97,0.18);
  padding: 1.5rem 0.8rem;
  min-height: calc(100vh - 6rem);
}
.admin-side .brand {
  text-align: center;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(201,169,97,0.15);
}
.admin-nav { list-style: none; padding: 0; margin: 0; }
.admin-nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  border-radius: var(--radius);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  margin-bottom: 0.2rem;
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(201,169,97,0.12);
  color: var(--gold-bright);
}
.admin-nav .icon { display: inline-block; width: 24px; color: var(--gold); margin-right: 0.4rem; }
.admin-main { padding: 2rem 2rem; }
.admin-main h1, .admin-main h2 {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1.5rem;
}
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat {
  background: linear-gradient(180deg, rgba(15,31,61,0.7) 0%, rgba(7,16,31,0.9) 100%);
  border: 1px solid rgba(201,169,97,0.22);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}
.admin-stat::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gradient-gold);
}
.admin-stat .label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.admin-stat .value {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold-bright);
}

.btn-danger {
  background: linear-gradient(180deg, #d96f6f 0%, #8a3535 100%);
  color: #fff;
  border-color: #5a1f1f;
}
.btn-success {
  background: linear-gradient(180deg, #8ed07a 0%, #4d7a3d 100%);
  color: #0a1428;
  border-color: #345222;
}

@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { min-height: auto; border-right: none; border-bottom: 1px solid rgba(201,169,97,0.18); }
  .admin-main { padding: 1.5rem 1rem; }
}
/* === Mobile-first responsive polish === */
.container { padding-left: 1rem; padding-right: 1rem; }

.dashboard-section { padding-top: 6rem; }

/* Tap targets */
.btn { min-height: 44px; }
.nav-toggle { min-height: 44px; min-width: 44px; }
input.form-control, select.form-control, textarea.form-control { min-height: 44px; font-size: 16px; /* prevent iOS zoom */ }

/* Tables — horizontal scroll on mobile rather than overflow */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -1rem; padding: 0 1rem; }
.table-wrap table { min-width: 600px; }

/* Form rows that were using bootstrap row+col now stack */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.form-row .form-label { margin-bottom: 0.2rem; }

/* Page hero (sub-pages) */
.page-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.page-hero .eyebrow {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.6rem;
}
.page-hero h1 {
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin-bottom: 0.4rem;
}

/* Balance card */
.balance-card {
  background: linear-gradient(180deg, rgba(15,31,61,0.85) 0%, rgba(7,16,31,0.95) 100%);
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-glow);
}
.balance-card .label {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
}
.balance-card .value {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

/* Status / generic alert */
.alert-success {
  background: rgba(111,168,106,0.12) !important;
  border: 1px solid rgba(111,168,106,0.4) !important;
  color: #aedca8 !important;
}
.alert-warning {
  background: rgba(201,169,97,0.12) !important;
  border: 1px solid rgba(201,169,97,0.4) !important;
  color: var(--gold-bright) !important;
}

/* Status pill */
.pill {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.pill-success { background: rgba(111,168,106,0.18); color: #aedca8; }
.pill-warning { background: rgba(201,169,97,0.18); color: var(--gold-bright); }
.pill-danger { background: rgba(196,80,80,0.18); color: #f0a8a8; }
.pill-muted { background: rgba(168,158,132,0.18); color: var(--text-muted); }

/* Modal — restyle Bootstrap modals */
.modal-content {
  background: linear-gradient(180deg, rgba(15,31,61,0.95) 0%, rgba(7,16,31,0.98) 100%) !important;
  border: 1px solid rgba(201,169,97,0.3) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--text);
}
.modal-header {
  border-bottom: 1px solid rgba(201,169,97,0.25) !important;
}
.modal-header .modal-title { color: var(--gold-bright); }
.modal-footer { border-top: 1px solid rgba(201,169,97,0.25) !important; }
.modal .btn-close {
  filter: invert(0.75) sepia(0.6) hue-rotate(20deg);
}

/* Bootstrap row/col polish — keep working */
.row { display: flex; flex-wrap: wrap; }
.row.justify-content-center { justify-content: center; }
.col-md-8, .col-md-6, .col-md-4 { box-sizing: border-box; padding: 0; }
@media (min-width: 768px) {
  .col-md-8 { flex: 0 0 66.66%; max-width: 66.66%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-4 { flex: 0 0 33.33%; max-width: 33.33%; }
}
@media (max-width: 767px) {
  .col-md-8, .col-md-6, .col-md-4 { flex: 0 0 100%; max-width: 100%; }
}

/* Bootstrap form layout normalize for our skin */
.col-form-label { padding-top: 0.4rem; }
.text-md-end { text-align: left; }
@media (min-width: 768px) {
  .text-md-end { text-align: right; }
}

/* Old card-bg-st cleanup */
.card-bg-st .text-black { color: var(--gold-bright) !important; }

/* Force horizontal scroll inside DataTables */
.dataTables_wrapper { overflow-x: auto; }
.dataTables_filter input { color: var(--text) !important; }
.dataTables_filter, .dataTables_length { margin-bottom: 0.6rem; }

/* Mobile-specific overrides */
@media (max-width: 600px) {
  h1 { font-size: 1.85rem !important; }
  h2 { font-size: 1.5rem !important; }
  .hero { padding: 5.5rem 1rem 2.5rem; min-height: 80vh; }
  .hero h1 { line-height: 1.15; }
  .hero-tagline { font-size: 0.95rem; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .section { padding: 3rem 1rem; }
  .download-strip { padding: 2.5rem 1rem; }
  .download-strip .container { flex-direction: column; text-align: center; }
  .download-strip .btn { width: 100%; }
  .form-card { padding: 1.6rem 1.2rem; }
  .card-classic { padding: 1.2rem 1rem; }
  .balance-card { padding: 1.1rem 1.2rem; }
  .balance-card .value { font-size: 1.7rem; }
  .rates-grid { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; }
  .rate-tile { padding: 1.1rem 0.5rem; }
  .rate-tile .value { font-size: 1.9rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .header-bar { grid-template-columns: 1fr 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr 1fr; }
  .admin-stat .value { font-size: 1.3rem; }
  .admin-main { padding: 1.2rem 0.8rem; }
  table.table { font-size: 0.85rem; }
  table.table thead th, table.table tbody td { padding: 0.5rem 0.5rem !important; }
}

/* Small phones */
@media (max-width: 375px) {
  .rates-grid { grid-template-columns: 1fr; }
  .header-bar { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: 1fr; }
}

/* === Mobile nav fix === */
@media (max-width: 880px) {
  .nav-menu {
    z-index: 99 !important;
  }
  /* Always show submenus on mobile drawer (no hover available) */
  .nav-menu > li:hover .submenu,
  .nav-menu > li .submenu {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    position: static !important;
    background: rgba(15,31,61,0.5) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  /* Parent label is visual only on mobile — tap it to toggle the whole drawer is what hamburger does */
  .nav-menu > li > a {
    color: var(--gold) !important;
    font-size: 0.78rem !important;
    letter-spacing: 0.25em !important;
    padding: 0.8rem 1.5rem 0.4rem !important;
  }
  .submenu a { padding: 0.7rem 1.5rem 0.7rem 2.5rem !important; min-height: 44px; }
  .nav-menu > li > a[href='#']::after { content: ' \25BE'; opacity: 0.5; font-size: 0.7em; }
  /* Stop tap on '#' label from jumping to top */
  .nav-menu > li > a[href='#'] { pointer-events: none; }
  /* Close drawer when any actual link is tapped */
  .nav-menu.open .submenu a, .nav-menu.open > li.nav-account a:not([href='#']) { /* visual hint only */ }
  /* Animated hamburger -> X */
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle span { transition: all 0.2s; }
}
/* === Mobile drawer (best-practice slide-in) === */

/* Backdrop overlay */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Drawer panel — hidden by default at all viewports, only shown on mobile */
.mobile-drawer {
  display: none; /* desktop hides it entirely */
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 360px);
  background: linear-gradient(180deg, #0f1f3d 0%, #07101f 100%);
  border-left: 1px solid rgba(201, 169, 97, 0.25);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}

@media (max-width: 880px) {
  .mobile-drawer { display: flex; }
  .mobile-drawer.is-open { transform: translateX(0); }
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(201, 169, 97, 0.2);
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #0f1f3d 0%, rgba(15, 31, 61, 0.96) 100%);
  z-index: 1;
}
.mobile-drawer-brand img {
  height: 44px;
  display: block;
}
.mobile-drawer-close {
  background: rgba(201, 169, 97, 0.1);
  border: 1px solid rgba(201, 169, 97, 0.3);
  color: var(--gold-bright);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s;
}
.mobile-drawer-close:active,
.mobile-drawer-close:hover {
  background: rgba(201, 169, 97, 0.2);
  border-color: var(--gold);
}

.mobile-drawer-nav {
  padding: 1rem 0 2rem;
  flex: 1;
}

.mobile-drawer-profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.2rem;
  margin: 0 0 0.6rem;
  border-bottom: 1px solid rgba(201, 169, 97, 0.18);
  text-decoration: none;
  color: var(--text);
}
.mobile-drawer-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-gold);
  color: #2a1f08;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(201, 169, 97, 0.3);
}

.mobile-drawer-section {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(201, 169, 97, 0.1);
}
.mobile-drawer-section:last-child {
  border-bottom: 0;
}
.mobile-drawer-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0.6rem 1.2rem 0.4rem;
}
.mobile-drawer-section a {
  display: block;
  padding: 0.85rem 1.2rem;
  color: var(--ivory);
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0;
  min-height: 44px;
  transition: background 0.15s, color 0.15s;
}
.mobile-drawer-section a:active,
.mobile-drawer-section a:focus {
  background: rgba(201, 169, 97, 0.12);
  color: var(--gold-bright);
}
.mobile-drawer-section a.mobile-drawer-logout {
  color: #f0a8a8;
  margin-top: 0.4rem;
  border-top: 1px solid rgba(201, 169, 97, 0.1);
  padding-top: 1rem;
}

/* Override the broken legacy mobile drawer rules (collapse the old <ul> approach) */
@media (max-width: 880px) {
  .nav-classic .nav-menu {
    display: none !important;
  }
  .nav-classic .nav-cta {
    display: none !important;
  }
  /* Make the hamburger really obvious */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(201, 169, 97, 0.4);
    border-radius: var(--radius);
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    margin-left: auto;
  }
  .nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
  }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* Desktop hides the hamburger */
@media (min-width: 881px) {
  .nav-toggle { display: none !important; }
  .mobile-drawer, .mobile-drawer-backdrop { display: none !important; }
}
