/* ============================================
   Pay0 Design System — Modern Minimal Fintech
   ============================================ */

/* --- Variables --- */
:root {
  --p0-primary: #2563EB;
  --p0-primary-hover: #1D4ED8;
  --p0-primary-light: #EFF6FF;
  --p0-primary-50: #DBEAFE;

  --p0-white: #FFFFFF;
  --p0-gray-50: #F9FAFB;
  --p0-gray-100: #F3F4F6;
  --p0-gray-200: #E5E7EB;
  --p0-gray-300: #D1D5DB;
  --p0-gray-400: #9CA3AF;
  --p0-gray-500: #6B7280;
  --p0-gray-600: #4B5563;
  --p0-gray-700: #374151;
  --p0-gray-800: #1F2937;
  --p0-gray-900: #111827;

  --p0-success: #059669;
  --p0-success-light: #ECFDF5;
  --p0-warning: #D97706;
  --p0-warning-light: #FFFBEB;
  --p0-danger: #DC2626;
  --p0-danger-light: #FEF2F2;

  --p0-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --p0-shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --p0-shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --p0-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --p0-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);

  --p0-radius-sm: 6px;
  --p0-radius-md: 8px;
  --p0-radius-lg: 12px;
  --p0-radius-xl: 16px;

  --p0-sidebar-w: 260px;
  --p0-sidebar-mini: 0px;
  --p0-header-h: 60px;
  --p0-transition: 0.2s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; padding: 0;
  font-family: var(--p0-font);
  font-size: 14px; line-height: 1.5;
  color: var(--p0-gray-800);
  background: var(--p0-gray-50);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--p0-primary); text-decoration: none; }
a:hover { color: var(--p0-primary-hover); text-decoration: none; }
img { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 8px; font-weight: 600; color: var(--p0-gray-900); }

/* --- Typography --- */
.p0-page-title { font-size: 22px; font-weight: 700; color: var(--p0-gray-900); margin: 0; }
.p0-section-title { font-size: 16px; font-weight: 600; color: var(--p0-gray-800); margin-bottom: 16px; }
.p0-label { font-size: 12px; font-weight: 500; color: var(--p0-gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.p0-muted { color: var(--p0-gray-500); font-size: 13px; }

/* --- Buttons --- */
.p0-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: none; border-radius: var(--p0-radius-md);
  font-family: var(--p0-font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--p0-transition);
  text-decoration: none; line-height: 1.4;
}
.p0-btn-primary { background: var(--p0-primary); color: #fff; }
.p0-btn-primary:hover { background: var(--p0-primary-hover); color: #fff; transform: translateY(-1px); }
.p0-btn-outline {
  background: transparent; color: var(--p0-primary);
  border: 1.5px solid var(--p0-primary);
}
.p0-btn-outline:hover { background: var(--p0-primary-light); color: var(--p0-primary); }
.p0-btn-danger { background: var(--p0-danger); color: #fff; }
.p0-btn-danger:hover { background: #B91C1C; color: #fff; }
.p0-btn-success { background: var(--p0-success); color: #fff; }
.p0-btn-success:hover { background: #047857; color: #fff; }
.p0-btn-sm { padding: 6px 14px; font-size: 13px; }
.p0-btn-block { width: 100%; justify-content: center; }

/* --- Forms --- */
.p0-form-group { margin-bottom: 16px; }
.p0-form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 500; color: var(--p0-gray-700);
}
.p0-form-control {
  width: 100%; padding: 10px 14px;
  background: var(--p0-white); border: 1.5px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-md); font-family: var(--p0-font);
  font-size: 14px; color: var(--p0-gray-800);
  transition: border var(--p0-transition), box-shadow var(--p0-transition);
  outline: none;
}
.p0-form-control:focus {
  border-color: var(--p0-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.p0-form-control::placeholder { color: var(--p0-gray-400); }
select.p0-form-control { appearance: auto; }
textarea.p0-form-control { min-height: 80px; resize: vertical; }

/* --- Cards --- */
.p0-card {
  background: var(--p0-white); border: 1px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-lg); padding: 24px;
  box-shadow: var(--p0-shadow-xs);
}
.p0-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 16px;
  border-bottom: 1px solid var(--p0-gray-100);
}
.p0-card-title { font-size: 15px; font-weight: 600; color: var(--p0-gray-800); margin: 0; }

/* --- Stat Cards --- */
.p0-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.p0-stat {
  background: var(--p0-white); border: 1px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-lg); padding: 20px;
  border-left: 3px solid var(--p0-primary);
  display: flex; align-items: flex-start; gap: 14px;
  transition: box-shadow var(--p0-transition);
}
.p0-stat:hover { box-shadow: var(--p0-shadow-md); }
.p0-stat-icon {
  width: 42px; height: 42px; border-radius: var(--p0-radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.p0-stat-icon.blue { background: var(--p0-primary-light); color: var(--p0-primary); }
.p0-stat-icon.green { background: var(--p0-success-light); color: var(--p0-success); }
.p0-stat-icon.amber { background: var(--p0-warning-light); color: var(--p0-warning); }
.p0-stat-icon.red { background: var(--p0-danger-light); color: var(--p0-danger); }
.p0-stat-info { flex: 1; min-width: 0; }
.p0-stat-label { font-size: 12px; font-weight: 500; color: var(--p0-gray-500); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.p0-stat-value { font-size: 24px; font-weight: 700; color: var(--p0-gray-900); line-height: 1.2; }
.p0-stat.border-green { border-left-color: var(--p0-success); }
.p0-stat.border-amber { border-left-color: var(--p0-warning); }
.p0-stat.border-red { border-left-color: var(--p0-danger); }

/* --- Tables --- */
.p0-table { width: 100%; border-collapse: collapse; }
.p0-table th {
  text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600;
  color: var(--p0-gray-500); text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--p0-gray-50); border-bottom: 1px solid var(--p0-gray-200);
}
.p0-table td {
  padding: 12px 14px; font-size: 13px; color: var(--p0-gray-700);
  border-bottom: 1px solid var(--p0-gray-100);
}
.p0-table tbody tr:hover { background: var(--p0-gray-50); }

/* DataTables overrides */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  padding: 6px 10px; border: 1.5px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-sm); font-family: var(--p0-font);
  font-size: 13px; outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--p0-primary);
}

/* --- Badges --- */
.p0-badge {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.p0-badge-success { background: var(--p0-success-light); color: var(--p0-success); }
.p0-badge-warning { background: var(--p0-warning-light); color: var(--p0-warning); }
.p0-badge-danger { background: var(--p0-danger-light); color: var(--p0-danger); }
.p0-badge-info { background: var(--p0-primary-light); color: var(--p0-primary); }

/* =========================================
   DASHBOARD LAYOUT — Sidebar + Header
   ========================================= */

/* Wrapper */
.p0-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.p0-sidebar {
  width: var(--p0-sidebar-w); height: 100vh; position: fixed;
  top: 0; left: 0; z-index: 100;
  background: var(--p0-white); border-right: 1px solid var(--p0-gray-200);
  display: flex; flex-direction: column;
  transition: width var(--p0-transition), transform var(--p0-transition);
  overflow-y: auto; overflow-x: hidden;
}
.p0-sidebar-brand {
  padding: 16px 20px; display: flex; align-items: center; gap: 10px;
  height: var(--p0-header-h); border-bottom: 1px solid var(--p0-gray-100);
  flex-shrink: 0;
}
.p0-sidebar-brand-text { font-size: 18px; font-weight: 800; color: var(--p0-primary); }
.p0-sidebar-user {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--p0-gray-100);
}
.p0-sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--p0-primary-light); color: var(--p0-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.p0-sidebar-username { font-size: 13px; font-weight: 600; color: var(--p0-gray-800); }
.p0-sidebar-role { font-size: 11px; color: var(--p0-gray-400); }

/* Sidebar nav */
.p0-sidebar-nav { padding: 12px 0; flex: 1; }
.p0-sidebar-heading {
  padding: 16px 20px 6px; font-size: 11px; font-weight: 600;
  color: var(--p0-gray-400); text-transform: uppercase; letter-spacing: 0.8px;
}
.p0-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--p0-gray-600);
  font-size: 13.5px; font-weight: 500;
  transition: all var(--p0-transition); border-left: 3px solid transparent;
}
.p0-sidebar-item:hover {
  background: var(--p0-gray-50); color: var(--p0-primary);
}
.p0-sidebar-item.active {
  background: var(--p0-primary-light); color: var(--p0-primary);
  font-weight: 600; border-left-color: var(--p0-primary);
}
.p0-sidebar-item i { font-size: 16px; width: 20px; text-align: center; }

/* Main content area */
.p0-main {
  flex: 1; margin-left: var(--p0-sidebar-w);
  min-height: 100vh; display: flex; flex-direction: column;
  transition: margin-left var(--p0-transition);
}

/* Header / Navbar */
.p0-header {
  height: var(--p0-header-h); background: var(--p0-white);
  border-bottom: 1px solid var(--p0-gray-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.p0-header-left { display: flex; align-items: center; gap: 16px; }
.p0-header-right { display: flex; align-items: center; gap: 16px; }
.p0-header-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--p0-gray-500); font-size: 20px; padding: 4px;
  display: none;
}
.p0-header-user {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--p0-radius-md);
  cursor: pointer; transition: background var(--p0-transition); position: relative;
}
.p0-header-user:hover { background: var(--p0-gray-50); }
.p0-header-user-name { font-size: 13px; font-weight: 600; color: var(--p0-gray-700); }
.p0-header-user-role { font-size: 11px; color: var(--p0-gray-400); }

/* User dropdown */
.p0-dropdown { position: relative; }
.p0-dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0;
  background: var(--p0-white); border: 1px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-md); box-shadow: var(--p0-shadow-lg);
  min-width: 180px; padding: 6px 0; z-index: 200;
  margin-top: 4px;
}
.p0-dropdown.open .p0-dropdown-menu { display: block; }
.p0-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px; color: var(--p0-gray-600);
  transition: background var(--p0-transition);
}
.p0-dropdown-item:hover { background: var(--p0-gray-50); color: var(--p0-gray-800); }
.p0-dropdown-divider { height: 1px; background: var(--p0-gray-100); margin: 4px 0; }

/* Page content */
.p0-content { padding: 24px; flex: 1; }
.p0-page-header { margin-bottom: 24px; }

/* Footer */
.p0-footer {
  padding: 16px 24px; text-align: center;
  font-size: 12px; color: var(--p0-gray-400);
  border-top: 1px solid var(--p0-gray-100);
}

/* --- Sidebar collapse (mobile) --- */
.sidebar-mini .p0-sidebar { transform: translateX(-100%); }
.sidebar-mini .p0-main { margin-left: 0; }

/* Overlay for mobile sidebar */
.p0-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.3); z-index: 99;
}
.p0-sidebar-open .p0-overlay { display: block; }
.p0-sidebar-open .p0-sidebar { transform: translateX(0) !important; }

/* =========================================
   AUTH LAYOUT — Login / Register / Forgot
   ========================================= */
.p0-auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--p0-gray-50); padding: 20px;
}
.p0-auth-card {
  width: 100%; max-width: 420px;
  background: var(--p0-white); border-radius: var(--p0-radius-xl);
  box-shadow: var(--p0-shadow-lg); padding: 40px 36px;
}
.p0-auth-logo { text-align: center; margin-bottom: 28px; }
.p0-auth-logo span { font-size: 24px; font-weight: 800; color: var(--p0-primary); }
.p0-auth-title { font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 4px; }
.p0-auth-subtitle { font-size: 14px; color: var(--p0-gray-500); text-align: center; margin-bottom: 28px; }
.p0-auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--p0-gray-500); }
.p0-auth-footer a { font-weight: 600; }

/* =========================================
   PRICING CARDS
   ========================================= */
.p0-pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.p0-pricing-card {
  background: var(--p0-white); border: 1px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-lg); padding: 28px 24px;
  text-align: center; transition: box-shadow var(--p0-transition);
}
.p0-pricing-card:hover { box-shadow: var(--p0-shadow-md); }
.p0-pricing-card.featured { border-color: var(--p0-primary); border-width: 2px; }
.p0-pricing-name { font-size: 16px; font-weight: 700; color: var(--p0-gray-800); margin-bottom: 4px; }
.p0-pricing-price { font-size: 32px; font-weight: 800; color: var(--p0-gray-900); margin: 12px 0; }
.p0-pricing-price small { font-size: 14px; font-weight: 500; color: var(--p0-gray-500); }
.p0-pricing-features { list-style: none; padding: 0; margin: 20px 0; text-align: left; }
.p0-pricing-features li {
  padding: 6px 0; font-size: 13px; color: var(--p0-gray-600);
  display: flex; align-items: center; gap: 8px;
}
.p0-pricing-features li i { color: var(--p0-success); }

/* =========================================
   COPY / CLIPBOARD
   ========================================= */
.p0-copy-row { display: flex; gap: 8px; }
.p0-copy-input {
  flex: 1; padding: 10px 14px; background: var(--p0-gray-50);
  border: 1.5px solid var(--p0-gray-200); border-radius: var(--p0-radius-md);
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px;
  color: var(--p0-gray-700); outline: none;
}
.p0-copy-btn {
  padding: 10px 16px; background: var(--p0-primary); color: #fff;
  border: none; border-radius: var(--p0-radius-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all var(--p0-transition); white-space: nowrap;
}
.p0-copy-btn:hover { background: var(--p0-primary-hover); }
.p0-copy-btn.copied { background: var(--p0-success); }

/* =========================================
   SUCCESS PAGE
   ========================================= */
.p0-success-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--p0-gray-50); padding: 20px;
}
.p0-success-card {
  text-align: center; max-width: 400px; width: 100%;
  background: var(--p0-white); border-radius: var(--p0-radius-xl);
  box-shadow: var(--p0-shadow-lg); padding: 48px 36px;
}
.p0-success-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: var(--p0-success-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--p0-success);
}
.p0-success-title { font-size: 22px; font-weight: 700; color: var(--p0-gray-900); margin-bottom: 8px; }
.p0-success-text { font-size: 14px; color: var(--p0-gray-500); margin-bottom: 24px; }

/* =========================================
   LANDING PAGE
   ========================================= */
.p0-landing-nav {
  background: var(--p0-white); border-bottom: 1px solid var(--p0-gray-200);
  padding: 0 24px; height: 64px; display: flex;
  align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.p0-landing-logo { font-size: 20px; font-weight: 800; color: var(--p0-primary); }
.p0-landing-links { display: flex; align-items: center; gap: 20px; }
.p0-landing-links a { font-size: 14px; font-weight: 500; color: var(--p0-gray-600); }
.p0-landing-links a:hover { color: var(--p0-primary); }

.p0-hero {
  padding: 64px 24px; text-align: center;
  background: linear-gradient(180deg, var(--p0-white) 0%, var(--p0-gray-50) 100%);
}
.p0-hero h1 { font-size: clamp(28px, 5vw, 48px); font-weight: 800; color: var(--p0-gray-900); margin-bottom: 16px; max-width: 700px; margin-left: auto; margin-right: auto; }
.p0-hero p { font-size: 18px; color: var(--p0-gray-500); max-width: 560px; margin: 0 auto 32px; }
.p0-hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.p0-features {
  padding: 64px 24px; max-width: 1100px; margin: 0 auto;
}
.p0-features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.p0-feature-card {
  background: var(--p0-white); border: 1px solid var(--p0-gray-200);
  border-radius: var(--p0-radius-lg); padding: 28px;
  transition: box-shadow var(--p0-transition);
}
.p0-feature-card:hover { box-shadow: var(--p0-shadow-md); }
.p0-feature-icon {
  width: 44px; height: 44px; border-radius: var(--p0-radius-md);
  background: var(--p0-primary-light); color: var(--p0-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 16px;
}
.p0-feature-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.p0-feature-desc { font-size: 14px; color: var(--p0-gray-500); line-height: 1.6; }

.p0-landing-footer {
  padding: 32px 24px; text-align: center;
  background: var(--p0-gray-900); color: var(--p0-gray-400);
  font-size: 13px;
}

/* =========================================
   UTILITIES
   ========================================= */
.p0-mt-0{margin-top:0}.p0-mt-1{margin-top:8px}.p0-mt-2{margin-top:16px}.p0-mt-3{margin-top:24px}
.p0-mb-0{margin-bottom:0}.p0-mb-1{margin-bottom:8px}.p0-mb-2{margin-bottom:16px}.p0-mb-3{margin-bottom:24px}
.p0-p-0{padding:0}.p0-p-2{padding:16px}.p0-p-3{padding:24px}
.p0-text-center{text-align:center}
.p0-text-right{text-align:right}
.p0-text-success{color:var(--p0-success)!important}
.p0-text-danger{color:var(--p0-danger)!important}
.p0-text-warning{color:var(--p0-warning)!important}
.p0-text-primary{color:var(--p0-primary)!important}
.p0-text-muted{color:var(--p0-gray-500)!important}
.p0-flex{display:flex}.p0-flex-center{display:flex;align-items:center;justify-content:center}
.p0-gap-1{gap:8px}.p0-gap-2{gap:16px}.p0-gap-3{gap:24px}
.p0-hidden{display:none!important}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .p0-sidebar { transform: translateX(-100%); }
  .p0-main { margin-left: 0; }
  .p0-header-toggle { display: block; }
  .p0-content { padding: 16px; }
  .p0-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .p0-stat-value { font-size: 20px; }
  .p0-auth-card { padding: 28px 24px; }
  .p0-hero { padding: 48px 16px; }
  .p0-hero p { font-size: 16px; }
  .p0-features { padding: 40px 16px; }
  .p0-features-grid { grid-template-columns: 1fr; }
  .p0-pricing-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .p0-stats { grid-template-columns: 1fr; }
  .p0-stat { padding: 16px; }
  .p0-page-title { font-size: 18px; }
}
