/* =========================================
   BankingService — Main Stylesheet
   Dark fintech design inspired by Yoomoney/Qiwi
   ========================================= */

:root {
  --bg-deep:       #070b14;
  --bg-card:       #0d1426;
  --bg-elevated:   #111827;
  --bg-hover:      #1a2235;
  --border:        rgba(255,255,255,0.07);
  --border-accent: rgba(99,179,237,0.3);
  --accent-blue:   #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-cyan:   #06b6d4;
  --accent-green:  #10b981;
  --accent-amber:  #f59e0b;
  --accent-red:    #ef4444;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #4b5563;
  --sidebar-w:     260px;
  --topbar-h:      60px;
  --radius:        12px;
  --radius-lg:     16px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);
  --gradient:      linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  --gradient-cyan: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  --gradient-green:linear-gradient(135deg, #059669, var(--accent-green));
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ══════════════════ LAYOUT ══════════════════ */

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}

.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin .25s cubic-bezier(.4,0,.2,1);
}

/* ── Sidebar Brand ── */
.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-brand a { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.brand-name {
  font-size: 1rem; font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Sidebar Nav ── */
.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 8px;
}
.nav-section-label {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); padding: 16px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none;
  font-size: .875rem; font-weight: 500;
  transition: all .15s ease; margin-bottom: 2px;
  position: relative;
}
.nav-link i { width: 18px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link.active {
  background: rgba(59,130,246,.12);
  color: var(--accent-blue);
}
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--accent-blue); border-radius: 0 3px 3px 0;
}
.badge-count {
  margin-left: auto;
  background: var(--accent-red); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: 12px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.user-card {
  display: flex; align-items: center; gap: 10px; flex: 1;
  padding: 8px; border-radius: 8px; text-decoration: none;
  transition: background .15s;
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar {
  width: 34px; height: 34px;
  background: var(--gradient); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: .8rem; flex-shrink: 0;
}
.user-name  { font-weight: 600; color: var(--text-primary); font-size: .8rem; line-height: 1.2; }
.user-role  { color: var(--text-muted); font-size: .7rem; }
.btn-logout {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-muted); text-decoration: none;
  transition: all .15s;
}
.btn-logout:hover { background: rgba(239,68,68,.15); color: var(--accent-red); }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,20,38,.8);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  width: 36px; height: 36px; border: none; border-radius: 8px;
  background: var(--bg-hover); color: var(--text-primary);
  cursor: pointer; font-size: 1.2rem; display: none;
  align-items: center; justify-content: center; transition: all .15s;
}
.sidebar-toggle:hover { background: var(--border-accent); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); text-decoration: none; font-size: 1.1rem;
  transition: all .15s; position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent-red); border-radius: 50%;
  border: 2px solid var(--bg-card);
}

.content-area { padding: 24px; flex: 1; }

/* ══════════════════ CARDS ══════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }

/* ── Stats Card ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card .stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card .stat-label { color: var(--text-muted); font-size: .8rem; margin-top: 4px; }
.stat-card .stat-change { font-size: .75rem; margin-top: 8px; }
.stat-card::after {
  content: ''; position: absolute;
  right: -20px; bottom: -20px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: currentColor; opacity: .04;
}

/* ── Bank Card (visual) ── */
.bank-card {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: 20px;
  aspect-ratio: 1.586;
  display: flex; flex-direction: column; justify-content: space-between;
  color: #fff;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.bank-card::before {
  content: ''; position: absolute;
  right: -30px; top: -30px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.bank-card::after {
  content: ''; position: absolute;
  right: 20px; bottom: -40px;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.bank-card:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 20px 40px rgba(59,130,246,.3); }
.bank-card.blocked { background: linear-gradient(135deg, #374151, #1f2937); }
.bank-card.expired { background: linear-gradient(135deg, #292524, #1c1917); }
.bank-card-number { font-size: 1rem; letter-spacing: .15em; font-family: 'Courier New', monospace; }
.bank-card-holder { font-size: .8rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }
.bank-card-expiry { font-size: .75rem; opacity: .75; }
.bank-card-ps { font-size: .9rem; font-weight: 700; text-align: right; }

/* ── Account Number ── */
.account-number {
  font-family: 'Courier New', monospace;
  font-size: .85rem; letter-spacing: .08em;
  color: var(--text-secondary);
  background: rgba(255,255,255,.04);
  padding: 4px 10px; border-radius: 6px;
  display: inline-block;
}

/* ══════════════════ TABLES ══════════════════ */

.table { color: var(--text-primary); }
.table > thead > tr > th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  border-color: var(--border); padding: 10px 16px;
}
.table > tbody > tr > td {
  border-color: var(--border); padding: 12px 16px; vertical-align: middle;
}
.table > tbody > tr:hover > td { background: var(--bg-hover); }
.table-responsive { border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ══════════════════ BADGES & STATUS ══════════════════ */

.badge {
  padding: 4px 10px; font-size: .72rem; font-weight: 600;
  border-radius: 6px; letter-spacing: .02em;
}
.status-active   { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.status-blocked  { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.status-pending  { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.2); }
.status-closed   { background: rgba(75,85,99,.15);   color: #9ca3af; border: 1px solid rgba(75,85,99,.2); }
.status-completed{ background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.2); }
.status-failed   { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.status-refunded { background: rgba(139,92,246,.15); color: #a78bfa; border: 1px solid rgba(139,92,246,.2); }

.tx-type-transfer   { color: var(--accent-blue); }
.tx-type-topup      { color: var(--accent-green); }
.tx-type-invoice    { color: var(--accent-amber); }
.tx-type-credit     { color: var(--accent-purple); }
.tx-type-deposit    { color: var(--accent-cyan); }
.tx-type-conversion { color: var(--text-secondary); }
.tx-type-cashback   { color: #fb923c; }
.tx-type-p2p        { color: #e879f9; }

/* ══════════════════ FORMS ══════════════════ */

.form-control, .form-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .875rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  background: var(--bg-elevated);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }
.form-label { color: var(--text-secondary); font-size: .825rem; margin-bottom: 6px; font-weight: 500; }
.input-group-text {
  background: var(--bg-hover); border-color: var(--border);
  color: var(--text-secondary);
}
.form-text { color: var(--text-muted); font-size: .775rem; }

/* ── Buttons ── */
.btn { border-radius: 8px; font-weight: 600; font-size: .875rem; padding: 9px 18px; transition: all .15s; }
.btn-primary { background: var(--gradient); border: none; color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,.4); }
.btn-outline-primary { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-outline-primary:hover { background: var(--accent-blue); color: #fff; }
.btn-danger  { background: var(--accent-red); border: none; }
.btn-success { background: var(--accent-green); border: none; }
.btn-warning { background: var(--accent-amber); border: none; color: #000; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ══════════════════ ALERTS ══════════════════ */

.alert {
  border-radius: var(--radius); border: 1px solid;
  font-size: .875rem; padding: 12px 16px;
}
.alert-success { background: rgba(16,185,129,.1); border-color: rgba(16,185,129,.25); color: #6ee7b7; }
.alert-danger  { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.25);  color: #fca5a5; }
.alert-info    { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.25);  color: #93c5fd; }
.alert-warning { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.25);  color: #fde68a; }

/* ══════════════════ MODALS ══════════════════ */

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.modal-header { border-color: var(--border); padding: 16px 20px; }
.modal-footer { border-color: var(--border); padding: 12px 20px; }
.btn-close { filter: invert(1) opacity(.5); }
.btn-close:hover { opacity: 1; }

/* ══════════════════ AUTH PAGES ══════════════════ */

.auth-body { overflow: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; background: var(--bg-deep); }
.auth-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: .35;
  animation: orbFloat 8s ease-in-out infinite;
}
.auth-orb-1 { width: 500px; height: 500px; background: var(--accent-blue); top: -200px; left: -100px; }
.auth-orb-2 { width: 400px; height: 400px; background: var(--accent-purple); bottom: -150px; right: -100px; animation-delay: -3s; }
.auth-orb-3 { width: 300px; height: 300px; background: var(--accent-cyan); top: 50%; right: 30%; animation-delay: -6s; }

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(20px, -20px) scale(1.05); }
}

.auth-wrapper {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}

.auth-card {
  background: rgba(13,20,38,.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center; margin-bottom: 28px;
}
.auth-logo-icon {
  width: 60px; height: 60px;
  background: var(--gradient);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(59,130,246,.4);
}
.auth-logo-text { font-size: 1.4rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.auth-subtitle { color: var(--text-muted); font-size: .85rem; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); margin: 20px 0; font-size: .8rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ══════════════════ PAGE HEADERS ══════════════════ */

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-size: 1.3rem; font-weight: 700; margin: 0;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-subtitle { color: var(--text-muted); font-size: .85rem; margin-top: 2px; }

/* ══════════════════ BALANCE DISPLAY ══════════════════ */

.balance-display {
  background: var(--gradient);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: #fff;
  position: relative; overflow: hidden;
}
.balance-display::after {
  content: ''; position: absolute;
  right: -40px; bottom: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.balance-label { font-size: .75rem; opacity: .8; text-transform: uppercase; letter-spacing: .1em; }
.balance-amount { font-size: 2rem; font-weight: 700; margin: 4px 0; }
.balance-currency { font-size: .9rem; opacity: .75; }

/* ══════════════════ P2P ORDERBOOK ══════════════════ */

.orderbook { font-size: .8rem; }
.orderbook .buy-row  td { color: var(--accent-green); }
.orderbook .sell-row td { color: var(--accent-red); }

/* ══════════════════ NOTIFICATION ITEM ══════════════════ */

.notif-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  transition: background .15s; cursor: pointer;
  display: flex; gap: 14px; align-items: flex-start;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { border-left: 3px solid var(--accent-blue); }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.notif-title  { font-size: .875rem; color: var(--text-primary); }
.notif-msg    { font-size: .8rem; color: var(--text-muted); }
.notif-time   { font-size: .72rem; color: var(--text-muted); white-space: nowrap; }

/* ══════════════════ LANDING ══════════════════ */

.landing-hero { text-align: center; padding: 80px 20px 60px; }
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 16px;
}
.hero-subtitle { color: var(--text-secondary); font-size: 1.1rem; max-width: 500px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 16px; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; transition: all .2s;
}
.feature-card:hover { border-color: var(--accent-blue); transform: translateY(-2px); }
.feature-icon { font-size: 2rem; margin-bottom: 12px; }

/* ══════════════════ MISC ══════════════════ */

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 3rem; opacity: .3; margin-bottom: 16px; }

.progress { background: var(--bg-elevated); height: 6px; border-radius: 3px; }
.progress-bar { background: var(--gradient); }

.text-gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-muted-custom { color: var(--text-muted) !important; }

.separator { height: 1px; background: var(--border); margin: 20px 0; }

/* Pill tabs */
.nav-pills .nav-link { color: var(--text-secondary); border-radius: 8px; font-size: .85rem; padding: 7px 16px; }
.nav-pills .nav-link.active { background: rgba(59,130,246,.15); color: var(--accent-blue); }
.nav-pills .nav-link:hover:not(.active) { background: var(--bg-hover); color: var(--text-primary); }

/* Pagination */
.pagination .page-link {
  background: var(--bg-elevated); border-color: var(--border);
  color: var(--text-secondary); border-radius: 8px !important; margin: 0 2px;
}
.pagination .page-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.pagination .page-item.active .page-link { background: var(--accent-blue); border-color: var(--accent-blue); color: #fff; }

/* Charts */
.chart-container { position: relative; height: 200px; }

/* Admin sidebar highlight */
.admin-badge { font-size: .65rem; background: var(--accent-amber); color: #000; padding: 1px 6px; border-radius: 4px; margin-left: 6px; font-weight: 700; }

/* Copy button */
.copy-btn { cursor: pointer; color: var(--text-muted); transition: color .15s; }
.copy-btn:hover { color: var(--accent-blue); }

/* ══════════════════ RESPONSIVE ══════════════════ */

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content-area { padding: 16px; }
  .balance-amount { font-size: 1.4rem; }
  .stat-card .stat-value { font-size: 1.2rem; }
  .auth-card { padding: 24px; }
  .bank-card { font-size: .85rem; }
}

@media (max-width: 480px) {
  .page-header { flex-direction: column; align-items: flex-start; }
  .auth-card { margin: 0 8px; padding: 20px; }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* Smooth load animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp .3s ease forwards; }
.fade-in-delay-1 { animation-delay: .05s; opacity: 0; }
.fade-in-delay-2 { animation-delay: .1s; opacity: 0; }
.fade-in-delay-3 { animation-delay: .15s; opacity: 0; }
