:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #eff6ff;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --red: #dc2626;
  --red-light: #fef2f2;
  --yellow-light: #fefce8;
  --yellow: #ca8a04;
  --orange: #c2410c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--gray-50); color: var(--gray-900); line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.page-wrap { max-width: 700px; margin: 2rem auto; padding: 0 1rem; }
.page-wrap-wide { max-width: 960px; margin: 2rem auto; padding: 0 1rem; }

/* Navbar */
.navbar { background: #fff; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; align-items: center; height: 64px; gap: 1.5rem; }
.navbar-brand { font-weight: 800; font-size: 1.2rem; color: var(--gray-900); }
.navbar-brand span { color: var(--blue); }
.nav-links { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.nav-links a { font-size: .9rem; font-weight: 500; color: var(--gray-600); white-space: nowrap; }
.nav-links a:hover { color: var(--gray-900); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--gray-600); margin-left: auto; }
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; flex-direction: column; align-items: flex-start; gap: .5rem; padding: .75rem 1rem; border-top: 1px solid var(--gray-200); position: absolute; top: 64px; left: 0; right: 0; background: #fff; }
  .nav-links.open { display: flex; }
}

/* Flash messages */
.flash { padding: .75rem 1rem; font-size: .9rem; text-align: center; }
.flash-success { background: var(--green-light); color: var(--green); border-bottom: 1px solid #bbf7d0; }
.flash-error { background: var(--red-light); color: var(--red); border-bottom: 1px solid #fecaca; }
.flash-info { background: var(--blue-light); color: var(--blue); border-bottom: 1px solid #bfdbfe; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .5rem 1rem; border-radius: 8px; font-size: .875rem; font-weight: 600; cursor: pointer; border: none; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; text-decoration: none !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300, #d1d5db); }
.btn-outline:hover:not(:disabled) { background: var(--gray-50); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }

/* Cards */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .25rem; }
.card-sub { font-size: .85rem; color: var(--gray-500); margin-bottom: 1rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .form-row-2, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
}
label, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--gray-700); margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url],
input[type=number], select, textarea {
  width: 100%; padding: .5rem .75rem; border: 1px solid var(--gray-200); border-radius: 8px;
  font-size: .9rem; font-family: inherit; background: #fff; color: var(--gray-900);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
input[type=file] { padding: .4rem .5rem; cursor: pointer; }
textarea { resize: vertical; min-height: 80px; }
.hint { font-size: .78rem; color: var(--gray-500); margin-top: .25rem; }
.form-section { margin: 1.5rem 0 .75rem; font-weight: 700; padding-bottom: .5rem; border-bottom: 2px solid var(--gray-100); }

/* Badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dbeafe; color: #1e40af; }
.badge-inactive { background: var(--gray-100); color: var(--gray-500); }

/* Hero */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #1d4ed8 100%); color: #fff; padding: 4rem 1rem 3rem; text-align: center; }
.hero h1 { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 900; line-height: 1.15; margin-bottom: .75rem; }
.hero h1 span { color: #bfdbfe; }
.hero p { font-size: 1.1rem; color: #bfdbfe; margin-bottom: 2.5rem; }
.search-box { background: #fff; border-radius: 16px; padding: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-width: 720px; margin: 0 auto; color: var(--gray-900); }

/* Tab switcher */
.tab-bar { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--gray-200); margin-bottom: 1.25rem; }
.tab-bar button { flex: 1; padding: .65rem .5rem; border: none; cursor: pointer; background: #fff; font-size: .85rem; font-weight: 600; color: var(--gray-500); transition: background .15s, color .15s; text-align: center; }
.tab-bar button.active { background: var(--blue); color: #fff; }
.tab-bar button small { display: block; font-size: .7rem; font-weight: 400; margin-top: 1px; opacity: .8; }

/* Features section */
.features { padding: 3.5rem 1rem; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; text-align: center; }
@media (max-width: 640px) { .features-grid { grid-template-columns: 1fr; } }
.feature-icon { font-size: 3rem; margin-bottom: .75rem; }
.feature-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.feature-desc { color: var(--gray-500); font-size: .9rem; }

/* CTA banner */
.cta-banner { background: var(--blue-light); border-top: 1px solid #bfdbfe; padding: 3rem 1rem; text-align: center; }

/* Search results */
.result-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); position: relative; }
.result-card.best { border-color: var(--blue); border-width: 2px; }
.best-badge { position: absolute; top: -12px; left: 1rem; background: var(--blue); color: #fff; font-size: .75rem; font-weight: 700; padding: .2rem .75rem; border-radius: 999px; }
.result-layout { display: flex; gap: 1.5rem; justify-content: space-between; }
.result-info { flex: 1; }
.result-price { text-align: right; min-width: 130px; }
@media (max-width: 560px) { .result-layout { flex-direction: column; } .result-price { text-align: left; } }
.price-big { font-size: 2rem; font-weight: 900; color: var(--blue); }
.price-unit { font-size: .78rem; color: var(--gray-500); }
.tier-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.tier-tag { background: var(--blue-light); color: var(--blue-dark); font-size: .73rem; padding: .2rem .55rem; border-radius: 6px; font-weight: 600; }
.surcharge-note { font-size: .78rem; color: var(--orange); margin-top: .4rem; }

/* Dashboard sidebar layout */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidebar { width: 220px; background: #fff; border-right: 1px solid var(--gray-200); padding: 1.5rem 1rem; flex-shrink: 0; }
.sidebar-label { font-size: .7rem; font-weight: 800; color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; padding: 0 .5rem; }
.sidebar a { display: block; padding: .55rem .75rem; border-radius: 8px; font-size: .875rem; font-weight: 600; color: var(--gray-600); margin-bottom: 2px; text-decoration: none !important; }
.sidebar a:hover { background: var(--gray-50); color: var(--gray-900); }
.sidebar a.active { background: var(--blue-light); color: var(--blue); }
.content { flex: 1; padding: 2rem; max-width: 860px; }
@media (max-width: 700px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--gray-200); padding: .75rem; display: flex; gap: .5rem; flex-wrap: wrap; }
  .sidebar-label { display: none; }
  .sidebar a { padding: .35rem .65rem; font-size: .8rem; }
  .content { padding: 1rem; }
}

/* Admin sidebar dark */
.sidebar.dark { background: #1e293b; border-right: none; }
.sidebar.dark .sidebar-label { color: #64748b; }
.sidebar.dark a { color: #94a3b8; }
.sidebar.dark a:hover { background: #334155; color: #fff; }
.sidebar.dark a.active { background: var(--blue); color: #fff; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.stat-num { font-size: 2rem; font-weight: 900; }
.stat-label { font-size: .8rem; color: var(--gray-500); margin-top: .2rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { background: var(--gray-50); font-weight: 700; color: var(--gray-700); padding: .7rem 1rem; text-align: left; border-bottom: 2px solid var(--gray-200); }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:hover td { background: var(--gray-50); }
td small { color: var(--gray-500); font-size: .78rem; }

/* Offerings */
.offering-row { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: .6rem; box-shadow: var(--shadow); }
.offering-row.inactive { opacity: .55; }
.offering-info { flex: 1; }
.offering-name { font-weight: 700; }
.offering-meta { font-size: .8rem; color: var(--gray-500); margin-top: .1rem; }
.offering-price { font-size: .9rem; font-weight: 700; color: var(--green); white-space: nowrap; }
.offering-actions { display: flex; gap: .4rem; flex-shrink: 0; }
@media (max-width: 560px) { .offering-row { flex-wrap: wrap; } }

/* Tier rows */
.tier-row, .surcharge-row { display: grid; gap: .75rem; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: .85rem; margin-bottom: .6rem; align-items: end; }
.tier-row { grid-template-columns: 1fr 1fr 1fr 1.5fr auto; }
.surcharge-row { grid-template-columns: 1fr 1fr 1fr 1.5fr auto; }
@media (max-width: 680px) { .tier-row, .surcharge-row { grid-template-columns: 1fr 1fr; } }
.remove-btn { background: none; border: none; color: var(--red); cursor: pointer; font-size: 1.2rem; padding: .25rem; align-self: flex-end; }

/* PLZ tags */
.plz-wrap { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.plz-tag { display: inline-flex; align-items: center; gap: .3rem; background: var(--blue-light); border: 1px solid #bfdbfe; border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; font-weight: 600; color: var(--blue-dark); }
.plz-tag button { background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.plz-tag button:hover { color: var(--red); }

/* Alert box */
.alert { border-radius: 8px; padding: .75rem 1rem; font-size: .875rem; margin-bottom: 1rem; }
.alert-success { background: var(--green-light); color: #14532d; border: 1px solid #bbf7d0; }
.alert-error { background: var(--red-light); color: #7f1d1d; border: 1px solid #fecaca; }
.alert-warning { background: var(--yellow-light); color: #713f12; border: 1px solid #fde68a; }
.alert-info { background: var(--blue-light); color: #1e3a8a; border: 1px solid #bfdbfe; }

/* Registration details expand */
.reg-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; box-shadow: var(--shadow); }
.reg-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; cursor: pointer; flex-wrap: wrap; }
.reg-header h3 { font-size: 1rem; font-weight: 700; margin-right: auto; }
.reg-body { border-top: 1px solid var(--gray-200); padding: 1.25rem; display: none; }
.reg-body.open { display: block; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.5rem; font-size: .875rem; margin-bottom: 1rem; }
@media (max-width: 500px) { .reg-grid { grid-template-columns: 1fr; } }
.reg-grid dt { font-weight: 600; color: var(--gray-500); }
.reg-grid dd { color: var(--gray-900); }

/* Page title */
.page-title { font-size: 1.6rem; font-weight: 900; margin-bottom: .25rem; }
.page-sub { color: var(--gray-500); font-size: .9rem; margin-bottom: 1.5rem; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state .icon { font-size: 3.5rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: .5rem; }
.empty-state p { color: var(--gray-500); font-size: .9rem; margin-bottom: 1.25rem; }

/* Inline form panel */
.inline-form { background: var(--blue-light); border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.inline-form .card-title { color: var(--blue-dark); margin-bottom: .85rem; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-box { width: 100%; max-width: 440px; }
.auth-logo { text-align: center; margin-bottom: 1.5rem; font-size: 1.6rem; font-weight: 900; }
.auth-logo span { color: var(--blue); }

/* Misc */
.divider { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }
.text-muted { color: var(--gray-500); font-size: .875rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; align-items: center; gap: .75rem; }
.ms-auto { margin-left: auto; }
.bold { font-weight: 700; }
.site-footer { background: #fff; border-top: 1px solid var(--gray-200); padding: 1.25rem 1rem; text-align: center; font-size: .85rem; color: var(--gray-500); margin-top: 3rem; }
