/* =========================================================
   Datify — Design System
   ========================================================= */
:root {
  --d-bg: #f5f7fb;
  --d-surface: #ffffff;
  --d-surface-2: #f0f2f8;
  --d-border: #e7e9f2;
  --d-text: #14162b;
  --d-text-muted: #6b7089;
  --d-primary: #5b3df0;
  --d-primary-dark: #4527d1;
  --d-primary-light: #efe9ff;
  --d-accent: #14c48b;
  --d-accent-2: #ff9f43;
  --d-danger: #f24957;
  --d-radius: 16px;
  --d-radius-sm: 10px;
  --d-shadow: 0 8px 30px rgba(20, 22, 43, 0.06);
  --d-shadow-lg: 0 20px 45px rgba(20, 22, 43, 0.12);
  --d-nav-h: 72px;
}

[data-theme="dark"] {
  --d-bg: #0d0e1a;
  --d-surface: #14162a;
  --d-surface-2: #1b1e35;
  --d-border: #262a47;
  --d-text: #f3f4fb;
  --d-text-muted: #9698b8;
  --d-primary: #7c5cff;
  --d-primary-dark: #6a48f5;
  --d-primary-light: #221f4a;
  --d-accent: #1fe0a0;
  --d-accent-2: #ffb35c;
  --d-danger: #ff5c69;
  --d-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --d-shadow-lg: 0 20px 55px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

body {
  background: var(--d-bg);
  color: var(--d-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }

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

.text-muted-d { color: var(--d-text-muted) !important; }

/* ---------- Layout shells ---------- */
.section { padding: 5rem 0; }
@media (max-width: 768px) { .section { padding: 3rem 0; } }

.container-narrow { max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Navbar ---------- */
.navbar-datify {
  background: color-mix(in srgb, var(--d-surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--d-border);
  height: var(--d-nav-h);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.navbar-brand-datify {
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--d-text) !important;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.navbar-brand-datify .logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, var(--d-primary), var(--d-accent));
  display: inline-block;
}
.navbar-datify .nav-link {
  color: var(--d-text-muted);
  font-weight: 600;
  padding: .5rem 1rem !important;
}
.navbar-datify .nav-link.active,
.navbar-datify .nav-link:hover { color: var(--d-text); }

.theme-toggle-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--d-border);
  background: var(--d-surface-2);
  color: var(--d-text);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn-datify-primary {
  background: linear-gradient(135deg, var(--d-primary), var(--d-primary-dark));
  color: #fff; border: none; font-weight: 600;
  border-radius: var(--d-radius-sm);
  padding: .7rem 1.5rem;
  box-shadow: 0 10px 25px rgba(91, 61, 240, .28);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-datify-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(91, 61, 240, .35); }
.btn-datify-outline {
  background: transparent; border: 1.5px solid var(--d-border); color: var(--d-text);
  font-weight: 600; border-radius: var(--d-radius-sm); padding: .7rem 1.5rem;
}
.btn-datify-outline:hover { border-color: var(--d-primary); color: var(--d-primary); }

/* ---------- Cards ---------- */
.card-datify {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  box-shadow: var(--d-shadow);
}
.card-datify-flat { background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-radius); }

.stat-card {
  background: var(--d-surface);
  border: 1px solid var(--d-border);
  border-radius: var(--d-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: .75rem;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 800; }
.stat-card .stat-label { color: var(--d-text-muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Hero ---------- */
.hero-datify {
  background:
    radial-gradient(1000px 500px at 85% -10%, color-mix(in srgb, var(--d-primary) 22%, transparent), transparent),
    var(--d-bg);
  padding: 5rem 0 4rem;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--d-primary-light); color: var(--d-primary);
  font-weight: 700; font-size: .8rem;
  padding: .4rem .9rem; border-radius: 999px;
}
.hero-title { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.08; }
.hero-phone-mock {
  background: var(--d-surface); border: 1px solid var(--d-border);
  border-radius: 28px; box-shadow: var(--d-shadow-lg); padding: 1.25rem;
}

/* ---------- Network chips ---------- */
.network-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1.5px solid var(--d-border);
  border-radius: var(--d-radius-sm);
  padding: .9rem 1rem;
  cursor: pointer;
  background: var(--d-surface);
  font-weight: 700;
  width: 100%;
  transition: all .15s ease;
}
.network-chip input { display: none; }
.network-chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.network-chip.mtn .dot { background: #ffcc08; }
.network-chip.telecel .dot { background: #e2001a; }
.network-chip.airteltigo .dot { background: #0071ce; }
.network-chip:has(input:checked) {
  border-color: var(--d-primary);
  background: var(--d-primary-light);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--d-primary) 20%, transparent);
}

.bundle-option {
  border: 1.5px solid var(--d-border);
  border-radius: var(--d-radius-sm);
  padding: .9rem 1rem;
  cursor: pointer;
  background: var(--d-surface);
  transition: all .15s ease;
}
.bundle-option:has(input:checked) {
  border-color: var(--d-primary);
  background: var(--d-primary-light);
}
.bundle-option input { display: none; }

/* ---------- Pricing table ---------- */
.pricing-card { border-radius: var(--d-radius); border: 1px solid var(--d-border); background: var(--d-surface); padding: 2rem; }
.pricing-card.featured { border-color: var(--d-primary); box-shadow: var(--d-shadow-lg); position: relative; }
.pricing-card.featured::before {
  content: "Best Value"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--d-primary); color: #fff; font-size: .7rem; font-weight: 700;
  padding: .3rem .8rem; border-radius: 999px;
}

/* ---------- Tables ---------- */
.table-datify { --bs-table-bg: transparent; color: var(--d-text); }
.table-datify thead th {
  border-bottom: 1px solid var(--d-border);
  color: var(--d-text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700;
}
.table-datify td, .table-datify th { border-color: var(--d-border); vertical-align: middle; }

/* ---------- Sidebar (dashboard/admin) ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: 260px; background: var(--d-surface); border-right: 1px solid var(--d-border);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040;
  transition: transform .25s ease; overflow-y: auto;
}
.app-main { flex: 1; margin-left: 260px; min-height: 100vh; background: var(--d-bg); }
.app-topbar {
  height: var(--d-nav-h); border-bottom: 1px solid var(--d-border);
  background: color-mix(in srgb, var(--d-surface) 92%, transparent); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 1020;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.1rem; margin: .15rem .75rem; border-radius: var(--d-radius-sm);
  color: var(--d-text-muted); font-weight: 600; font-size: .92rem;
}
.sidebar-link:hover { background: var(--d-surface-2); color: var(--d-text); }
.sidebar-link.active { background: var(--d-primary-light); color: var(--d-primary); }
.sidebar-link i { width: 20px; text-align: center; }

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
}

/* ---------- Notification / list items ---------- */
.notif-item { padding: .9rem 1rem; border-bottom: 1px solid var(--d-border); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--d-primary); }

/* ---------- Misc ---------- */
.divider-soft { border-top: 1px solid var(--d-border); }
.badge-network-mtn { background: #ffcc08; color: #14162b; }
.badge-network-telecel { background: #e2001a; color: #fff; }
.badge-network-airteltigo { background: #0071ce; color: #fff; }

.form-control-datify, .form-select-datify {
  background: var(--d-surface); border: 1.5px solid var(--d-border); color: var(--d-text);
  border-radius: var(--d-radius-sm); padding: .7rem .9rem;
}
.form-control-datify:focus, .form-select-datify:focus {
  border-color: var(--d-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--d-primary) 18%, transparent);
  background: var(--d-surface); color: var(--d-text);
}

.skeleton { background: linear-gradient(90deg, var(--d-surface-2) 25%, var(--d-border) 37%, var(--d-surface-2) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: 8px; }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.fade-in-up { animation: fadeInUp .5s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.footer-datify { background: var(--d-surface); border-top: 1px solid var(--d-border); padding: 3rem 0 1.5rem; }

/* Toast container */
#toastHost { position: fixed; top: 90px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: .6rem; }
