/* Gonona Admin Dashboard - White + Blue */

:root {
    --bg: #f0f4f8;
    --surface: #ffffff;
    --surface2: #e8eef4;
    --text: #1e293b;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --income: #16a34a;
    --expense: #dc2626;
    --border: #e2e8f0;
    --radius: 8px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; transition: background 0.2s, color 0.2s; }

/* Dark mode */
body.dark-mode { --bg: #0f172a; --surface: #1e293b; --surface2: #334155; --text: #f1f5f9; --text-muted: #94a3b8; --border: #334155; }
body.dark-mode .stat-card { background: var(--surface); border-color: var(--accent); }
body.dark-mode .stat-card.highlight { background: var(--surface); }
body.dark-mode .stat-card.income { background: var(--surface); }
body.dark-mode .stat-card.expense { background: var(--surface); }
body.dark-mode .card { background: var(--surface); border-color: var(--accent); }
body.dark-mode .sidebar-nav a.active { background: rgba(37,99,235,0.25); }
body.dark-mode .alert-success { background: rgba(22,163,74,0.2); color: #4ade80; border-color: rgba(22,163,74,0.4); }
body.dark-mode .alert-error { background: rgba(220,38,38,0.2); color: #f87171; border-color: rgba(220,38,38,0.4); }
body.dark-mode .login-box { background: var(--surface); border-color: var(--border); }
body.dark-mode .detail-box { background: var(--surface); border-color: var(--border); }
body.dark-mode .detail-box-title { background: var(--surface2); border-color: var(--border); }
body.dark-mode .detail-row { border-color: var(--border); }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: var(--bg); }
.login-box { background: var(--surface); padding: 2rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(37,99,235,0.08); max-width: 380px; width: 100%; }
.login-box h1 { margin: 0 0 0.25rem; font-size: 1.5rem; color: var(--accent); text-align: center; }
.login-box .subtitle { color: var(--text-muted); margin: 0 0 1.5rem; font-size: 0.9rem; }
.login-form label { display: block; margin-top: 1rem; margin-bottom: 0.35rem; font-size: 0.9rem; }
.login-form input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 1rem; }
.login-form input:focus { outline: none; border-color: var(--accent); }
.login-form .password-wrap { margin-bottom: 0.25rem; }
.login-form .show-pass-label { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; margin-bottom: 0; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; font-weight: normal; }
.login-form .show-pass-label input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.login-form button { width: 100%; margin-top: 1.25rem; padding: 0.7rem; background: var(--accent); color: #fff; border: none; border-radius: 6px; font-size: 1rem; cursor: pointer; }
.login-form button:hover { background: var(--accent-hover); }
.login-box .hint { margin-top: 1rem; font-size: 0.8rem; color: var(--text-muted); }
.alert { padding: 0.6rem 0.75rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.login-box .setup-link { margin-top: 0.5rem; font-size: 0.85rem; }
.login-box .setup-link a { color: var(--accent); }

/* Dashboard + Sidebar */
.dashboard { min-height: 100vh; display: flex; }
.sidebar { width: 240px; min-height: 100vh; background: var(--surface); border-right: 1px solid var(--border); flex-shrink: 0; padding: 0 0 1rem 0; box-shadow: 2px 0 8px rgba(0,0,0,0.04); }
.sidebar-brand { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; font-weight: 700; font-size: 1.2rem; color: var(--accent); padding: 0; margin: 0; gap: 0.15rem; }
.sidebar-logo { height: 80px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand .sidebar-sub { font-size: 0.8rem; color: var(--text-muted); padding: 0; margin: 0; line-height: 1.2; font-weight: 700; text-align: center; }
.sidebar-options { display: flex; align-items: center; justify-content: space-between; padding: 0.25rem 1.25rem 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.lang-switch { font-size: 0.85rem; }
.lang-switch a { color: var(--text-muted); text-decoration: none; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch a.active { color: var(--accent); font-weight: 600; }
.lang-switch .sep { color: var(--border); margin: 0 0.25rem; }
.dark-toggle { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.5rem; cursor: pointer; font-size: 1rem; }
.dark-toggle:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.25rem; padding: 0 0.75rem; }
.sidebar-nav a { display: block; padding: 0.65rem 1rem; color: var(--text-muted); text-decoration: none; border-radius: var(--radius); font-size: 0.95rem; transition: background 0.15s, color 0.15s; }
.sidebar-nav a:hover { background: var(--surface2); color: var(--accent); text-decoration: none; }
.sidebar-nav a.active { background: #eff6ff; color: var(--accent); font-weight: 600; text-decoration: none; }
.sidebar-nav .sidebar-logout { margin-top: 0.5rem; padding-top: 0.75rem; border-top: 1px solid var(--border); color: var(--expense); }
.sidebar-nav .sidebar-logout:hover { background: #fee2e2; color: var(--expense); }
.dashboard-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: center; padding: 0.75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; position: relative; }
.topbar-title { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text); text-align: center; }
.topbar-cart { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.4rem 0.75rem; background: var(--accent); color: #fff; border-radius: var(--radius); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.topbar-cart:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.dashboard-main { flex: 1; padding: 1.5rem; max-width: 1200px; width: 100%; }
.dashboard-footer { padding: 0.75rem 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); background: var(--surface); }
.sidebar-toggle { display: none; border: none; background: var(--accent); color: #fff; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; position: fixed; top: 1rem; left: 1rem; z-index: 101; }
.sidebar-toggle::before { content: ''; display: block; width: 20px; height: 2px; background: currentColor; margin: 8px auto 4px; box-shadow: 0 5px 0 currentColor, 0 10px 0 currentColor; }
.sidebar-overlay { display: none; }
@media (max-width: 768px) {
    .sidebar { width: 220px; position: fixed; left: 0; top: 0; z-index: 100; transform: translateX(-100%); transition: transform 0.2s; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
    body.sidebar-open .sidebar-overlay { opacity: 1; pointer-events: auto; }
    .sidebar-toggle { display: block; }
    .dashboard-main { padding: 1rem; padding-top: 3.5rem; }
}

.lead { color: var(--text-muted); margin: 0 0 1.25rem; }
.breadcrumb { margin-bottom: 0.75rem; font-size: 0.9rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }

/* Stats - প্রতিটি কার্ডের মাঝে দাগ (সেপারেটর) */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin-bottom: 1.5rem; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.stats-grid .stat-card { background: #ffffff; border: none; border-radius: 0; border-right: 2px solid var(--border); padding: 1.25rem; margin: 0; }
.stats-grid .stat-card:last-child { border-right: none; }
@media (max-width: 768px) { .stats-grid .stat-card { border-right: none; border-bottom: 2px solid var(--border); } .stats-grid .stat-card:last-child { border-bottom: none; } }
@media (min-width: 769px) and (max-width: 900px) { .stats-grid .stat-card:nth-child(2n) { border-right: none; } }
.stat-card.highlight { border-color: var(--accent); background: #ffffff; }
.stat-card.highlight .stat-value { color: var(--accent); }
.stat-card.income { border-color: var(--accent); background: #ffffff; }
.stat-card.expense { border-color: var(--accent); background: #ffffff; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* ইউজার গ্রোথ চার্ট - গ্রাফিক প্যাটার্ন */
.growth-pattern { margin-bottom: 1.5rem; }
.growth-pattern .growth-lead { color: var(--text-muted); font-size: 0.9rem; margin: -0.5rem 0 1rem; }
.growth-empty { color: var(--text-muted); margin: 0; }
.growth-chart { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 140px; padding: 0.5rem 0; }
.growth-bar-wrap { flex: 1; min-width: 28px; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.growth-bar { width: 100%; max-width: 36px; min-height: 4px; background: var(--accent); border-radius: 4px 4px 0 0; transition: height 0.3s; }
.growth-bar-wrap:hover .growth-bar { opacity: 0.9; filter: brightness(1.1); }
.growth-label { font-size: 0.7rem; color: var(--text-muted); }
.growth-value { font-size: 0.75rem; font-weight: 600; color: var(--accent); }

/* Cards & Tables - বর্ডার নীল ০.৫, ব্যাকগ্রাউন্ড সাদা */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.card.full-width { grid-column: 1 / -1; }
.card { background: #ffffff; border: 0.5px solid var(--accent); border-radius: var(--radius); padding: 1.25rem; }
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.85rem; }
tbody tr:hover { background: var(--surface2); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.info-table th { width: 120px; color: var(--text-muted); }

.badge { display: inline-block; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.8rem; }
.badge-income { background: #dcfce7; color: #166534; }
.badge-expense { background: #fee2e2; color: #b91c1c; }
.badge-adjustment { background: #dbeafe; color: var(--accent); }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-blocked { background: #fee2e2; color: #b91c1c; }

.btn { display: inline-block; padding: 0.5rem 1rem; background: var(--accent); color: #fff; border-radius: 6px; text-decoration: none; font-size: 0.9rem; border: none; cursor: pointer; }
.btn:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }

/* Forms */
.card label { display: block; margin-top: 0.75rem; margin-bottom: 0.25rem; font-size: 0.9rem; }
.card input[type="text"],
.card input[type="email"],
.card input[type="number"],
.card select,
.card textarea { width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 1rem; }
.card input:focus, .card select:focus, .card textarea:focus { outline: none; border-color: var(--accent); }
.card textarea { min-height: 60px; resize: vertical; }

/* User Detail - নাম বক্সের মতো আলাদা আলাদা বক্স; প্রতিটা বক্সের মাঝে দাগ */
.detail-box { background: #fff; border: 0.7px solid var(--border); border-radius: var(--radius); margin-bottom: 1rem; overflow: hidden; border-top: 2px solid var(--border); }
.detail-box:first-of-type { border-top: none; }
.detail-box-title { background: var(--surface2); padding: 0.6rem 1rem; font-weight: 600; font-size: 0.95rem; color: var(--text); border-bottom: 0.7px solid var(--border); border-left: 4px solid var(--accent); }
.detail-box-body { padding: 1rem; }
.detail-row { display: flex; gap: 1rem; padding: 0.4rem 0; border-bottom: 0.7px solid var(--border); align-items: flex-start; }
.detail-row:last-child { border-bottom: none; }
.detail-label { flex: 0 0 110px; font-size: 0.9rem; color: var(--text-muted); }
.detail-value { flex: 1; font-size: 0.95rem; }
.detail-balance { font-size: 1.5rem; font-weight: 700; color: var(--accent); padding: 0.5rem 0; }
.detail-reset-form { margin-bottom: 1rem; }
.detail-reset-form .detail-value { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.detail-input { padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; max-width: 180px; }
.detail-reset-form .show-pass-inline { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; font-weight: normal; margin: 0; }
.detail-reset-form .show-pass-inline input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn-action { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.9rem; text-decoration: none; font-weight: 500; transition: opacity 0.2s; }
.btn-action:hover { text-decoration: none; opacity: 0.9; }
.btn-edit { background: var(--accent); color: #fff; border: none; }
.btn-edit:hover { color: #fff; }
.btn-block { background: #f59e0b; color: #fff; }
.btn-block:hover { color: #fff; }
.btn-unblock { background: #16a34a; color: #fff; }
.btn-unblock:hover { color: #fff; }
.btn-delete { background: var(--expense); color: #fff; }
.btn-delete:hover { color: #fff; }
.profile-table { margin: 0; }
.profile-table .amount-cell { font-weight: 600; }
.empty-state { margin: 0; color: var(--text-muted); padding: 1rem 0; }
.actions-cell { white-space: nowrap; }
.actions-cell .btn-sm { margin: 0 0.15rem 0.15rem 0; }
.btn-block-sm { background: #f59e0b; color: #fff; }
.btn-block-sm:hover { color: #fff; }
.btn-unblock-sm { background: #16a34a; color: #fff; }
.btn-unblock-sm:hover { color: #fff; }
tbody tr.row-blocked { opacity: 0.85; }

/* API Key page */
.api-key-box { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.25rem; }
.api-key-box code { flex: 1; min-width: 200px; padding: 0.5rem 0.65rem; background: var(--surface2); border-radius: 6px; font-size: 0.9rem; word-break: break-all; }
.api-instruction { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
