/* ==========================================================================
   MEANOK CONTROL CENTER — Official Design System
   Brand: MEANOK NOVACORE LTD (Navy #04112c, Royal Blue #155eef, Cyan #06b6d4)
   ========================================================================== */
:root {
  --navy-950: #030d24;
  --navy-900: #04112c;
  --navy-800: #091d42;
  --navy-700: #112a5c;
  --blue-600: #155eef;
  --blue-700: #0e49c4;
  --blue-50: #eef5ff;
  --blue-100: #dbeafe;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-700: #15803d;
  --amber-600: #d97706;
  --amber-100: #fef3c7;
  --amber-700: #b45309;
  --red-600: #dc2626;
  --red-100: #fee2e2;
  --red-700: #b91c1c;
  --purple-600: #7c3aed;
  --purple-100: #f3e8ff;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(3, 13, 36, 0.28);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--slate-900);
  background: var(--navy-900);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Shell Layout matching MEANOK mockups */
.cc-shell {
  display: flex;
  min-height: 100vh;
  background: var(--navy-900);
}
.cc-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: #dbeafe;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.cc-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 10px 18px;
  text-decoration: none !important;
}
.cc-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--cyan-400);
  background: #fff;
  flex-shrink: 0;
}
.cc-brand-text strong {
  display: block;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.cc-brand-text span {
  display: block;
  color: #93c5fd;
  font-size: 11.5px;
  font-weight: 500;
}

.cc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.16s ease;
  text-decoration: none !important;
}
.cc-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.cc-nav-link.active {
  background: linear-gradient(90deg, var(--blue-600) 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 94, 239, 0.45);
}
.cc-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }
.cc-submenu {
  list-style: none;
  margin: 4px 0 6px 10px;
  padding: 6px 6px 6px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border-left: 2px solid rgba(56, 189, 248, 0.25);
}
.cc-submenu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  color: #94a3b8;
  border-radius: 7px;
  text-decoration: none !important;
}
.cc-submenu a:hover, .cc-submenu a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.cc-submenu a.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-400);
}

.cc-main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-right: 14px;
  padding-bottom: 14px;
}

/* Top Navy Bar */
.cc-topbar {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px 0 8px;
  color: #fff;
}
.cc-mobile-toggle {
  display: none;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
.cc-global-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.cc-global-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 9px 14px 9px 38px;
  color: #fff;
  font-size: 13px;
  outline: none;
}
.cc-global-search input::placeholder { color: #94a3b8; }
.cc-global-search input:focus {
  border-color: var(--cyan-400);
  background: rgba(255, 255, 255, 0.12);
}
.cc-global-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
}

.cc-topbar-right { display: flex; align-items: center; gap: 14px; }
.cc-icon-btn {
  position: relative;
  color: #e2e8f0;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.15s;
}
.cc-icon-btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; text-decoration: none; }
.cc-notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cc-user-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}
.cc-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy-900);
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cc-user-meta { font-size: 12.5px; font-weight: 600; color: #f8fafc; line-height: 1.2; }
.cc-user-meta small { display: block; font-size: 10.5px; color: #93c5fd; font-weight: 500; }

/* White Rounded Content Canvas */
.cc-canvas {
  flex: 1;
  background: var(--slate-50);
  border-radius: var(--radius-lg);
  padding: 18px 22px 28px;
  box-shadow: var(--shadow-lg);
  overflow-x: hidden;
}

.cc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--slate-500);
  margin-bottom: 12px;
}
.cc-breadcrumb a { color: var(--blue-600); font-weight: 500; }
.cc-breadcrumb .current { color: var(--slate-800); font-weight: 600; }

/* Page Header Hero Banner */
.cc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #eaf2ff 0%, #f5f9ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.cc-page-header-left { display: flex; align-items: center; gap: 14px; }
.cc-page-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #bfdbfe;
  color: var(--blue-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.cc-page-header h1 { margin: 0; font-size: 20px; font-weight: 700; color: var(--navy-900); }
.cc-page-header p { margin: 2px 0 0; font-size: 13px; color: var(--slate-600); }
.cc-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(180deg, #1d63ed 0%, var(--blue-600) 100%);
  color: #fff;
  box-shadow: 0 3px 10px rgba(21, 94, 239, 0.28);
}
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-secondary {
  background: #fff;
  border-color: var(--slate-300);
  color: var(--slate-700);
}
.btn-secondary:hover { background: var(--slate-100); }
.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: var(--red-700); }
.btn-success { background: var(--green-600); color: #fff; }
.btn-success:hover { background: var(--green-700); }
.btn-warning { background: var(--amber-600); color: #fff; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 7px 9px; }

/* KPI Stat Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.kpi-card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 14px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
}
.kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.kpi-icon.blue { background: #eff6ff; color: #1d4ed8; }
.kpi-icon.green { background: #dcfce7; color: #15803d; }
.kpi-icon.red { background: #fee2e2; color: #dc2626; }
.kpi-icon.amber { background: #fef3c7; color: #d97706; }
.kpi-icon.purple { background: #f3e8ff; color: #7c3aed; }
.kpi-icon.slate { background: #f1f5f9; color: #475569; }
.kpi-icon.cyan { background: #ecfeff; color: #0891b2; }
.kpi-label { font-size: 12px; color: var(--slate-500); font-weight: 500; }
.kpi-value { font-size: 22px; font-weight: 800; color: var(--navy-900); line-height: 1.2; }
.kpi-sub { font-size: 11.5px; color: var(--slate-500); font-weight: 500; }

/* Cards & Grids */
.card {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2, .card-header h3 { margin: 0; font-size: 15.5px; font-weight: 700; color: var(--navy-900); }
.card-body { padding: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 18px; }

/* Pill Tabs */
.pill-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--slate-200);
  color: var(--slate-600);
  text-decoration: none !important;
}
.pill-tab:hover { background: var(--slate-100); color: var(--slate-900); }
.pill-tab.active {
  background: var(--blue-600);
  border-color: var(--blue-600);
  color: #fff;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar select,
.form-control {
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--slate-900);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-bar input[type="text"], .filter-bar input[type="search"] { flex: 1; min-width: 220px; }
.form-control { width: 100%; }
.form-control:focus, .filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(21, 94, 239, 0.14);
}
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate-700); margin-bottom: 5px; }
.form-hint { font-size: 11.5px; color: var(--slate-500); margin-top: 4px; }
.req { color: var(--red-600); }

/* Data Tables */
.table-wrap { overflow-x: auto; }
.cc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cc-table th {
  text-align: left;
  padding: 11px 12px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-600);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.cc-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
  color: var(--slate-800);
}
.cc-table tbody tr:hover { background: #f8fbff; }
.code-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--blue-600); font-size: 12.5px; }
.sub-text { display: block; font-size: 11.5px; color: var(--slate-500); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-blue { background: var(--blue-100); color: #1d4ed8; }
.badge-amber { background: var(--amber-100); color: var(--amber-700); }
.badge-red { background: var(--red-100); color: var(--red-700); }
.badge-purple { background: var(--purple-100); color: var(--purple-600); }
.badge-slate { background: var(--slate-200); color: var(--slate-700); }

/* Alerts & Flash Banners */
.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.flash-success { background: #dcfce7; border: 1px solid #86efac; color: #14532d; }
.flash-error { background: #fee2e2; border: 1px solid #fca5a5; color: #7f1d1d; }
.flash-warning { background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; }

/* One-time License Reveal Box */
.secret-reveal-box {
  background: linear-gradient(135deg, #04112c 0%, #0d2557 100%);
  color: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid #22d3ee;
}
.secret-key-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(34,211,238,0.45);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #67e8f9;
  margin: 12px 0;
  word-break: break-all;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--slate-100);
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: var(--slate-600);
}
.pagination-pages { display: flex; gap: 5px; }
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-700);
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none !important;
}
.page-btn.active { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.page-btn:hover:not(.active) { background: var(--slate-100); }

/* Dropdown Menu */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 195px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  padding: 6px;
  z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--slate-700);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  text-decoration: none !important;
}
.dropdown-item:hover { background: var(--slate-100); color: var(--slate-900); }
.dropdown-item.danger { color: var(--red-600); }
.dropdown-item.danger:hover { background: var(--red-100); }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 13, 36, 0.62);
  backdrop-filter: blur(3px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-size: 16px; color: var(--navy-900); }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; background: var(--slate-50); border-top: 1px solid var(--slate-200); display: flex; justify-content: flex-end; gap: 10px; }

/* Charts */
.chart-box { width: 100%; height: 210px; position: relative; }
.donut-wrap { display: flex; align-items: center; justify-content: space-around; gap: 16px; flex-wrap: wrap; }
.donut-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* Auth & Installer Shared Styling (MEANOK Pay Aesthetic) */
.auth-body {
  min-height: 100vh;
  background: radial-gradient(circle at 18% 20%, #0d2b66 0%, #04112c 55%, #020817 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-split {
  width: 100%;
  max-width: 980px;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}
.auth-hero {
  background: linear-gradient(155deg, #061b47 0%, #0a2a6b 55%, #074587 100%);
  color: #fff;
  padding: 42px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.auth-hero-logo {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid var(--cyan-400);
  background: #fff;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(6, 182, 212, 0.35);
}
.auth-hero h2 { font-size: 26px; margin: 22px 0 10px; line-height: 1.25; }
.auth-hero p { color: #bfdbfe; font-size: 14px; line-height: 1.6; }
.auth-feature-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 11px; }
.auth-feature-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #e0f2fe; }
.auth-feature-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan-400); flex-shrink: 0; }
.auth-form-pane { padding: 42px 38px; display: flex; flex-direction: column; justify-content: center; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-split, .grid-3 { grid-template-columns: 1fr; }
  .auth-split { grid-template-columns: 1fr; max-width: 480px; }
  .auth-hero { display: none; }
}
@media (max-width: 860px) {
  .cc-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    z-index: 90;
    transition: left 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .cc-sidebar.open { left: 0; }
  .cc-mobile-toggle { display: inline-flex; }
  .cc-main-wrap { padding: 0 8px 10px; }
  .grid-2 { grid-template-columns: 1fr; }
}
