/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --bg: #f0f2f7;
  --card: #ffffff;
  --text: #1e1b2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(79,70,229,0.15);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.85; }

/* === NAVBAR === */
.navbar {
  background: linear-gradient(135deg, #1e1b3a 0%, #312e81 60%, #4f46e5 100%);
  color: #fff; padding: 0 1rem;
  box-shadow: 0 2px 12px rgba(79,70,229,0.25);
  position: sticky; top: 0; z-index: 100;
}
.navbar .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1200px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.15rem; color: #fff !important; text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
  color: #312e81; font-size: 0.9rem; font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-links { display: flex; gap: 0.5rem; align-items: center; }
.nav-links a { color: #c7d2fe; font-size: 0.9rem; padding: 0.5rem 0.8rem; border-radius: 8px; transition: all .2s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); }
.btn-logout { color: #fca5a5 !important; }
.btn-logout:hover { background: rgba(239,68,68,0.2) !important; }

.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 0.5rem; z-index: 1000;
  margin-top: 0.4rem;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 0.6rem 0.85rem; border-radius: 8px; color: var(--text); font-size: 0.85rem; }
.nav-dropdown-menu a:hover { background: #f3f4f6; color: var(--primary); }

/* === CONTAINER === */
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem; width: 100%; }

/* === FOOTER === */
.footer { margin-top: auto; padding: 1.5rem 1rem; background: #1e1b3a; color: #9ca3af; font-size: 0.8rem; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 0 1rem; }
.footer-muted { color: #6b7280; }

/* === AUTH === */
.auth-page { display: flex; justify-content: center; padding-top: 3rem; }
.auth-card {
  background: var(--card); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.auth-card.wide { max-width: 640px; }
.auth-card h1 { margin-bottom: 1.5rem; font-size: 1.4rem; }
.auth-link { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--text-muted); }

/* === FORMS === */
form { display: flex; flex-direction: column; gap: 1rem; }
label { font-size: 0.85rem; font-weight: 500; color: #374151; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
input, select {
  padding: 0.65rem 0.8rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.9rem; outline: none; transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.form-row { display: flex; gap: 1rem; }
button {
  padding: 0.65rem 1.3rem; background: var(--primary); color: #fff; border: none;
  border-radius: 8px; font-size: 0.95rem; cursor: pointer; font-weight: 600;
  transition: all .2s;
}
button:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.25); }
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* === DASHBOARD === */
.dashboard-header {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 100%);
  border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; color: #fff;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.dashboard-header::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px;
  border-radius: 50%; background: rgba(255,255,255,0.08);
}
.dashboard-header h1 { font-size: 1.6rem; margin-bottom: 0.25rem; font-weight: 700; }
.dashboard-sub { color: #c7d2fe; font-size: 0.9rem; margin-bottom: 1rem; opacity: 0.9; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 1rem; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 1.4rem; text-align: center;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.mini { padding: 1rem; }
.stat-pending { border-top: 3px solid var(--warning); }
.stat-success { border-top: 3px solid var(--success); }
.stat-danger { border-top: 3px solid var(--danger); }
.stat-number { display: block; font-size: 1.9rem; font-weight: 800; color: var(--text); }
.stat-pending .stat-number { color: #b45309; }
.stat-success .stat-number { color: #047857; }
.stat-danger .stat-number { color: #b91c1c; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }

.section {
  background: var(--card); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.section h2 { font-size: 1.15rem; margin-bottom: 1rem; color: var(--text); font-weight: 700; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.section-head h2 { margin: 0; }
.btn-link {
  background: var(--primary); color: #fff !important; padding: 0.5rem 1.1rem; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600; transition: all .2s; display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-link:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.25); }

.bank-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 1rem; font-size: 0.9rem; }
.bank-info > div {
  background: #f8fafc; border-radius: 10px; padding: 0.85rem 1.1rem;
  display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid #f1f5f9;
}
.bank-info .info-key { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.bank-info .info-val { font-weight: 600; color: var(--text); }

.creds-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; }
.creds-card > div { background: #f8fafc; border-radius: 10px; padding: 0.85rem 1.1rem; display: flex; flex-direction: column; gap: 0.25rem; border: 1px solid #f1f5f9; }
.creds-card .info-key { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.creds-card .info-val { font-family: "Fira Code", "Cascadia Code", monospace; font-size: 0.85rem; word-break: break-all; color: var(--text); }

.team-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.team-row .stat-card { flex: 1; min-width: 140px; }

/* === TABLE === */
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th {
  text-align: left; padding: 0.7rem 0.6rem; border-bottom: 2px solid var(--border);
  color: var(--text-muted); font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  background: #fafbfc;
}
.table td { padding: 0.75rem 0.6rem; border-bottom: 1px solid #f3f4f6; }
.table tr:hover td { background: #f8fafc; }
.table .amount { font-weight: 700; }
.text-center { text-align: center !important; color: #9ca3af; }

/* === BADGES === */
.badge { display: inline-block; padding: 0.3rem 0.7rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; text-transform: capitalize; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* === TABS === */
.tab-head { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.tab-btn {
  background: none; color: var(--text-muted); border: none; padding: 0.65rem 1.1rem; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 0;
  transition: color .2s;
}
.tab-btn:hover { color: var(--text); background: none; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.tab-pane h2 { font-size: 1.1rem; margin: 0 0 0.75rem; color: var(--text); }
.tab-pane h3 { font-size: 0.95rem; margin: 1.2rem 0 0.5rem; color: #374151; }
.tab-pane p { margin: 0.5rem 0; color: #475569; }

/* === API KEY === */
.api-key-box { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.api-key-box code { background: #f1f5f9; padding: 0.5rem 0.75rem; border-radius: 8px; font-size: 0.85rem; word-break: break-all; flex: 1; }

/* === BUTTONS === */
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; border-radius: 6px; }
.btn-confirm { background: var(--success); margin-right: 0.3rem; }
.btn-confirm:hover { background: #059669; }
.btn-cancel { background: var(--danger); }
.btn-cancel:hover { background: #dc2626; }

/* === ALERTS === */
.error { color: var(--danger); font-size: 0.85rem; }
.success { color: var(--success); font-size: 0.85rem; }
.text-muted { color: #9ca3af; font-size: 0.8rem; }
.text-success { color: var(--success); font-size: 0.85rem; }

/* === PRE/CODE === */
pre { background: #1e1b3a; color: #e2e8f0; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: 0.82rem; margin: 0.5rem 0; }
code { font-family: "Fira Code", "Cascadia Code", monospace; }
pre code { background: none; padding: 0; color: inherit; }
code { background: #f1f5f9; padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85rem; }

/* === PROMPT BOX === */
.prompt-box {
  position: relative;
  background: #1e1b3a;
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #312e81;
}
.prompt-box pre {
  margin: 0;
  padding: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.7;
  background: transparent;
  max-height: 600px;
  overflow-y: auto;
}
.btn-copy-prompt {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: #4f46e5;
  color: #e2e8f0;
  border: 1px solid #6366f1;
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  z-index: 2;
  transition: background .2s;
}
.btn-copy-prompt:hover { background: #6366f1; }
.btn-copy-prompt.copied { background: var(--success); border-color: var(--success); }

/* === APP DOWNLOAD CARDS === */
.app-download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.25rem; }
.app-download-card {
  background: linear-gradient(160deg, #fafaff 0%, #f5f3ff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.75rem; text-align: center; transition: all .25s;
  box-shadow: var(--shadow-sm);
}
.app-download-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.app-download-card .app-icon {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.app-download-card .app-icon.owner { background: linear-gradient(135deg, #6366f1, #a855f7); }
.app-download-card .app-icon.vendor { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.app-download-card h3 { font-size: 1.05rem; margin: 0 0 0.4rem; color: var(--text); font-weight: 700; }
.app-download-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 1.2rem; }
.app-download-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--text); color: #fff !important; padding: 0.6rem 1.4rem; border-radius: 10px;
  font-size: 0.9rem; font-weight: 600; transition: all .2s;
}
.app-download-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
