/* ============================================================
   KASHPAW FINTECH DESIGN SYSTEM
   Inspired by Stripe, Revolut, Wise
   ============================================================ */

:root {
  /* Brand colors */
  --kp-primary:       #0f1923;
  --kp-primary-light: #1a2d3d;
  --kp-accent:        #00d4aa;
  --kp-accent-dark:   #00b891;
  --kp-accent-light:  rgba(0,212,170,.12);

  /* Semantic colors */
  --kp-success:       #22c55e;
  --kp-success-bg:    rgba(34,197,94,.12);
  --kp-danger:        #ef4444;
  --kp-danger-bg:     rgba(239,68,68,.12);
  --kp-warning:       #f59e0b;
  --kp-warning-bg:    rgba(245,158,11,.12);
  --kp-info:          #3b82f6;
  --kp-info-bg:       rgba(59,130,246,.12);
  --kp-purple:        #8b5cf6;
  --kp-purple-bg:     rgba(139,92,246,.12);
  --kp-orange:        #f97316;
  --kp-orange-bg:     rgba(249,115,22,.12);

  /* Neutrals */
  --kp-bg:            #f0f4f8;
  --kp-surface:       #ffffff;
  --kp-border:        #e2e8f0;
  --kp-border-light:  #f1f5f9;
  --kp-text-primary:  #0f172a;
  --kp-text-secondary:#64748b;
  --kp-text-muted:    #94a3b8;

  /* Sidebar */
  --sidebar-width:    260px;
  --sidebar-bg:       #0f1923;
  --sidebar-text:     rgba(255,255,255,.7);
  --sidebar-hover:    rgba(255,255,255,.08);
  --sidebar-active:   rgba(0,212,170,.15);
  --sidebar-active-text: #00d4aa;

  /* Spacing */
  --header-height:    64px;

  /* Radius */
  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;
  --radius-xl:        20px;

  /* Shadows */
  --shadow-sm:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:        0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:        0 10px 30px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);
  --shadow-card:      0 2px 8px rgba(15,25,35,.06);

  /* Transitions */
  --transition:       all .2s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--kp-bg);
  color: var(--kp-text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ── Layout Shell ─────────────────────────────────────────── */
.kp-shell, .kp-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.kp-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.kp-sidebar.collapsed { width: 68px; }

.kp-sidebar-logo {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.kp-logo-mark {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--kp-accent), var(--kp-accent-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,212,170,.3);
}

.kp-logo-text {
  margin-left: 10px;
  font-size: 18px; font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}
.kp-logo-text span { color: var(--kp-accent); }

.kp-sidebar.collapsed .kp-logo-text { opacity: 0; width: 0; }

/* Nav */
.kp-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  scrollbar-width: none;
}
.kp-nav::-webkit-scrollbar { display: none; }

.kp-nav-section {
  margin-bottom: 4px;
}

.kp-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.25);
  padding: 16px 20px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}
.kp-sidebar.collapsed .kp-nav-label { opacity: 0; }

.kp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
  text-decoration: none;
}

.kp-sidebar.collapsed .kp-nav-item { padding: 10px; justify-content: center; }

.kp-nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.kp-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}

.kp-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kp-accent);
  border-radius: 0 3px 3px 0;
}

.kp-nav-icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.kp-nav-text {
  font-size: 13.5px;
  font-weight: 500;
  flex: 1;
  transition: var(--transition);
}
.kp-sidebar.collapsed .kp-nav-text { opacity: 0; width: 0; overflow: hidden; }

.kp-nav-badge {
  background: var(--kp-accent);
  color: var(--kp-primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
.kp-sidebar.collapsed .kp-nav-badge { display: none; }

/* Submenu */
.kp-nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.kp-nav-submenu.open { max-height: 500px; }

.kp-nav-subitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 52px;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.kp-nav-subitem:hover { color: #fff; }
.kp-nav-subitem.active { color: var(--kp-accent); }
.kp-nav-subitem::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Sidebar bottom */
.kp-sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.kp-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.kp-sidebar-user:hover { background: var(--sidebar-hover); }

.kp-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kp-accent), #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.kp-user-info { overflow: hidden; }
.kp-user-name {
  font-size: 13px; font-weight: 600;
  color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kp-user-role {
  font-size: 11px; color: var(--sidebar-text);
  white-space: nowrap;
}
.kp-sidebar.collapsed .kp-user-info { display: none; }

/* ── Main Content ─────────────────────────────────────────── */
.kp-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left .2s ease;
}
.kp-sidebar.collapsed ~ .kp-main { margin-left: 68px; }

/* ── Header ───────────────────────────────────────────────── */
.kp-header {
  height: var(--header-height);
  background: var(--kp-surface);
  border-bottom: 1px solid var(--kp-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.kp-header-toggle {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--kp-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--kp-text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}
.kp-header-toggle:hover { background: var(--kp-bg); color: var(--kp-text-primary); }

.kp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--kp-text-secondary);
  flex: 1;
}
.kp-breadcrumb .current {
  color: var(--kp-text-primary);
  font-weight: 600;
}
.kp-breadcrumb .sep { color: var(--kp-text-muted); }

.kp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kp-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--kp-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--kp-text-secondary);
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}
.kp-icon-btn:hover { background: var(--kp-bg); color: var(--kp-text-primary); }

.kp-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--kp-danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* ── Page Content ─────────────────────────────────────────── */
.kp-content {
  flex: 1;
  padding: 24px;
  overflow-x: hidden;
}

.kp-page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.kp-page-title { font-size: 22px; font-weight: 700; color: var(--kp-text-primary); }
.kp-page-subtitle { font-size: 13px; color: var(--kp-text-secondary); margin-top: 2px; }

/* ── KPI Cards ────────────────────────────────────────────── */
.kp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kp-stat-card {
  background: var(--kp-surface);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--kp-border);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kp-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.kp-stat-card::after {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 90px; height: 90px;
  border-radius: 50%;
  opacity: .07;
}

.kp-stat-card.accent::after { background: var(--kp-accent); }
.kp-stat-card.success::after { background: var(--kp-success); }
.kp-stat-card.danger::after  { background: var(--kp-danger); }
.kp-stat-card.info::after    { background: var(--kp-info); }
.kp-stat-card.purple::after  { background: var(--kp-purple); }
.kp-stat-card.orange::after  { background: var(--kp-orange); }
.kp-stat-card.warning::after { background: var(--kp-warning); }

.kp-stat-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.kp-stat-card.accent  .kp-stat-icon { background: linear-gradient(135deg, var(--kp-accent), var(--kp-accent-dark)); color: #fff; }
.kp-stat-card.success .kp-stat-icon { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.kp-stat-card.danger  .kp-stat-icon { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.kp-stat-card.info    .kp-stat-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.kp-stat-card.purple  .kp-stat-icon { background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff; }
.kp-stat-card.orange  .kp-stat-icon { background: linear-gradient(135deg, #f97316, #ea580c); color: #fff; }
.kp-stat-card.warning .kp-stat-icon { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }

.kp-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--kp-text-secondary);
  margin-bottom: 6px;
}

.kp-stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--kp-text-primary);
  letter-spacing: -.8px;
  line-height: 1;
}

.kp-stat-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
}
.kp-stat-change.up   { background: var(--kp-success-bg); color: var(--kp-success); }
.kp-stat-change.down { background: var(--kp-danger-bg);  color: var(--kp-danger);  }

/* ── Cards ────────────────────────────────────────────────── */
.kp-card {
  background: var(--kp-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--kp-border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.kp-card-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--kp-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.kp-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--kp-text-primary);
}
.kp-card-subtitle {
  font-size: 12px;
  color: var(--kp-text-secondary);
  margin-top: 1px;
}

.kp-card-body { padding: 20px; }
.kp-card-body.no-padding { padding: 0; }

/* ── Grid ─────────────────────────────────────────────────── */
.kp-grid { display: grid; gap: 16px; }
.kp-grid-2 { grid-template-columns: repeat(2, 1fr); }
.kp-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kp-grid-12-8 { grid-template-columns: 1fr 0.6fr; }

/* ── Tables ───────────────────────────────────────────────── */
.kp-table-wrap { overflow-x: auto; }

.kp-table {
  width: 100%;
  border-collapse: collapse;
}

.kp-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--kp-text-muted);
  padding: 11px 16px;
  text-align: left;
  background: #f8fafc;
  border-bottom: 1px solid var(--kp-border);
  white-space: nowrap;
}

.kp-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--kp-text-primary);
  border-bottom: 1px solid var(--kp-border-light);
  vertical-align: middle;
}

.kp-table tbody tr {
  transition: var(--transition);
}
.kp-table tbody tr:hover { background: var(--kp-bg); }
.kp-table tbody tr:last-child td { border-bottom: none; }

.kp-table .amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.kp-table .amount.credit { color: var(--kp-success); }
.kp-table .amount.debit  { color: var(--kp-danger); }

/* ── Badges ───────────────────────────────────────────────── */
.kp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.kp-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.kp-badge.success { background: var(--kp-success-bg); color: var(--kp-success); }
.kp-badge.danger  { background: var(--kp-danger-bg);  color: var(--kp-danger);  }
.kp-badge.warning { background: var(--kp-warning-bg); color: var(--kp-warning); }
.kp-badge.info    { background: var(--kp-info-bg);    color: var(--kp-info);    }
.kp-badge.accent  { background: var(--kp-accent-light); color: var(--kp-accent); }
.kp-badge.purple  { background: var(--kp-purple-bg);  color: var(--kp-purple);  }
.kp-badge.neutral { background: var(--kp-bg); color: var(--kp-text-secondary); }

/* ── Buttons ──────────────────────────────────────────────── */
.kp-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.kp-btn-primary {
  background: var(--kp-accent);
  color: #0f1923;
}
.kp-btn-primary:hover { background: var(--kp-accent-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,212,170,.35); }

.kp-btn-secondary {
  background: var(--kp-bg);
  color: var(--kp-text-primary);
  border: 1px solid var(--kp-border);
}
.kp-btn-secondary:hover { background: var(--kp-border-light); }

.kp-btn-danger {
  background: var(--kp-danger);
  color: #fff;
}
.kp-btn-danger:hover { background: #dc2626; }

.kp-btn-outline {
  background: transparent;
  border: 1px solid var(--kp-accent);
  color: var(--kp-accent);
}
.kp-btn-outline:hover { background: var(--kp-accent-light); }

.kp-btn-ghost {
  background: transparent;
  color: var(--kp-text-secondary);
}
.kp-btn-ghost:hover { background: var(--kp-bg); color: var(--kp-text-primary); }

.kp-btn-sm { padding: 6px 12px; font-size: 12px; }
.kp-btn-icon { padding: 8px; }

/* ── Forms ────────────────────────────────────────────────── */
.kp-form-group { margin-bottom: 16px; }

.kp-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--kp-text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.kp-input, .kp-select, .kp-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--kp-surface);
  border: 1.5px solid var(--kp-border);
  border-radius: var(--radius-md);
  font-size: 13.5px;
  color: var(--kp-text-primary);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.kp-input:focus, .kp-select:focus, .kp-textarea:focus {
  border-color: var(--kp-accent);
  box-shadow: 0 0 0 3px rgba(0,212,170,.15);
}

.kp-input::placeholder { color: var(--kp-text-muted); }

.kp-input-group {
  display: flex;
  align-items: center;
  background: var(--kp-surface);
  border: 1.5px solid var(--kp-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  overflow: hidden;
}
.kp-input-group:focus-within { border-color: var(--kp-accent); box-shadow: 0 0 0 3px rgba(0,212,170,.15); }
.kp-input-group .kp-input { border: none; box-shadow: none; }
.kp-input-group .kp-input:focus { box-shadow: none; }

.kp-input-icon {
  padding: 0 12px;
  color: var(--kp-text-muted);
  flex-shrink: 0;
}

/* ── Search Bar ───────────────────────────────────────────── */
.kp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kp-search-input {
  display: flex;
  align-items: center;
  background: var(--kp-bg);
  border: 1.5px solid var(--kp-border);
  border-radius: var(--radius-md);
  padding: 0 12px;
  gap: 8px;
  transition: var(--transition);
}
.kp-search-input:focus-within { border-color: var(--kp-accent); background: var(--kp-surface); }
.kp-search-input i { color: var(--kp-text-muted); font-size: 14px; }
.kp-search-input input {
  border: none;
  background: transparent;
  padding: 9px 0;
  font-size: 13px;
  color: var(--kp-text-primary);
  outline: none;
  min-width: 200px;
}

/* ── Modals ───────────────────────────────────────────────── */
.kp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,25,35,.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.kp-modal-overlay.open { opacity: 1; visibility: visible; }

.kp-modal {
  background: var(--kp-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98);
  transition: var(--transition);
}
.kp-modal-overlay.open .kp-modal { transform: translateY(0) scale(1); }

.kp-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--kp-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kp-modal-title { font-size: 16px; font-weight: 700; }

.kp-modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--kp-bg);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--kp-text-secondary);
  transition: var(--transition);
  font-size: 18px;
}
.kp-modal-close:hover { background: var(--kp-danger-bg); color: var(--kp-danger); }

.kp-modal-body { padding: 20px 24px; }
.kp-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--kp-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Charts ───────────────────────────────────────────────── */
.kp-chart-wrap { position: relative; }

/* ── Transaction item ─────────────────────────────────────── */
.kp-txn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--kp-border-light);
}
.kp-txn-item:last-child { border-bottom: none; }

.kp-txn-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.kp-txn-icon.depot   { background: var(--kp-success-bg); color: var(--kp-success); }
.kp-txn-icon.retrait { background: var(--kp-danger-bg);  color: var(--kp-danger); }

.kp-txn-info { flex: 1; min-width: 0; }
.kp-txn-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-txn-date { font-size: 12px; color: var(--kp-text-secondary); }

.kp-txn-amount { font-size: 14px; font-weight: 700; text-align: right; white-space: nowrap; }
.kp-txn-amount.depot   { color: var(--kp-success); }
.kp-txn-amount.retrait { color: var(--kp-danger); }

/* ── Alerts / Toasts ──────────────────────────────────────── */
.kp-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
}
.kp-alert.success { background: var(--kp-success-bg); color: #16a34a; border-color: rgba(34,197,94,.2); }
.kp-alert.danger  { background: var(--kp-danger-bg);  color: #dc2626; border-color: rgba(239,68,68,.2); }
.kp-alert.warning { background: var(--kp-warning-bg); color: #d97706; border-color: rgba(245,158,11,.2); }
.kp-alert.info    { background: var(--kp-info-bg);    color: #2563eb; border-color: rgba(59,130,246,.2); }

/* ── Tabs ─────────────────────────────────────────────────── */
.kp-tabs {
  display: flex;
  gap: 2px;
  background: var(--kp-bg);
  border-radius: var(--radius-md);
  padding: 4px;
}

.kp-tab {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--kp-text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  border: none;
  background: transparent;
}
.kp-tab.active {
  background: var(--kp-surface);
  color: var(--kp-text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Pagination ───────────────────────────────────────────── */
.kp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--kp-border-light);
  font-size: 13px;
  color: var(--kp-text-secondary);
}

.kp-pager {
  display: flex;
  gap: 4px;
}

.kp-page-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--kp-border);
  background: var(--kp-surface);
  color: var(--kp-text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
}
.kp-page-btn:hover { border-color: var(--kp-accent); color: var(--kp-accent); }
.kp-page-btn.active { background: var(--kp-accent); border-color: var(--kp-accent); color: #0f1923; font-weight: 700; }

/* ── Login Page ───────────────────────────────────────────── */
.kp-login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.kp-login-left {
  background: linear-gradient(145deg, #0f1923 0%, #1a3a4a 50%, #0f1923 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.kp-login-left::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,212,170,.15) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.kp-login-right {
  background: var(--kp-surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
}

.kp-login-form { width: 100%; max-width: 380px; }

.kp-login-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.kp-login-subtitle { font-size: 14px; color: var(--kp-text-secondary); margin-bottom: 32px; }

/* ── Donut chart ──────────────────────────────────────────── */
.kp-donut-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}
.kp-donut-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Profile Card ─────────────────────────────────────────── */
.kp-profile-header {
  background: linear-gradient(135deg, var(--kp-primary) 0%, var(--kp-primary-light) 100%);
  padding: 32px 24px 24px;
  text-align: center;
  color: #fff;
}

.kp-profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--kp-accent), #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 800; color: #fff;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,.2);
}

/* ── Utility ──────────────────────────────────────────────── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--kp-text-secondary); }
.font-bold { font-weight: 700; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp .3s ease both; }
.delay-1 { animation-delay: .05s; }
.delay-2 { animation-delay: .10s; }
.delay-3 { animation-delay: .15s; }
.delay-4 { animation-delay: .20s; }
.delay-5 { animation-delay: .25s; }

/* ── Loading Overlay ──────────────────────────────────────── */
#kp-loading {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.95);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px;
}

.kp-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--kp-border);
  border-top-color: var(--kp-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kp-grid-2, .kp-grid-3, .kp-grid-12-8 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  .kp-sidebar { transform: translateX(-260px); width: 260px; }
  .kp-sidebar.mobile-open { transform: translateX(0); }
  .kp-main { margin-left: 0 !important; }
  .kp-content { padding: 16px; }
  .kp-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .kp-login-shell { grid-template-columns: 1fr; }
  .kp-login-left { display: none; }
}

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

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--kp-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--kp-text-muted); }

/* ── Empty State ──────────────────────────────────────────── */
.kp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.kp-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
  background: var(--kp-success-bg);
  color: var(--kp-success);
}

.kp-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--kp-text-primary);
  margin-bottom: 4px;
}

.kp-empty-text {
  font-size: 13px;
  color: var(--kp-text-secondary);
}

/* ── Filter Bar ───────────────────────────────────────────── */
.kp-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Page info (Pagination text) ──────────────────────────── */
.kp-page-info {
  font-size: 12px;
  color: var(--kp-text-secondary);
  margin-top: 2px;
}

/* ── Client avatar ────────────────────────────────────────── */
.kp-client-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kp-client-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.kp-client-name { font-size: 13.5px; font-weight: 600; }
.kp-client-phone { font-size: 12px; color: var(--kp-text-secondary); }

/* ── Action buttons inline ────────────────────────────────── */
.kp-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

/* ── Card with tabs inside ────────────────────────────────── */
.kp-card-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--kp-bg);
  border-radius: var(--radius-sm);
}

.kp-card-tab {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--kp-text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
  text-decoration: none;
}

.kp-card-tab.active, .kp-card-tab:hover {
  background: var(--kp-surface);
  color: var(--kp-text-primary);
  box-shadow: var(--shadow-sm);
}

/* ── Sidebar — Partenaires API badge ──────────────────────── */
.kp-nav-api-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--kp-accent);
  color: var(--kp-primary);
  padding: 1px 6px;
  border-radius: 20px;
  margin-left: auto;
  letter-spacing: .3px;
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .kp-sidebar, .kp-header { display: none !important; }
  .kp-main { margin-left: 0 !important; }
}
