/* Elivora - shared stylesheet */

:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --border: #e4e7ef;
  --text: #1c2333;
  --text-muted: #667085;
  --primary: #2952e3;
  --primary-dark: #1e3fbd;
  --green: #12875a;
  --green-bg: #e5f7ee;
  --amber: #a8660a;
  --amber-bg: #fdf1de;
  --red: #c0293b;
  --red-bg: #fbe7ea;
  --blue: #2952e3;
  --blue-bg: #e8ecfd;
  --gray: #667085;
  --gray-bg: #eef0f4;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; color: var(--text-muted); }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.02em;
}
.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav a { color: var(--text); font-weight: 500; font-size: 14px; text-decoration: none; }
.main-nav a:hover { color: var(--primary); }
.main-nav .nav-admin { color: var(--red); font-weight: 700; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

main { padding: 32px 0 64px; min-height: 60vh; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--card); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; color: var(--text-muted); font-size: 13px; flex-wrap: wrap; gap: 10px; }
.footer-links a { margin-left: 16px; color: var(--text-muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.card-header h2, .card-header h3 { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* Hero */
.hero { padding: 56px 0 40px; text-align: center; }
.hero h1 { font-size: 42px; max-width: 760px; margin: 0 auto 16px; }
.hero p.lead { font-size: 18px; max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Tier badges/cards */
.tier-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tier-wholesaler { background: #e8ecfd; color: #2952e3; }
.tier-reseller { background: #fdf1de; color: #a8660a; }
.tier-proseller { background: #f1e6fb; color: #7a2ec0; }

.tier-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.tier-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 26px; text-align: center; }
.tier-card.featured { border-color: var(--primary); box-shadow: 0 4px 20px rgba(41,82,227,.12); }
.tier-card h3 { margin-bottom: 6px; }
.tier-card .tier-desc { font-size: 13px; margin-bottom: 18px; }

/* Services grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin: 30px 0;
}
.service-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
  display: block;
  text-decoration: none;
  color: var(--text);
}
.service-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16,24,40,.09); text-decoration: none; }
.service-tile .num { font-size: 12px; font-weight: 800; color: var(--primary); letter-spacing: .05em; }
.service-tile h3 { margin: 6px 0 6px; font-size: 16px; }
.service-tile p { font-size: 13px; margin: 0; }
.service-tile .lock { float: right; font-size: 12px; color: var(--amber); font-weight: 700; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group { margin-bottom: 18px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=tel], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(41,82,227,.12); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
legend { font-size: 13px; font-weight: 700; padding: 0 6px; }

/* Auth pages */
.auth-wrap { max-width: 440px; margin: 30px auto; }
.auth-wrap .card { padding: 32px; }
.auth-switch { text-align: center; font-size: 14px; margin-top: 14px; color: var(--text-muted); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #bfe9d4; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f3c3cb; }
.alert-info { background: var(--blue-bg); color: var(--blue); border-color: #c7d3fb; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: #f5ddb1; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 700; background: #fafbfd; }
tr:last-child td { border-bottom: none; }
td.wrap, th.wrap { white-space: normal; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; margin-top: 4px; }

/* Dashboard layout */
.dash-grid { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.dash-nav { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; position: sticky; top: 84px; }
.dash-nav a { display: block; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--text); font-weight: 500; }
.dash-nav a:hover, .dash-nav a.active { background: var(--blue-bg); color: var(--primary); text-decoration: none; }
.dash-nav .group-label { font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 700; padding: 12px 12px 4px; }

@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-nav { position: static; }
  .tier-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .main-nav { gap: 10px; flex-wrap: wrap; }
  .hero h1 { font-size: 30px; }
}

.text-muted { color: var(--text-muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.print-only { display: none; }
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; }
}
