/* ═══════════════════════════════════════════════════
   PayLink Pro – Admin Panel
   Custom Stylesheet — Light & Dark Mode
═══════════════════════════════════════════════════ */

/* ── Google Font ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ───────────────────────────────── */
:root {
  /* Brand */
  --brand: #4361ee;
  --brand-dark: #2c4ecf;
  --brand-light: #eef1ff;
  --brand-rgb: 67, 97, 238;

  /* Accent colors */
  --green: #06d6a0;
  --green-bg: #e6fdf8;
  --orange: #f4a261;
  --orange-bg: #fff4ec;
  --red: #ef233c;
  --red-bg: #fde8eb;
  --purple: #7209b7;
  --purple-bg: #f3e8ff;
  --yellow: #ffd60a;

  /* Layout */
  --sidebar-w: 248px;
  --topbar-h: 64px;

  /* Light mode surfaces */
  --bg-base: #f4f5f7;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8f9fb;
  --bg-hover: #f0f2f5;
  --bg-active: #e8ebf4;

  /* Light mode text */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-brand: #4361ee;

  /* Borders */
  --border: #e2e8f0;
  --border-2: #cbd5e1;

  /* Sidebar light */
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-text: #475569;
  --sidebar-text-active: #0f172a;
  --sidebar-icon: #94a3b8;
  --sidebar-active-bg: #eef1ff;
  --sidebar-active-text: #4361ee;

  /* 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);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;

  /* Transition */
  --t: .18s ease;
}

/* ── Dark Mode Variables ─────────────────────────── */
[data-theme="dark"] {
  --bg-base: #0f1117;
  --bg-surface: #1a1d27;
  --bg-surface-2: #1f2335;
  --bg-hover: #252838;
  --bg-active: #2a2e42;

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-brand: #7b9cff;

  --border: #2a2e42;
  --border-2: #363b55;

  --sidebar-bg: #13151f;
  --sidebar-border: #1e2133;
  --sidebar-text: #8892b0;
  --sidebar-text-active: #e2e8f0;
  --sidebar-icon: #64748b;
  --sidebar-active-bg: rgba(67,97,238,.18);
  --sidebar-active-text: #7b9cff;

  --brand-light: rgba(67,97,238,.15);

  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.5);

  --green-bg: rgba(6,214,160,.12);
  --red-bg: rgba(239,35,60,.12);
  --orange-bg: rgba(244,162,97,.12);
  --purple-bg: rgba(114,9,183,.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg-base);
  color: var(--text-primary);
  transition: background var(--t), color var(--t);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

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

/* ═══════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--t), background var(--t), border-color var(--t);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.brand-logo {
  width: 32px; height: 32px;
  background: var(--brand);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -.3px;
}

.brand-name span { color: var(--brand); }

/* Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-group { margin-bottom: 24px; }

.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all var(--t);
  position: relative;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

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

.nav-icon {
  font-size: 16px;
  color: var(--sidebar-icon);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: color var(--t);
}

.nav-item:hover .nav-icon { color: var(--text-primary); }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

.nav-badge.green { background: var(--green); }
.nav-badge.gray { background: var(--border-2); color: var(--text-secondary); }

/* Project dots */
.project-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

/* User tile */
.user-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t);
}
.user-tile:hover { background: var(--bg-hover); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════════════ */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 400;
  transition: background var(--t), border-color var(--t);
}

.topbar-search {
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  transition: border-color var(--t), background var(--t);
}

.topbar-search:focus-within {
  border-color: var(--brand);
  background: var(--bg-surface);
}

.topbar-search i { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }

.topbar-search input {
  border: none;
  background: transparent;
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  flex: 1;
}

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

.topbar-kbd {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 600;
  flex-shrink: 0;
}

.topbar-spacer { flex: 1; }

.topbar-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.topbar-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin: 0 8px;
  flex-shrink: 0;
}

/* Settings btn with indicator dot */
.topbar-btn-dot { position: relative; }
.topbar-btn-indicator {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--bg-surface);
}

/* User info block */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 10px;
  transition: background var(--t);
}
.topbar-user:hover { background: var(--bg-hover); }
.topbar-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.topbar-user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.topbar-user-role {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.topbar-user-chevron {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.avatar-dropdown.open .topbar-user-chevron { transform: rotate(180deg); }

/* Topbar icon button */
.topbar-btn {
  width: 36px; height: 36px;
  background: none;
  border: none;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  position: relative;
  transition: all var(--t);
  flex-shrink: 0;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--brand); }

.notif-dot {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  background: #ef4444;
  border-radius: 99px;
  border: 2px solid var(--bg-surface);
  font-size: 9px; font-weight: 700;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* Theme toggle */
.theme-toggle {
  width: 38px; height: 38px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 17px;
  cursor: pointer;
  transition: all var(--t);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

/* New Invoice Button */
.btn-new {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), transform var(--t);
  flex-shrink: 0;
}
.btn-new:hover { background: var(--brand-dark); transform: translateY(-1px); }

.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid var(--border);
  transition: border-color var(--t);
}
.topbar-avatar:hover { border-color: var(--brand); }

/* Apps quick-links dropdown */
.apps-dropdown { position: relative; flex-shrink: 0; }
.apps-menu {
  display: none;
  position: fixed;
  width: 224px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  padding: 6px;
  z-index: 99999;
  animation: menuFadeIn .18s ease;
}
.apps-menu.open { display: block; }
.apps-menu-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px 8px;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}
.app-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 2px;
  border-radius: 10px;
  text-decoration: none;
  transition: background var(--t);
}
.app-item:hover { background: var(--bg-hover); }
.app-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.app-item span {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 48px;
}
.app-item:hover span { color: var(--text); }

/* Language dropdown */
.lang-dropdown { position: relative; flex-shrink: 0; }
.lang-btn {
  width: auto !important;
  padding: 0 10px;
  gap: 6px;
  border: 1.5px solid var(--border) !important;
  background: var(--bg-surface-2) !important;
  border-radius: 10px !important;
  display: flex;
  align-items: center;
}
.lang-flag { font-size: 16px; line-height: 1; }
.lang-code { font-size: 13px; font-weight: 600; color: var(--text); }
.lang-chevron { font-size: 10px; color: var(--text-muted); transition: transform .2s; }
.lang-dropdown.open .lang-chevron { transform: rotate(180deg); }
.lang-menu {
  display: none;
  position: fixed;
  width: 190px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 99999;
  animation: menuFadeIn .18s ease;
}
.lang-menu.open { display: flex; flex-direction: column; }
.lang-menu-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 10px 10px;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--t), color var(--t);
}
.lang-item:hover { background: var(--bg-hover); color: var(--brand); }
.lang-item.active { color: var(--brand); font-weight: 600; }
.lang-item.active:hover { background: var(--bg-hover); }
.lang-check { margin-left: auto; color: var(--brand); font-size: 14px; }

/* Notification dropdown */
.notif-dropdown { position: relative; flex-shrink: 0; }
.notif-menu {
  display: none;
  position: fixed;
  width: 340px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  z-index: 99999;
  overflow: hidden;
  animation: menuFadeIn .18s ease;
}
.notif-menu.open { display: flex; flex-direction: column; }
.notif-menu-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 12px;
  border-bottom: 1.5px solid var(--border);
}
.notif-menu-title { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.notif-menu-badge {
  font-size: 11px; font-weight: 600;
  background: var(--brand); color: #fff;
  border-radius: 20px; padding: 2px 9px;
}
.notif-mark-all {
  font-size: 11px; color: var(--brand); background: none;
  border: none; cursor: pointer; padding: 0; font-weight: 500;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--t);
  position: relative;
}
.notif-item:last-of-type { border-bottom: none; }
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: color-mix(in srgb, var(--brand) 4%, var(--bg-surface)); }
.notif-item.unread:hover { background: color-mix(in srgb, var(--brand) 8%, var(--bg-surface)); }
.notif-icon-wrap {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.notif-unread-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand); flex-shrink: 0; margin-top: 4px;
}
.notif-view-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px; font-size: 13px; font-weight: 600;
  color: var(--brand); text-decoration: none;
  border-top: 1.5px solid var(--border);
  transition: background var(--t);
}
.notif-view-all:hover { background: var(--bg-hover); }

/* Avatar dropdown */
.avatar-dropdown {
  position: relative;
  flex-shrink: 0;
}
.avatar-menu {
  display: none;
  position: fixed;
  width: 220px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
  padding: 8px;
  z-index: 99999;
  animation: menuFadeIn .18s ease;
}
.avatar-menu.open { display: flex; flex-direction: column; }
@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.avatar-menu-header {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 12px 12px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 6px;
}
.avatar-menu-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.avatar-menu-item i { font-size: 16px; color: var(--text-muted); flex-shrink: 0; }
.avatar-menu-item:hover { background: var(--bg-hover); color: var(--brand); }
.avatar-menu-item:hover i { color: var(--brand); }
.avatar-menu-item.danger { color: #ef4444; }
.avatar-menu-item.danger i { color: #ef4444; }
.avatar-menu-item.danger:hover { background: #fee2e2; color: #dc2626; }
.avatar-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 8px;
}

/* ═══════════════════════════════════════════════════
   PAGE CONTENT
═══════════════════════════════════════════════════ */
.page-content {
  padding: 0 32px 28px;
  flex: 1;
}


/* ── Breadcrumb Bar ──────────────────────────────── */
.breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 10px 0 10px;
}

.breadcrumb-bar + * {
  margin-top: 0;
}
.breadcrumb-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}
.breadcrumb-item {
  font-size: 12.5px;
  color: var(--text-muted);
}
.breadcrumb-item.active {
  color: var(--brand);
  font-weight: 600;
}
.breadcrumb-sep {
  font-size: 9px;
  color: var(--text-muted);
  opacity: .5;
}

/* ── Page Header ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-date {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.page-greeting {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -.5px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 6px;
}

/* ── Quick Stats Bar ─────────────────────────────── */
.quick-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 24px;
  margin-bottom: 24px;
  width: fit-content;
}

.quick-stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 24px;
  margin-right: 24px;
  border-right: 1.5px solid var(--border);
}

.quick-stat-item:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: none;
}

.quick-stat-item i { font-size: 18px; color: var(--text-muted); }
.quick-stat-value { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.quick-stat-label { font-size: 12px; color: var(--text-secondary); }

/* ── Section Card ────────────────────────────────── */
.section-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: background var(--t), border-color var(--t);
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--border);
}

.section-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.section-card-title i { color: var(--text-muted); }

/* ── Dropdown Pill ───────────────────────────────── */
.pill-select {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t);
}
.pill-select:hover { border-color: var(--border-2); color: var(--text-primary); }

/* ── Text Link ───────────────────────────────────── */
.text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-brand);
  cursor: pointer;
  transition: opacity var(--t);
}
.text-link:hover { opacity: .75; }

/* ═══════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }

.data-table thead tr {
  border-bottom: 1.5px solid var(--border);
}

.data-table th {
  padding: 12px 20px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  background: var(--bg-surface-2);
}

.data-table td {
  padding: 14px 20px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background var(--t);
}

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

/* ── Table Row Meta ──────────────────────────────── */
.task-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Assignee chip */
.assignee-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.assignee-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.assignee-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ── Status Badges ───────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
}

.badge-paid { background: var(--green-bg); color: #059669; }
.badge-paid::before { background: #06d6a0; }

.badge-pending { background: var(--orange-bg); color: #c2410c; }
.badge-pending::before { background: #f97316; }

.badge-overdue { background: var(--red-bg); color: #dc2626; }
.badge-overdue::before { background: var(--red); }

.badge-draft { background: var(--bg-surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.badge-draft::before { background: var(--text-muted); }

.badge-inprogress { background: var(--brand-light); color: var(--brand); }
.badge-inprogress::before { background: var(--brand); }

.badge-partial { background: var(--purple-bg); color: var(--purple); }
.badge-partial::before { background: var(--purple); }

/* ═══════════════════════════════════════════════════
   ACTION BUTTONS
═══════════════════════════════════════════════════ */
.btn-icon {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.danger:hover { background: var(--red-bg); color: var(--red); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-2); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════ */
.stat-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--t);
}
.stat-card:hover { border-color: var(--border-2); box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon-wrap {
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1; margin-bottom: 6px; }
.stat-change { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 3px; }
.stat-change.up { color: #059669; }
.stat-change.down { color: var(--red); }
.stat-change.neutral { color: var(--text-muted); }


/* ═══════════════════════════════════════════════════
   SCHEDULE SECTION
═══════════════════════════════════════════════════ */
.week-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--t);
  min-width: 48px;
}

.week-day:hover { background: var(--bg-hover); }

.week-day.today {
  background: var(--brand);
  color: #fff;
  border-radius: 10px;
}

.week-day-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.week-day.today .week-day-label { color: rgba(255,255,255,.8); }
.week-day-num { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.week-day.today .week-day-num { color: #fff; }

/* Schedule Event */
.schedule-event {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  position: relative;
}
.schedule-event:last-child { border-bottom: none; }
.schedule-event:hover { background: var(--bg-hover); }

.event-stripe {
  width: 3px;
  border-radius: 99px;
  align-self: stretch;
  flex-shrink: 0;
}

.event-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-surface-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.event-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.event-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.event-avatars {
  display: flex;
  margin-left: auto;
  flex-shrink: 0;
}

.event-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
  margin-left: -8px;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

.event-avatar:first-child { margin-left: 0; }

/* ═══════════════════════════════════════════════════
   NOTES SECTION
═══════════════════════════════════════════════════ */
.note-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  transition: background var(--t);
  cursor: pointer;
}
.note-item:last-child { border-bottom: none; }
.note-item:hover { background: var(--bg-hover); }

.note-check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all var(--t);
}

.note-item.done .note-check {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-size: 10px;
}

.note-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.note-item.done .note-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.note-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════
   FORM STYLES
═══════════════════════════════════════════════════ */
.form-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: background var(--t), border-color var(--t);
}

.form-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--t);
  font-family: inherit;
}

.form-input:focus { border-color: var(--brand); background: var(--bg-surface); box-shadow: 0 0 0 3px rgba(var(--brand-rgb),.12); }
.form-input::placeholder { color: var(--text-muted); }

select.form-input { cursor: pointer; }

/* ═══════════════════════════════════════════════════
   CHART AREA
═══════════════════════════════════════════════════ */
.chart-wrap {
  padding: 20px 22px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding-bottom: 0;
}

.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }

.chart-bar-outer {
  width: 100%;
  background: var(--bg-surface-2);
  border-radius: 6px 6px 0 0;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: background var(--t);
}
.chart-bar-outer:hover { background: var(--bg-hover); }

.chart-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, rgba(var(--brand-rgb),.9), rgba(var(--brand-rgb),.4));
  border-radius: 6px 6px 0 0;
  position: absolute;
  bottom: 0;
  transition: height .5s cubic-bezier(.34,1.56,.64,1);
}

.chart-bar-fill.active {
  background: linear-gradient(180deg, var(--brand), rgba(var(--brand-rgb),.6));
}

.chart-month { font-size: 11px; color: var(--text-muted); font-weight: 500; }

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════
   USAGE BARS
═══════════════════════════════════════════════════ */
.usage-item { margin-bottom: 16px; }
.usage-item:last-child { margin-bottom: 0; }

.usage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}

.usage-label { font-weight: 500; color: var(--text-secondary); }
.usage-count { font-weight: 700; color: var(--text-primary); }

.usage-track {
  height: 5px;
  background: var(--bg-surface-2);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.usage-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}

/* ═══════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════ */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-btns { display: flex; gap: 4px; }

.pg-btn {
  width: 32px; height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all var(--t);
}
.pg-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.pg-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ═══════════════════════════════════════════════════
   FILTER BAR
═══════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 22px;
  border-bottom: 1.5px solid var(--border);
  flex-wrap: wrap;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  transition: all var(--t);
}
.filter-search:focus-within { border-color: var(--brand); background: var(--bg-surface); }
.filter-search i { font-size: 13px; color: var(--text-muted); }
.filter-search input { border: none; background: transparent; outline: none; font-size: 13px; color: var(--text-primary); width: 100%; }
.filter-search input::placeholder { color: var(--text-muted); }

.filter-select {
  padding: 8px 12px;
  background: var(--bg-surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: all var(--t);
  font-family: inherit;
}
.filter-select:focus { border-color: var(--brand); }

/* ═══════════════════════════════════════════════════
   PAYMENT PAGE OVERLAY
═══════════════════════════════════════════════════ */
.overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(15,17,23,.6);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}

.overlay-bg.show { opacity: 1; pointer-events: all; }

.pay-modal {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1.5px solid var(--border);
  transform: translateY(20px);
  transition: transform var(--t);
}

.overlay-bg.show .pay-modal { transform: translateY(0); }

.pay-modal-header {
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  padding: 26px 28px;
  color: #fff;
}

.pay-modal-body { padding: 24px 28px; }

.pay-amount { font-size: 36px; font-weight: 800; letter-spacing: -.02em; }
.pay-meta { font-size: 13px; opacity: .8; margin-top: 4px; }

.pay-info-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 10px; }
.pay-info-label { color: var(--text-muted); }
.pay-info-value { font-weight: 600; }

.pay-divider { height: 1px; background: var(--border); margin: 16px 0; }

.gateway-grid { display: flex; gap: 8px; margin-bottom: 18px; }

.gateway-opt {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--t);
}
.gateway-opt:hover, .gateway-opt.sel { border-color: var(--brand); background: var(--brand-light); color: var(--brand); }
.gateway-opt .gi { font-size: 17px; }

.pay-btn {
  width: 100%;
  padding: 13px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--t);
}
.pay-btn:hover { background: var(--brand-dark); }

.secure-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}

/* ═══════════════════════════════════════════════════
   MISC
═══════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 0; }

.text-muted-sm { font-size: 12px; color: var(--text-muted); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.text-brand { color: var(--brand); }
.text-success { color: #059669 !important; }
.text-danger { color: var(--red) !important; }
.text-warning { color: #d97706 !important; }

.mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12.5px; }

/* ── Section visibility ──────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ── FAB ─────────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 28px; right: 28px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 13px 22px;
  font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(var(--brand-rgb),.45);
  display: flex; align-items: center; gap: 8px;
  z-index: 300;
  transition: all var(--t);
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(var(--brand-rgb),.55); }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .page-content { padding: 20px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .quick-stats { flex-wrap: wrap; width: 100%; }
  .quick-stat-item { border-right: none; padding-right: 0; margin-right: 0; }
}

/* ── Skeleton Loader ─────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.4s infinite;
  border-radius: 6px;
}

@keyframes skeleton-wave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Tooltip ─────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-surface);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 999;
}

/* ── Transitions ─────────────────────────────────── */
.sidebar, .main-wrap, .topbar, .section-card, .stat-card, .form-card,
.data-table td, .nav-item, .schedule-event, .note-item {
  transition-property: background, border-color, color, box-shadow;
  transition-duration: .18s;
  transition-timing-function: ease;
}
