/* ================================================================
   isipoint.css — Design System v3
   Premium admin UI — ISIPoint Membership App
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --sb-w:           256px;
  --sb-w-collapsed:  68px;
  --tb-h:            60px;

  --bg:        #f0f4f8;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #e2e8f0;
  --border-2:  #cbd5e1;
  --text:      #0f172a;
  --text-2:    #334155;
  --muted:     #64748b;
  --muted-2:   #94a3b8;

  --primary:    #6366f1;
  --primary-d:  #4f46e5;
  --primary-l:  #818cf8;
  --primary-r:  99, 102, 241;
  --primary-bg: rgba(99,102,241,.08);

  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #06b6d4;

  --sidebar-bg:      #0c1322;
  --sidebar-bg-2:    #111827;
  --sidebar-border:  rgba(255,255,255,.05);
  --sidebar-hover:   rgba(255,255,255,.07);
  --sidebar-active:  rgba(99,102,241,.18);
  --sidebar-text:    #8b9cb5;
  --sidebar-text-h:  #e2e8f0;

  --sh-xs: 0 1px 2px rgba(0,0,0,.04);
  --sh-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --sh-md: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --sh-lg: 0 12px 32px rgba(0,0,0,.1), 0 4px 8px rgba(0,0,0,.05);
  --sh-xl: 0 24px 48px rgba(0,0,0,.12), 0 8px 16px rgba(0,0,0,.06);

  --r-xs: 6px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --ease: cubic-bezier(.4,0,.2,1);
  --bounce: cubic-bezier(.34,1.56,.64,1);
}

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  margin: 0 !important;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* ── Loading screen ──────────────────────────────────────────── */
#ip-loader {
  position: fixed; inset: 0;
  background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: opacity .4s var(--ease), visibility .4s;
}
#ip-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.ip-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(99,102,241,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ip-spin .7s linear infinite;
}
@keyframes ip-spin { to { transform: rotate(360deg); } }

/* ── Sidebar ─────────────────────────────────────────────────── */
#ip-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 200;
  overflow: visible;
  transition: transform .28s var(--ease), width .28s var(--ease);
  box-shadow: 2px 0 24px rgba(0,0,0,.12);
}

/* Brand header */
.sb-brand {
  height: var(--tb-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  text-decoration: none !important;
  position: relative;
}
.sb-brand-icon {
  width: 34px; height: 34px;
  background: #fff;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.sb-brand-icon img { width: 100%; height: 100%; object-fit: cover; }
.sb-brand-text {
  font-size: 15px; font-weight: 800; color: #fff;
  white-space: nowrap; letter-spacing: -.2px;
  transition: opacity .22s, width .22s;
}
.sb-brand-version {
  font-size: 10px; font-weight: 600;
  color: var(--primary-l); opacity: .7;
  margin-left: auto; white-space: nowrap;
  transition: opacity .22s;
}

/* Collapse toggle button */
.sb-collapse-btn {
  position: absolute;
  right: -13px; top: 50%;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--sidebar-bg-2);
  border: 1.5px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 210;
  transition: all .18s var(--ease);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.sb-collapse-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(var(--primary-r),.5);
  transform: translateY(-50%) scale(1.1);
}
.sb-collapse-btn svg { width: 13px; height: 13px; }
.sb-chevron-left  { display: block; }
.sb-chevron-right { display: none; }
body.sb-collapsed .sb-chevron-left  { display: none; }
body.sb-collapsed .sb-chevron-right { display: block; }

/* Nav */
.sb-nav {
  flex: 1;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 0 8px;
}
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }

.sb-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: rgba(255,255,255,.2);
  padding: 18px 20px 6px;
  white-space: nowrap;
  transition: opacity .22s;
}

.sb-item { margin: 1px 10px; }
.sb-item a {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  text-decoration: none !important;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
  position: relative;
}
.sb-item a:hover  {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-h);
}
.sb-item a.active {
  background: var(--sidebar-active) !important;
  color: #fff !important;
  font-weight: 600;
}
.sb-item a.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--primary-l);
  margin-left: -10px;
}
.sb-item a i {
  font-size: 15px; width: 19px; text-align: center;
  flex-shrink: 0; opacity: .65; transition: opacity .15s;
}
.sb-item a:hover i, .sb-item a.active i { opacity: 1; }
.sb-text { transition: opacity .22s, width .22s; }

/* Groups */
.sb-group-toggle {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px; margin: 1px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background .15s, color .15s;
}
.sb-group-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-text-h); }
.sb-group-toggle.open  { color: var(--sidebar-text-h); }
.sb-group-toggle i { font-size: 15px; width: 19px; text-align: center; flex-shrink: 0; opacity: .65; transition: opacity .15s; }
.sb-group-toggle:hover i, .sb-group-toggle.open i { opacity: 1; }
.sb-chevron {
  font-size: 8px; opacity: .35; margin-left: auto;
  transition: transform .22s var(--ease), opacity .15s;
}
.sb-group-toggle.open .sb-chevron { transform: rotate(90deg); opacity: .6; }

.sb-sub {
  overflow: hidden; max-height: 0;
  transition: max-height .3s var(--ease);
}
.sb-sub.open { max-height: 800px; }
.sb-sub .sb-item a {
  padding-left: 40px; font-size: 12.5px;
  color: rgba(139,156,181,.8);
}
.sb-sub .sb-item a:hover, .sb-sub .sb-item a.active { color: #fff; }

/* Footer */
.sb-footer {
  padding: 8px 10px 12px;
  border-top: 1px solid var(--sidebar-border);
}
.sb-footer a {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 10px;
  border-radius: var(--r-sm);
  color: var(--muted);
  text-decoration: none !important;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sb-footer a:hover { background: rgba(239,68,68,.1); color: #fca5a5; }
.sb-footer a i { font-size: 15px; width: 19px; text-align: center; flex-shrink: 0; }

/* ── Collapsed sidebar ───────────────────────────────────────── */
body.sb-collapsed #ip-sidebar  { width: var(--sb-w-collapsed); }
body.sb-collapsed #ip-main     { margin-left: var(--sb-w-collapsed); }
body.sb-collapsed .sb-brand    { padding: 0 17px; }
body.sb-collapsed .sb-brand-text,
body.sb-collapsed .sb-brand-version,
body.sb-collapsed .sb-label,
body.sb-collapsed .sb-text,
body.sb-collapsed .sb-group-toggle > span,
body.sb-collapsed .sb-chevron,
body.sb-collapsed .sb-footer .sb-text { opacity: 0; width: 0; overflow: hidden; pointer-events: none; }
body.sb-collapsed .sb-item a,
body.sb-collapsed .sb-group-toggle,
body.sb-collapsed .sb-footer a { justify-content: center; padding-left: 10px; padding-right: 10px; }
body.sb-collapsed .sb-item a.active::before { display: none; }
body.sb-collapsed .sb-sub { max-height: 0 !important; }

/* Tooltip on collapsed */
body.sb-collapsed .sb-item a[title]::after {
  content: attr(title);
  position: absolute; left: calc(var(--sb-w-collapsed) + 6px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #1e293b; color: #e2e8f0;
  font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: var(--r-sm);
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s, transform .15s;
  z-index: 500;
  box-shadow: var(--sh-md);
}
body.sb-collapsed .sb-item a[title]:hover::after {
  opacity: 1; transform: translateY(-50%) translateX(0);
}

/* ── Topbar ──────────────────────────────────────────────────── */
#ip-main { margin-left: var(--sb-w); transition: margin-left .28s var(--ease); }

#ip-topbar {
  height: var(--tb-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 14px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--sh-xs);
}

#sb-toggle {
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
#sb-toggle:hover { background: var(--bg); color: var(--text); }
#sb-toggle svg { width: 17px; height: 17px; }

.topbar-title {
  flex: 1; font-size: 14px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Breadcrumb in topbar */
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.topbar-breadcrumb .sep { color: var(--border-2); }
.topbar-breadcrumb .current { color: var(--text); font-weight: 600; }

.topbar-user-wrap { position: relative; }
.topbar-user-btn {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 1px solid transparent;
  border-radius: 99px; padding: 4px 8px 4px 4px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.topbar-user-btn:hover { background: var(--bg); border-color: var(--border); }
.topbar-user-btn img {
  width: 30px; height: 30px; border-radius: 50%;
  object-fit: cover; background: var(--primary-bg);
  border: 2px solid var(--border);
}
.topbar-user-name {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-user-caret {
  color: var(--muted); font-size: 9px; margin-left: 2px;
}

.topbar-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-xl);
  min-width: 210px; overflow: hidden; z-index: 300;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(.96);
  transform-origin: top right;
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}
.topbar-dropdown.open { opacity: 1; pointer-events: auto; transform: none; }
.tb-dd-user {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tb-dd-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary-bg);
  border: 2px solid var(--primary-l);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--primary);
  margin-bottom: 10px;
}
.tb-dd-name { font-weight: 700; font-size: 14px; }
.tb-dd-role {
  font-size: 11px; font-weight: 600;
  color: var(--primary); text-transform: capitalize;
  background: var(--primary-bg); padding: 2px 8px;
  border-radius: 20px; display: inline-block; margin-top: 4px;
}
.topbar-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  text-decoration: none !important; cursor: pointer;
  color: var(--text-2);
  transition: background .12s;
}
.topbar-dropdown-item:hover { background: var(--bg); }
.topbar-dropdown-item.danger { color: var(--danger); }
.topbar-dropdown-item.danger:hover { background: rgba(239,68,68,.06); }
.topbar-dropdown-item i { font-size: 14px; width: 16px; text-align: center; color: var(--muted); }
.topbar-dropdown-item.danger i { color: var(--danger); }

/* ── Page content ────────────────────────────────────────────── */
#ip-page { padding: 24px; overflow-x: hidden; min-height: calc(100vh - var(--tb-h)); }

.ip-ph {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 18px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.ip-ph h1 {
  flex: 1; margin: 0 !important;
  font-size: 19px !important; font-weight: 800 !important;
  letter-spacing: -.35px !important; color: var(--text) !important;
}
.ip-ph-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--sh-xs) !important;
  background: var(--surface) !important;
  transition: box-shadow .2s !important;
}
.card:hover { box-shadow: var(--sh-sm) !important; }
.card-body { padding: 22px !important; }
.card-header {
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 14px 22px !important;
  font-size: 13.5px !important; font-weight: 700 !important;
  border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
  color: var(--text-2) !important;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  border-radius: var(--r) !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 9px 18px !important;
  transition: all .15s !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  line-height: 1.4 !important;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(var(--primary-r),.28) !important;
}
.btn-primary:hover {
  background: var(--primary-d) !important;
  box-shadow: 0 6px 20px rgba(var(--primary-r),.35) !important;
  color: #fff !important;
}
.btn-outline-primary {
  background: transparent !important;
  border: 1.5px solid var(--primary) !important;
  color: var(--primary) !important;
}
.btn-outline-primary:hover {
  background: var(--primary-bg) !important;
  color: var(--primary-d) !important;
}
.btn-outline-secondary {
  background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  color: var(--text-2) !important;
}
.btn-outline-secondary:hover {
  background: var(--surface-2) !important;
  border-color: var(--border-2) !important;
  color: var(--text) !important;
}
.btn-danger {
  background: var(--danger) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(239,68,68,.25) !important;
}
.btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
  border-radius: var(--r-sm) !important;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-control {
  border-radius: var(--r-sm) !important;
  border: 1.5px solid var(--border) !important;
  padding: 9px 13px !important;
  font-size: 13.5px !important;
  color: var(--text) !important;
  background: var(--surface) !important;
  transition: all .15s !important;
  line-height: 1.5 !important;
}
.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-r),.1) !important;
  background: #fff !important;
  outline: none !important;
}
.form-control::placeholder { color: var(--muted-2) !important; }
select.form-control { appearance: none !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-position: right 12px center !important; padding-right: 36px !important; }
.form-group { margin-bottom: 16px !important; }
.form-group label {
  font-size: 12px !important; font-weight: 600 !important;
  color: var(--muted) !important; letter-spacing: .02em !important;
  margin-bottom: 6px !important; display: block !important;
}
.input-group-text {
  border: 1.5px solid var(--border) !important;
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border-radius: var(--r-sm) !important;
}

/* ── DataTables ──────────────────────────────────────────────── */
.data-table { width: 100% !important; }
.dataTables_wrapper { font-size: 13.5px !important; }
.dataTables_wrapper .row:first-child {
  padding: 0 4px; margin-bottom: 16px !important;
  display: flex; align-items: center; gap: 8px;
}
.dataTables_length label,
.dataTables_filter label {
  font-size: 13px !important; color: var(--muted) !important;
  display: flex; align-items: center; gap: 8px;
}
.dataTables_length select {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--r-sm) !important;
  padding: 6px 28px 6px 10px !important;
  font-size: 13px !important;
  appearance: none !important;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center !important;
}
.dataTables_filter { margin-left: auto !important; }
.dataTables_filter input {
  border: 1.5px solid var(--border) !important;
  border-radius: var(--r-sm) !important;
  padding: 7px 12px 7px 36px !important;
  font-size: 13px !important;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center !important;
  transition: all .15s;
  min-width: 220px;
}
.dataTables_filter input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(var(--primary-r),.1) !important;
  outline: none;
}

table.dataTable {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
table.dataTable thead th {
  font-size: 11px !important; font-weight: 700 !important;
  text-transform: uppercase !important; letter-spacing: .07em !important;
  color: var(--muted) !important;
  background: var(--surface-2) !important;
  border-bottom: 2px solid var(--border) !important;
  padding: 12px 14px !important;
  white-space: nowrap;
}
table.dataTable thead th:first-child { border-radius: var(--r-sm) 0 0 0 !important; }
table.dataTable thead th:last-child  { border-radius: 0 var(--r-sm) 0 0 !important; }

table.dataTable tbody tr { transition: background .1s; }
table.dataTable tbody tr:hover { background: rgba(99,102,241,.03) !important; }
table.dataTable tbody td {
  vertical-align: middle !important;
  border-top: 1px solid var(--border) !important;
  padding: 12px 14px !important;
  color: var(--text-2) !important;
}
table.dataTable tbody tr:last-child td:first-child { border-radius: 0 0 0 var(--r-sm) !important; }
table.dataTable tbody tr:last-child td:last-child  { border-radius: 0 0 var(--r-sm) 0 !important; }

.dataTables_info { font-size: 12px !important; color: var(--muted) !important; }
.dataTables_paginate { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px !important; }
.paginate_button {
  border-radius: var(--r-sm) !important; border: none !important;
  padding: 6px 12px !important; font-size: 12.5px !important;
  font-weight: 500 !important; transition: all .12s !important;
  cursor: pointer !important; background: transparent !important;
  color: var(--muted) !important;
}
.paginate_button:hover:not(.disabled):not(.current) {
  background: var(--bg) !important; color: var(--text) !important;
}
.paginate_button.current {
  background: var(--primary) !important; color: #fff !important;
  box-shadow: 0 2px 8px rgba(var(--primary-r),.3) !important;
}
.paginate_button.disabled { opacity: .4 !important; cursor: default !important; }

/* ── Modals ──────────────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--sh-xl) !important;
  overflow: hidden;
}
.modal-header {
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 18px 24px !important;
}
.modal-title { font-size: 16px !important; font-weight: 700 !important; }
.modal-body { padding: 22px 24px !important; }
.modal-footer {
  border-top: 1px solid var(--border) !important;
  padding: 14px 24px !important;
  background: var(--surface-2) !important;
  gap: 8px !important;
}
.modal-right .modal-dialog { margin: 0 0 0 auto !important; max-width: 440px; }
.modal-right .modal-content { border-radius: var(--r-xl) 0 0 var(--r-xl) !important; min-height: 100vh; }
.modal-backdrop { background: rgba(15,23,42,.5) !important; }
.close {
  background: none !important; border: none !important;
  color: var(--muted) !important; font-size: 20px !important;
  padding: 0 !important; line-height: 1 !important;
  transition: color .15s !important;
}
.close:hover { color: var(--text) !important; }

/* ── Alerts / Badges ─────────────────────────────────────────── */
.badge {
  border-radius: 20px !important; font-size: 11px !important;
  font-weight: 600 !important; padding: 3px 9px !important;
}
.badge-primary { background: var(--primary-bg) !important; color: var(--primary) !important; }
.badge-success { background: rgba(16,185,129,.1) !important; color: #059669 !important; }
.badge-warning { background: rgba(245,158,11,.1) !important; color: #d97706 !important; }
.badge-danger  { background: rgba(239,68,68,.1) !important; color: #dc2626 !important; }

.alert {
  border-radius: var(--r) !important; border: none !important;
  font-size: 13.5px !important; padding: 12px 16px !important;
}
.alert-success { background: rgba(16,185,129,.1) !important; color: #047857 !important; }
.alert-danger  { background: rgba(239,68,68,.1)  !important; color: #b91c1c !important; }
.alert-warning { background: rgba(245,158,11,.1) !important; color: #92400e !important; }
.alert-info    { background: rgba(6,182,212,.1)  !important; color: #0e7490 !important; }

/* ── Settings page ───────────────────────────────────────────── */
.nav-tabs {
  border-bottom: none !important; gap: 6px !important;
  flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 2px;
}
.nav-tabs .nav-link {
  border-radius: var(--r) !important; border: none !important;
  padding: 8px 16px !important; font-weight: 600 !important;
  color: var(--muted) !important; background: var(--surface) !important;
  border: 1.5px solid var(--border) !important;
  transition: all .15s !important; white-space: nowrap; font-size: 13px !important;
}
.nav-tabs .nav-link:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.nav-tabs .nav-link.active {
  background: var(--primary) !important; color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(var(--primary-r),.25) !important;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-top: 20px;
}
.settings-section-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.settings-section-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.settings-section-title { font-size: 14px; font-weight: 700; }
.settings-section-sub   { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.settings-section-body  { padding: 22px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.settings-grid .span2 { grid-column: span 2; }
.settings-img-preview {
  max-width: 100%; max-height: 130px; object-fit: contain;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  margin-bottom: 10px; background-color: var(--bg);
}
.settings-save-bar {
  position: sticky; bottom: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  padding: 14px 22px;
  margin: 22px -22px -22px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end;
}

/* ── Dashboard Hero ──────────────────────────────────────────── */
.dha-wrap {
  position: relative; border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: 26px;
  height: 164px;
  box-shadow: var(--sh-lg);
}
.dha-sky {
  position: absolute; inset: 0;
  background: linear-gradient(160deg,#2563eb,#38bdf8,#bae6fd);
  transition: background 2s ease;
}
.dha-celestial { position: absolute; top: 18px; right: 36px; z-index: 2; }

.dha-sun {
  width: 60px; height: 60px;
  animation: dhaSunFloat 6s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(252,211,77,.7));
}
@keyframes dhaSunFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.dha-moon {
  width: 48px; height: 48px;
  animation: dhaMoonFloat 7s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(226,232,240,.5));
}
@keyframes dhaMoonFloat {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-5px) rotate(5deg); }
}

.dha-clouds { position: absolute; inset: 0; pointer-events: none; z-index: 1; transition: opacity .8s; }
.dha-cloud { position: absolute; background: rgba(255,255,255,.82); border-radius: 999px; }
.dha-cloud::before, .dha-cloud::after { content: ''; position: absolute; background: inherit; border-radius: 999px; }
.dha-c1 { width: 76px; height: 20px; top: 28%; left: 8%; animation: dhaCloud1 18s linear infinite; }
.dha-c1::before { width: 42px; height: 26px; top: -12px; left: 10px; }
.dha-c1::after  { width: 30px; height: 18px; top: -6px;  left: 32px; }
.dha-c2 { width: 56px; height: 16px; top: 58%; left: 30%; animation: dhaCloud2 24s linear infinite; opacity: .7; }
.dha-c2::before { width: 30px; height: 20px; top: -9px; left: 8px; }
.dha-c3 { width: 48px; height: 14px; top: 22%; left: 60%; animation: dhaCloud3 20s linear infinite; opacity: .55; }
.dha-c3::before { width: 26px; height: 17px; top: -8px; left: 8px; }
@keyframes dhaCloud1 { 0% { transform: translateX(-80px); } 100% { transform: translateX(110vw); } }
@keyframes dhaCloud2 { 0% { transform: translateX(-60px); } 100% { transform: translateX(110vw); } }
@keyframes dhaCloud3 { 0% { transform: translateX(0);     } 100% { transform: translateX(110vw); } }

.dha-stars { position: absolute; inset: 0; pointer-events: none; }
.dha-star { position: absolute; background: #fff; border-radius: 50%; animation: dhaTwinkle 2s ease-in-out infinite alternate; }
@keyframes dhaTwinkle { 0% { opacity: .15; } 100% { opacity: .9; } }

.dha-content {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 32px;
}
.dha-greeting {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .13em; color: rgba(255,255,255,.7); margin-bottom: 5px;
}
.dha-name {
  font-size: 24px; font-weight: 800; color: #fff;
  letter-spacing: -.4px; text-shadow: 0 2px 14px rgba(0,0,0,.18);
}
.dha-sub { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 7px; }
.dha-time {
  font-size: 30px; font-weight: 800; color: #fff;
  letter-spacing: -.5px; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0,0,0,.18); text-align: right;
}
.dha-date { font-size: 12.5px; color: rgba(255,255,255,.7); margin-top: 4px; text-align: right; }

/* ── Dashboard stat cards ────────────────────────────────────── */
.dash-main { padding: 24px; }
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: all .22s var(--ease);
  cursor: default;
}
.dash-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: transparent; }
.dc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dc-icon {
  width: 42px; height: 42px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.dc-badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 9px 3px 7px;
  border-radius: 20px; display: flex; align-items: center; gap: 3px;
}
.dc-badge svg { width: 8px; height: 8px; }
.dc-badge.up { background: rgba(16,185,129,.1); color: #059669; }
.dc-value { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 5px; letter-spacing: -.5px; }
.dc-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.dc-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }

.dc-indigo .dc-icon  { background: rgba(99,102,241,.1);  color: #6366f1; }
.dc-indigo .dc-bar   { background: linear-gradient(90deg,#6366f1,#818cf8); }
.dc-emerald .dc-icon { background: rgba(16,185,129,.1);  color: #10b981; }
.dc-emerald .dc-bar  { background: linear-gradient(90deg,#10b981,#34d399); }
.dc-amber .dc-icon   { background: rgba(245,158,11,.1);  color: #f59e0b; }
.dc-amber .dc-bar    { background: linear-gradient(90deg,#f59e0b,#fbbf24); }
.dc-rose .dc-icon    { background: rgba(239,68,68,.1);   color: #ef4444; }
.dc-rose .dc-bar     { background: linear-gradient(90deg,#ef4444,#f87171); }
.dc-violet .dc-icon  { background: rgba(139,92,246,.1);  color: #8b5cf6; }
.dc-violet .dc-bar   { background: linear-gradient(90deg,#8b5cf6,#a78bfa); }
.dc-teal .dc-icon    { background: rgba(20,184,166,.1);  color: #14b8a6; }
.dc-teal .dc-bar     { background: linear-gradient(90deg,#14b8a6,#2dd4bf); }

.dash-charts { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 22px; }
@media (min-width: 992px) { .dash-charts { grid-template-columns: 1fr 1fr; } }
.dash-chart-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
}
.dcc-wide { grid-column: 1 / -1; }
.dcc-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.dcc-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 6px; }
.dcc-title { font-weight: 700; font-size: 14px; }
.dcc-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dcc-wrap  { position: relative; height: 200px; }

/* ── Misc utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }

.ip-empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.ip-empty-state i { font-size: 36px; margin-bottom: 12px; opacity: .4; display: block; }
.ip-empty-state p { font-size: 13.5px; }

.ip-stat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 767px) {
  #ip-sidebar { transform: translateX(-100%); box-shadow: none; }
  #ip-sidebar.sb-open { transform: translateX(0); box-shadow: var(--sh-xl); }
  #ip-main { margin-left: 0 !important; }
  #ip-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.55);
    z-index: 199; opacity: 0; transition: opacity .28s;
    pointer-events: none;
  }
  #ip-overlay.show { opacity: 1; pointer-events: auto; }
  #ip-topbar { padding: 0 16px; }
  .topbar-user-name { display: none; }
  #ip-page { padding: 16px; }
  .sb-collapse-btn { display: none; }
  .dha-wrap { height: 140px; }
  .dha-content { padding: 16px 20px; }
  .dha-name { font-size: 20px; }
  .dha-time { font-size: 22px; }
  .dha-right { display: none; }
  .modal-right .modal-dialog { max-width: 100% !important; margin: 0 !important; }
  .modal-right .modal-content { border-radius: var(--r-xl) var(--r-xl) 0 0 !important; min-height: auto !important; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .span2 { grid-column: 1; }
  .dash-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .dc-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
}

/* QR Menu */
.qr-page-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.qr-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.qr-menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}

.qr-menu-card:hover {
  border-color: rgba(var(--primary-r), .28);
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.qr-card-header {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.qr-brand-icon {
  align-items: center;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(20,184,166,.12));
  border: 1px solid rgba(99,102,241,.16);
  border-radius: var(--r-sm);
  color: var(--primary);
  display: flex;
  flex-shrink: 0;
  font-size: 22px;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.qr-brand-meta {
  min-width: 0;
}

.qr-brand-meta h2 {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 4px;
}

.qr-brand-meta a {
  color: var(--muted);
  display: block;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-preview-panel {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(248,250,252,.92), rgba(255,255,255,.96)),
    radial-gradient(circle at top right, rgba(20,184,166,.16), transparent 34%);
  border: 1px solid var(--border);
  border-radius: var(--r);
  display: flex;
  justify-content: center;
  min-height: 210px;
  padding: 18px;
}

.qr-preview-panel img {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-sm);
  height: 168px;
  object-fit: contain;
  padding: 10px;
  width: 168px;
}

.qr-empty-code {
  align-items: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-sm);
  color: var(--muted-2);
  display: flex;
  font-size: 28px;
  height: 168px;
  justify-content: center;
  width: 168px;
}

.qr-card-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.qr-card-actions .btn {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  margin: 0 !important;
  min-height: 38px;
  white-space: nowrap;
}

.qr-sortable-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.qr-sortable-list li {
  align-items: center;
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--r-sm);
  color: var(--text-2) !important;
  cursor: grab;
  display: flex;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 12px;
}

.qr-sortable-list li:active {
  cursor: grabbing;
}

.qr-sortable-list li i {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 767px) {
  .qr-menu-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .qr-card-actions { grid-template-columns: 1fr; }
}
