/* ============================================================
   AlwaysGreen Proxy — Main Stylesheet (Mobile First)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1a4731;   /* dark green — main brand color */
  --blue:   #2e7d32;   /* medium green — buttons & accents */
  --light:  #e8f5e9;   /* light green — backgrounds & hovers */
  --green:  #43a047;   /* success green */
  --red:    #e74c3c;
  --yellow: #f39c12;
  --gray:   #6c757d;
  --border: #c8e6c9;   /* green-tinted border */
  --bg:     #f1f8f2;   /* very light green page bg */
  --white:  #ffffff;
  --text:   #1b2e1c;   /* dark green text */
}

body { font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ── NAVBAR ── */
.navbar {
  background: var(--white);
  border-bottom: 2px solid var(--border);
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
}
.navbar-brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; gap: 8px; }
.navbar-brand img {
  height: 40px;
  max-height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}
.brand-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); border-radius: 2px; transition: all .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desktop nav */
.navbar-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.navbar-nav a {
  color: var(--text);
  padding: 7px 13px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.navbar-nav a:hover { background: var(--light); color: var(--navy); text-decoration: none; }
.navbar-nav a.active { background: var(--light); color: var(--navy); font-weight: 700; }
.navbar-nav .btn-nav { background: var(--navy); color: #fff !important; }
.navbar-nav .btn-nav:hover { background: var(--blue); }

/* Mobile nav drawer */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .navbar-nav {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    z-index: 199;
    gap: 4px;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { padding: 12px 16px; border-radius: 8px; font-size: 0.95rem; }
  .navbar-nav .btn-nav { text-align: center; }
}

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.page-wrap  { padding: 20px 16px; max-width: 1100px; margin: 0 auto; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-header {
  background: var(--navy); color: #fff;
  padding: 11px 18px; border-radius: 8px 8px 0 0;
  font-weight: 600; font-size: 0.88rem;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 18px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .stats-grid { grid-template-columns: repeat(5, 1fr); } }
.stat-box { background: var(--white); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat-box .lbl { font-size: 0.7rem; color: var(--gray); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.stat-box .val { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.stat-box.green .val { color: var(--green); }
.stat-box.blue .val  { color: var(--blue); }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 7px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: background .15s; text-align: center; }
.btn-primary  { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #122c48; color: #fff; text-decoration: none; }
.btn-blue     { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #1558a0; color: #fff; text-decoration: none; }
.btn-green    { background: var(--green); color: #fff; }
.btn-green:hover { background: #1e8449; color: #fff; text-decoration: none; }
.btn-red      { background: var(--red); color: #fff; }
.btn-red:hover { background: #c0392b; color: #fff; text-decoration: none; }
.btn-outline  { background: transparent; border: 1px solid var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; text-decoration: none; }
.btn-sm       { padding: 5px 11px; font-size: 0.78rem; }
.btn-full     { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--gray); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.9rem; color: var(--text); background: #fff; outline: none; transition: border-color .15s; }
.form-control:focus { border-color: var(--blue); }
select.form-control { cursor: pointer; }

/* ── TABLES — always scrollable ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.table-wrap table { min-width: 640px; } /* force scroll on small screens */
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
thead th { background: var(--navy); color: #fff; padding: 10px 12px; text-align: left; font-size: 0.73rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
tbody tr:hover td { background: var(--light); }

/* ── BADGES ── */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.badge-green  { background: #d5f5e3; color: #1e8449; }
.badge-red    { background: #fadbd8; color: #c0392b; }
.badge-yellow { background: #fef9e7; color: #b7950b; border: 1px solid #f9e79f; }
.badge-gray   { background: #f2f3f4; color: var(--gray); border: 1px solid var(--border); }
.badge-blue   { background: var(--light); color: var(--blue); }

/* ── ALERTS ── */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 0.87rem; }
.alert-success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfba; }
.alert-error   { background: #fadbd8; color: #c0392b; border: 1px solid #f5b7b1; }
.alert-info    { background: #d6eaf8; color: #1a5276; border: 1px solid #a9cce3; }
.alert-warning { background: #fef9e7; color: #9a7d0a; border: 1px solid #f9e79f; }

/* ── PROGRESS ── */
.progress-wrap { background: #e0e0e0; border-radius: 999px; height: 10px; overflow: hidden; }
.progress-bar  { background: var(--blue); height: 100%; border-radius: 999px; transition: width .4s; }
.progress-bar.danger { background: var(--red); }

/* ── FILTER BAR ── */
.filter-bar { background: var(--white); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; overflow: hidden; }
.filter-bar .filter-title { background: var(--navy); color: #fff; padding: 10px 18px; font-weight: 600; font-size: 0.85rem; }
.filter-bar .filter-inner { padding: 14px 18px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; }
.filter-field label { font-size: 0.7rem; color: var(--gray); font-weight: 600; text-transform: uppercase; }

/* ── USAGE BAR ── */
.usage-row {
  display: flex; flex-wrap: wrap;
  align-items: center; gap: 12px;
  background: var(--navy); color: #fff;
  padding: 10px 18px; border-radius: 8px; margin-bottom: 14px;
}
.usage-label { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.usage-label span { color: #5dade2; }
.usage-bar-wrap { flex: 1; min-width: 100px; }
.usage-count { font-size: 0.8rem; color: rgba(255,255,255,.7); white-space: nowrap; margin-left: auto; }

/* ── PRICING ── */
.pricing-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 24px 0; }
@media (min-width: 480px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 800px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }
.pricing-card { background: var(--white); border: 2px solid var(--border); border-radius: 12px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.pricing-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.pricing-card.popular { border-color: var(--blue); }
.pricing-header { background: var(--navy); color: #fff; padding: 18px; text-align: center; }
.pricing-header.popular { background: var(--blue); }
.pricing-header h3 { font-size: 1.05rem; margin-bottom: 4px; }
.pricing-header p  { font-size: 0.8rem; opacity: .8; }
.pricing-body { padding: 18px; }
.pricing-price { font-size: 1.8rem; font-weight: 700; color: var(--navy); text-align: center; margin: 10px 0; }
.pricing-price span { font-size: 0.82rem; color: var(--gray); font-weight: 400; }
.pricing-features { list-style: none; margin-bottom: 16px; }
.pricing-features li { padding: 5px 0; border-bottom: 1px solid #f0f0f0; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.pricing-features li::before { content: '✓'; color: var(--green); font-weight: 700; }

/* ── DASHBOARD SIDEBAR LAYOUT ── */
.dashboard-wrap { display: flex; gap: 16px; }
.sidebar { width: 200px; flex-shrink: 0; }
.sidebar-nav { background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sidebar-nav a { display: block; padding: 11px 14px; color: var(--text); border-bottom: 1px solid #f0f0f0; font-size: 0.87rem; transition: background .15s; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: var(--light); color: var(--navy); font-weight: 600; text-decoration: none; }
.sidebar-nav a:last-child { border-bottom: none; }
.dashboard-content { flex: 1; min-width: 0; }

/* Mobile: sidebar becomes top tab row */
@media (max-width: 720px) {
  .dashboard-wrap { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar-nav { display: flex; overflow-x: auto; border-radius: 8px; }
  .sidebar-nav a { border-bottom: none; border-right: 1px solid #f0f0f0; white-space: nowrap; padding: 10px 14px; flex-shrink: 0; font-size: 0.82rem; }
  .sidebar-nav a:last-child { border-right: none; }
}

/* ── HERO ── */
.hero { background: linear-gradient(135deg, #0d2b1a, var(--navy), #1b5e20); color: #fff; padding: 50px 20px; text-align: center; }
.hero h1 { font-size: 1.8rem; margin-bottom: 12px; line-height: 1.2; }
.hero p  { font-size: 0.95rem; opacity: .85; max-width: 500px; margin: 0 auto 22px; }
@media (min-width: 640px) {
  .hero { padding: 80px 20px; }
  .hero h1 { font-size: 2.4rem; }
  .hero p  { font-size: 1.05rem; }
}

/* ── FEATURES GRID ── */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── FOOTER ── */
footer { background: var(--navy); color: rgba(255,255,255,.6); text-align: center; padding: 18px 16px; margin-top: 32px; font-size: 0.82rem; }

/* ── MISC ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .justify-between { justify-content: space-between; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 40px; color: var(--gray); }
.ip-code { font-family: monospace; color: var(--blue); font-weight: 600; }
