/* PayXip Admin — Monochrome B&W */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-card-hover: #111111;
  --bg-input: #0a0a0a;
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --accent: #ffffff;
  --text: #fafafa;
  --text-secondary: #888888;
  --text-tertiary: #555555;
  --green: #00d47b;
  --red: #ff4747;
  --sidebar-w: 240px;
  --radius: 10px;
  --radius-sm: 6px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
::selection { background: #333; color: white; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }

/* Auth */
.auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 40px 32px; border-radius: 16px; background: var(--bg); border: 1px solid var(--border); }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; justify-content: center; }
.auth-logo svg { width: 28px; height: 28px; }
.auth-logo span { font-size: 18px; font-weight: 800; letter-spacing: -0.04em; }
.auth-badge { font-size: 9px; font-weight: 700; background: #fff; color: #000; padding: 2px 7px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.05em; }
.auth-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.03em; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; }
.auth-error { background: rgba(255,71,71,0.08); border: 1px solid rgba(255,71,71,0.15); color: var(--red); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.auth-step { display: none; }
.auth-step.active { display: block; }
.totp-input { display: flex; gap: 6px; margin: 20px 0; }
.totp-input input { width: 46px; height: 52px; text-align: center; font-size: 20px; font-weight: 700; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); outline: none; transition: border 0.2s; }
.totp-input input:focus { border-color: #fff; }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-secondary); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: inherit; outline: none; transition: border 0.2s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #444; }
.form-input::placeholder { color: var(--text-tertiary); }
.form-hint { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.form-textarea { min-height: 80px; resize: vertical; }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 18px; border: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: #fff; color: #000; width: 100%; }
.btn-primary:hover { background: #e0e0e0; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-secondary { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #111; color: var(--text); border-color: var(--border-hover); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid rgba(255,71,71,0.2); }
.btn-danger:hover { background: rgba(255,71,71,0.08); }
.btn-ghost { background: transparent; color: var(--text-secondary); padding: 5px 8px; }
.btn-ghost:hover { color: var(--text); }
.btn-spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,0.2); border-top-color: #000; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Layout */
.dashboard-layout { display: flex; min-height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; background: var(--bg); border-right: 1px solid var(--border); }
.sidebar-header { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 8px; }
.sidebar-logo svg { width: 24px; height: 24px; }
.sidebar-logo span { font-size: 15px; font-weight: 800; letter-spacing: -0.04em; }
.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; }
.nav-section { margin-bottom: 4px; }
.nav-section-label { font-size: 9px; font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.1em; padding: 10px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-secondary); transition: all 0.1s; }
.nav-item:hover { color: var(--text); }
.nav-item.active { color: #fff; background: #111; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.5; }
.nav-item.active svg { opacity: 1; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.admin-badge { display: flex; align-items: center; gap: 8px; }
.admin-avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #000; flex-shrink: 0; }
.admin-info { flex: 1; min-width: 0; }
.admin-name { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.admin-role { font-size: 9px; color: var(--text-tertiary); text-transform: uppercase; font-weight: 600; letter-spacing: 0.05em; }

/* Main */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; overflow-x: hidden; overflow-y: auto; max-width: calc(100vw - var(--sidebar-w)); }
.main-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: rgba(0,0,0,0.9); backdrop-filter: blur(12px); z-index: 50; }
.page-title { font-size: 14px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-secondary); }

/* Pages */
.page { display: none; }
.page.active { display: block; }
.page-content { padding: 20px 24px; max-width: 1400px; overflow: hidden; width: 100%; }
.page-section { margin-bottom: 24px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); letter-spacing: -0.01em; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.stat-card { background: var(--bg); padding: 20px; position: relative; }
.stat-card:hover { background: #060606; }
.stat-card::before { display: none; }
.stat-icon { display: none; }
.stat-label { font-size: 10px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; color: #fff; }
.stat-change { font-size: 11px; font-weight: 500; margin-top: 4px; display: inline-block; }
.stat-change.up { color: var(--green); }
.stat-change.down { color: var(--red); }

/* Tables */
.data-table-wrap { overflow-x: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { border-bottom: 1px solid var(--border); }
.data-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.data-table td { padding: 10px 16px; border-top: 1px solid var(--border); white-space: nowrap; color: var(--text-secondary); }
.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: #060606; }
.table-empty { text-align: center; padding: 40px 16px !important; color: var(--text-tertiary); }

/* Badges */
.badge { display: inline-flex; padding: 2px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.badge-green { background: rgba(0,212,123,0.1); color: var(--green); }
.badge-red { background: rgba(255,71,71,0.1); color: var(--red); }
.badge-yellow { background: rgba(255,200,0,0.1); color: #ffc800; }
.badge-blue { background: rgba(100,160,255,0.1); color: #64a0ff; }
.badge-gray { background: rgba(255,255,255,0.04); color: var(--text-tertiary); }
.badge-cod { background: rgba(255,200,0,0.08); color: #ffc800; }
.badge-online { background: rgba(100,160,255,0.08); color: #64a0ff; }

/* Settings */
.settings-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; }
.settings-card-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.settings-card-desc { font-size: 12px; color: var(--text-tertiary); margin-bottom: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }

/* Charts */
.chart-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; overflow: hidden; }
.chart-header { margin-bottom: 14px; }
.chart-title { font-size: 12px; font-weight: 500; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.04em; }
.chart-canvas-wrap { height: 200px; position: relative; overflow: hidden; }
.charts-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.charts-row .chart-card { border: none; border-radius: 0; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-top: 1px solid var(--border); }
.pagination-info { font-size: 12px; color: var(--text-tertiary); }
.pagination-btns { display: flex; gap: 6px; }

/* Detail */
.detail-panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.detail-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.detail-body { padding: 20px; }
.detail-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-tertiary); font-weight: 500; font-size: 12px; }
.detail-value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-all; color: var(--text-secondary); }

/* Toast */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 6px; }
.toast { padding: 10px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; animation: slideIn 0.2s ease; border: 1px solid var(--border); }
.toast-success { background: #0a0a0a; color: var(--green); }
.toast-error { background: #0a0a0a; color: var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Code */
.code-block { background: #050505; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; color: #888; overflow-x: auto; white-space: pre-wrap; word-break: break-all; position: relative; }
.code-copy-btn { position: absolute; top: 6px; right: 6px; background: #111; border: 1px solid var(--border); color: var(--text-tertiary); padding: 3px 8px; border-radius: 3px; font-size: 10px; cursor: pointer; }
.code-copy-btn:hover { color: var(--text); }

/* Filters */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar .form-input, .filter-bar .form-select { width: auto; min-width: 160px; }
.search-input { flex: 1; min-width: 180px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #0a0a0a; border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 14px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Store Bars */
.store-bar { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.store-bar:last-child { border-bottom: none; }
.store-bar-name { font-size: 13px; font-weight: 500; min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-secondary); }
.store-bar-fill-wrap { flex: 1; height: 4px; background: rgba(255,255,255,0.04); border-radius: 2px; overflow: hidden; }
.store-bar-fill { height: 100%; background: #fff; border-radius: 2px; transition: width 0.5s ease; }
.store-bar-value { font-size: 12px; font-weight: 600; color: var(--text-secondary); min-width: 80px; text-align: right; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 20px; padding: 10px; }
.donut-chart { width: 100px; height: 100px; flex-shrink: 0; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.donut-legend-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.donut-legend-value { color: var(--text-tertiary); margin-left: auto; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; max-width: 100vw; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .mobile-menu-btn { display: flex; }
}
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 4px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.inline-form { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-form .form-group { flex: 1; min-width: 120px; }
