/* ===== CSS VARIABLES ===== */
:root {
    --bg: #0f172a;
    --bg2: #1e293b;
    --bg3: #263348;
    --card: #1e293b;
    --card-hover: #243044;
    --sidebar-bg: #0c1526;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --text: #f1f5f9;
    --text2: #94a3b8;
    --text3: #64748b;
    --accent: #6366f1;
    --accent2: #818cf8;
    --accent-bg: rgba(99,102,241,0.12);
    --green: #10b981;
    --green-bg: rgba(16,185,129,0.12);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245,158,11,0.12);
    --red: #ef4444;
    --red-bg: rgba(239,68,68,0.12);
    --blue: #3b82f6;
    --blue-bg: rgba(59,130,246,0.12);
    --border: rgba(148,163,184,0.08);
    --border2: rgba(148,163,184,0.15);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --radius: 14px;
    --radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --header-h: 64px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.w-full { width: 100%; }

/* ===== PIN SCREEN ===== */
.pin-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, #1a1f3a 0%, #0f172a 70%);
    z-index: 1000;
}
.pin-box {
    display: flex; flex-direction: column; align-items: center;
    padding: 40px 32px 36px;
    background: rgba(30,41,59,0.65);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border2);
    border-radius: 24px;
    width: 320px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.4);
    gap: 0;
}
.pin-logo {
    color: var(--accent);
    margin-bottom: 16px;
    width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-bg);
    border-radius: 20px;
}
.pin-title {
    font-size: 22px; font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #f1f5f9, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pin-subtitle {
    color: var(--text2);
    font-size: 13px;
    margin-bottom: 24px;
    text-align: center;
    min-height: 18px;
    line-height: 1.4;
    max-width: 240px;
}
.pin-dots {
    display: flex; gap: 16px; margin-bottom: 10px;
}
.pin-dot {
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    background: transparent;
    transition: all 0.15s ease;
}
.pin-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(99,102,241,0.55);
}
.pin-error {
    min-height: 22px;
    color: var(--red);
    font-size: 12px;
    text-align: center;
    margin-bottom: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    line-height: 1.5;
}
.pin-error.show { opacity: 1; }

/* PIN Input */
.pin-input {
    width: 100%;
    background: var(--bg3);
    border: 1.5px solid var(--border2);
    border-radius: 14px;
    color: var(--text);
    font-size: 28px;
    text-align: center;
    letter-spacing: 16px;
    padding: 14px 20px 14px 36px; /* letter-spacing offset */
    outline: none;
    transition: var(--transition);
    caret-color: var(--accent);
    -webkit-tap-highlight-color: transparent;
}
.pin-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
    background: var(--bg2);
}
.pin-input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pin-input::placeholder {
    color: var(--border2);
    letter-spacing: 10px;
    font-size: 20px;
}

@keyframes pinShake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-10px); }
    40%      { transform: translateX(10px); }
    60%      { transform: translateX(-6px); }
    80%      { transform: translateX(6px); }
}
.pin-box.shake { animation: pinShake 0.35s ease; }

/* ===== ADMIN PANEL LAYOUT ===== */
.admin-panel {
    display: flex; height: 100vh; overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 100;
    position: relative;
}
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
    min-width: var(--sidebar-collapsed);
}
.sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid var(--border);
    min-height: var(--header-h);
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    color: var(--accent);
    overflow: hidden;
}
.sidebar-title {
    font-size: 15px; font-weight: 700;
    white-space: nowrap;
    color: var(--text);
    transition: opacity 0.2s, width 0.3s;
}
.sidebar.collapsed .sidebar-title { opacity: 0; width: 0; }
.sidebar.collapsed .sidebar-logo { gap: 0; }
.toggle-btn {
    color: var(--text2);
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: var(--transition);
}
.toggle-btn:hover { color: var(--text); background: var(--bg3); }
.sidebar-nav {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    padding: 12px 8px;
    display: flex; flex-direction: column; gap: 2px;
}
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text2);
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active {
    color: var(--accent2);
    background: var(--accent-bg);
    font-weight: 600;
}
.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    stroke-width: 1.8;
}
.nav-label {
    font-size: 14px;
    transition: opacity 0.2s;
    overflow: hidden;
}
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px; }
.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.logout-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text3);
    transition: var(--transition);
    width: 100%;
    white-space: nowrap;
}
.logout-btn:hover { color: var(--red); background: var(--red-bg); }
.sidebar.collapsed .logout-btn { justify-content: center; padding: 11px; }
.sidebar.collapsed .logout-btn .nav-label { opacity: 0; width: 0; overflow: hidden; }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1; overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column;
    background: var(--bg);
}
.content-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px;
    height: var(--header-h);
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0;
    z-index: 10;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}
.page-title {
    font-size: 18px; font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--text2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mobile-menu-btn {
    display: none; color: var(--text2);
    padding: 6px; border-radius: 8px;
    transition: var(--transition);
}
.mobile-menu-btn:hover { color: var(--text); background: var(--bg3); }

/* ===== SECTIONS ===== */
.section {
    display: none; padding: 24px;
    flex: 1;
    animation: fadeIn 0.3s ease;
}
.section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== SECTION TOOLBAR ===== */
.section-toolbar {
    display: flex; gap: 12px; align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1; min-width: 180px;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 16px;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
.search-input::placeholder { color: var(--text3); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-secondary { background: var(--bg3); color: var(--text2); }
.btn-secondary:hover { background: var(--bg2); color: var(--text); }
.btn-success { background: var(--green-bg); color: var(--green); }
.btn-success:hover { background: rgba(16,185,129,0.25); }
.btn-icon { padding: 7px; }
.btn-icon svg { width: 15px; height: 15px; }

/* ===== CARDS GRID ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* ===== CARD ITEM ===== */
.card-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: var(--transition);
    position: relative;
}
.card-item:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.card-item-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 12px;
}
.card-item-title {
    font-size: 15px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}
.card-item-actions { display: flex; gap: 4px; }
.card-item-body { color: var(--text2); font-size: 14px; }
.card-item-field {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.card-item-field:last-child { border-bottom: none; }
.field-label { color: var(--text3); font-size: 12px; min-width: 60px; }
.field-value { flex: 1; font-family: 'Courier New', monospace; font-size: 13px; }
.field-reveal { color: var(--text3); cursor: pointer; padding: 2px; }
.field-reveal:hover { color: var(--accent2); }
.masked-value { letter-spacing: 2px; }
.card-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-humo { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-uzcard { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-visa { background: rgba(99,102,241,0.15); color: var(--accent2); }
.badge-mastercard { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-default { background: var(--bg3); color: var(--text2); }

/* ===== DASHBOARD ===== */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    transition: var(--transition);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.purple { background: var(--accent-bg); color: var(--accent2); }
.stat-icon.green { background: var(--green-bg); color: var(--green); }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { color: var(--text2); font-size: 13px; margin-top: 3px; }
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.dash-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.dash-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.dash-card-title { font-size: 15px; font-weight: 700; }
.dash-card-icon { display: flex; align-items: center; color: var(--text2); }
.dash-card-icon svg { width: 18px; height: 18px; }
.dash-card-body { padding: 16px 20px; }
.utility-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.utility-item:last-child { border-bottom: none; }
.utility-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.utility-icon svg { width: 18px; height: 18px; }
.utility-info { flex: 1; }
.utility-name { font-size: 14px; font-weight: 600; }
.utility-period { font-size: 12px; color: var(--text3); }
.utility-amount { text-align: right; }
.utility-debt { font-size: 15px; font-weight: 700; }
.debt-positive { color: var(--red); }
.debt-zero { color: var(--green); }
.utility-status {
    font-size: 11px; font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
    margin-top: 2px;
}
.status-paid { background: var(--green-bg); color: var(--green); }
.status-debt { background: var(--red-bg); color: var(--red); }
.acct-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.acct-item:last-child { border-bottom: none; }
.acct-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 7px;
}
.acct-name { font-size: 14px; font-weight: 600; }
.acct-amounts { font-size: 12px; color: var(--text2); }
.progress-bar {
    height: 6px;
    background: var(--bg3);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--accent);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.full { background: var(--green); }
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text3);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== CREDENTIAL CARD ===== */
.cred-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: var(--transition);
}
.cred-card:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.cred-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 10px;
}
.cred-comment {
    font-size: 15px; font-weight: 600;
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cred-field {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
    font-size: 14px;
}
.cred-label { color: var(--text3); font-size: 12px; min-width: 52px; }
.cred-val { flex: 1; font-family: 'Courier New', monospace; word-break: break-all; }
.cred-pass { cursor: pointer; display: flex; align-items: center; gap: 6px; }
.cred-pass-hidden { color: var(--text3); letter-spacing: 4px; }
.eye-btn {
    color: var(--text3); flex-shrink: 0;
    padding: 2px; border-radius: 4px;
    transition: var(--transition);
}
.eye-btn:hover { color: var(--accent2); }

/* ===== BANK CARD ===== */
.bank-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.bank-card::before {
    content: '';
    position: absolute;
    top: -50px; right: -30px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: rgba(99,102,241,0.08);
}
.bank-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.4); }
.bank-card-top {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px;
}
.bank-card-label {
    font-size: 16px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px;
}
.bank-card-actions { display: flex; gap: 4px; }
.bank-card-number {
    font-family: 'Courier New', monospace;
    font-size: 17px;
    letter-spacing: 2px;
    color: var(--text);
    margin-bottom: 16px;
    cursor: pointer;
    display: flex; gap: 10px;
}
.bank-card-number:hover { color: var(--accent2); }
.bank-card-footer {
    display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap;
}
.bank-card-info { }
.bank-card-info-label { font-size: 10px; text-transform: uppercase; color: var(--text3); letter-spacing: 1px; margin-bottom: 3px; }
.bank-card-info-val { font-size: 13px; font-family: 'Courier New', monospace; cursor: pointer; }
.balance-chip {
    margin-left: auto;
    background: var(--green-bg);
    color: var(--green);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex; align-items: center; gap: 5px;
}
.balance-chip:hover { opacity: 0.85; }
.balance-chip svg { width: 13px; height: 13px; flex-shrink: 0; }
.balance-chip-text { font-size: 12px; }
.balance-loader {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.balance-amount {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.balance-error {
    display: flex; align-items: center; gap: 4px;
    font-size: 11px;
    color: var(--danger);
}
.balance-error svg { width: 12px; height: 12px; flex-shrink: 0; }
.upload-ok-icon { display: inline-flex; align-items: center; vertical-align: middle; color: var(--green); }
.upload-ok-icon svg { width: 16px; height: 16px; }

/* ===== DOCUMENTS ===== */
.doc-list { display: flex; flex-direction: column; gap: 12px; }

.doc-folder-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.doc-folder-card:hover { border-color: var(--border2); }

.doc-folder-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.doc-folder-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b22, #f59e0b11);
    color: #f59e0b;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.doc-folder-meta { flex: 1; min-width: 0; }
.doc-folder-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-folder-info { font-size: 12px; color: var(--text3); margin-top: 2px; }
.doc-folder-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }

/* File rows inside folder */
.docfiles-list { padding: 8px 0; }
.docfile-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px;
    transition: background 0.15s;
}
.docfile-row:hover { background: var(--bg3); }
.docfile-icon { color: var(--text3); flex-shrink: 0; display: flex; align-items: center; }
.docfile-name {
    flex: 1; min-width: 0;
    font-size: 13px; font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.docfile-size { font-size: 11px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }
.docfile-actions { display: flex; gap: 5px; flex-shrink: 0; }
.docfile-empty { padding: 14px 16px; font-size: 13px; color: var(--text3); font-style: italic; }

/* Selected files list in modal */
.selected-files-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.sel-file-item {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg3);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
}
.sel-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sel-file-size { font-size: 11px; color: var(--text3); flex-shrink: 0; white-space: nowrap; }
.sel-file-remove {
    background: none; border: none; cursor: pointer; padding: 2px;
    color: var(--text3); display: flex; align-items: center;
    transition: color 0.15s;
}
.sel-file-remove:hover { color: #ef4444; }

/* btn-xs size */
.btn.btn-xs {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 6px;
    gap: 4px;
}

/* ===== BOTS ===== */
.bot-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}
.bot-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.bot-card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px;
}
.bot-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    color: white; font-weight: 700;
}
.bot-name { font-size: 16px; font-weight: 700; }
.bot-username { font-size: 13px; color: var(--accent2); }
.bot-stats {
    display: flex; gap: 12px;
    margin-bottom: 14px;
}
.bot-stat {
    flex: 1;
    background: var(--bg3);
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
}
.bot-stat-num { font-size: 20px; font-weight: 700; }
.bot-stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; }
.bot-actions { display: flex; gap: 8px; }
.bot-sync-time { font-size: 11px; color: var(--text3); margin-bottom: 10px; }
.track-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.track-on  { background: rgba(34,197,94,.12); color: #22c55e; }
.track-off { background: rgba(239,68,68,.10); color: #ef4444; }

/* ===== ACCOUNTING TABLE ===== */
.accounting-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.accounting-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}
.accounting-table th {
    background: var(--bg2);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
}
.accounting-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.accounting-table tr:last-child td { border-bottom: none; }
.accounting-table tr:hover td { background: var(--bg3); }
.percent-bar { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.percent-bar .progress-bar { flex: 1; }
.percent-text { font-size: 13px; font-weight: 600; min-width: 36px; }
.fully-paid-row td { opacity: 0.6; }
.fully-paid-badge {
    background: var(--green-bg); color: var(--green);
    font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    display: inline-block;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    z-index: 500;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow);
    animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
    color: var(--text3); padding: 6px;
    border-radius: 8px;
    transition: var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg3); }
.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text2);
    margin-bottom: 7px;
}
.form-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-input::placeholder { color: var(--text3); }
.form-select {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}
.form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.form-select option { background: var(--bg2); }
.form-actions {
    display: flex; gap: 10px;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
}
.form-actions .btn { flex: 1; justify-content: center; }

/* ===== FILE UPLOAD ===== */
.file-drop-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius-sm);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.file-drop-zone:hover, .file-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.file-drop-zone p { color: var(--text2); font-size: 14px; margin-top: 8px; }
.file-drop-zone span { color: var(--accent2); font-weight: 600; }
.file-selected {
    background: var(--green-bg);
    border-color: var(--green);
}
.file-selected p { color: var(--green); }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px; font-weight: 500;
    z-index: 9999;
    max-width: 340px;
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}
.toast.success { background: rgba(16,185,129,0.9); color: white; }
.toast.error { background: rgba(239,68,68,0.9); color: white; }
.toast.info { background: rgba(99,102,241,0.9); color: white; }
@keyframes toastIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== LOADING ===== */
.page-loading {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
}
.loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}
.sidebar-overlay.show { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        width: var(--sidebar-width) !important;
        min-width: var(--sidebar-width) !important;
        z-index: 100;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .sidebar .sidebar-title { opacity: 1 !important; width: auto !important; }
    .sidebar .nav-label { opacity: 1 !important; width: auto !important; overflow: visible !important; }
    .sidebar .logout-btn .nav-label { opacity: 1 !important; width: auto !important; }
    .sidebar .nav-item { justify-content: flex-start !important; padding: 11px 12px !important; }
    .sidebar .logout-btn { justify-content: flex-start !important; padding: 11px 12px !important; }
    .mobile-menu-btn { display: flex; }
    .main-content { width: 100%; }
    .section { padding: 16px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .cards-grid { grid-template-columns: 1fr; }
    .content-header { padding: 0 16px; }
    .toast { bottom: 16px; right: 16px; left: 16px; max-width: none; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .pin-box { padding: 32px 20px 28px; }
    .pin-input { font-size: 24px; letter-spacing: 14px; padding: 12px 16px 12px 30px; }
}

/* ===== TELEGRAM ONLY SCREEN ===== */
.tg-only-screen {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #17212b;
    z-index: 2000;
    padding: 20px;
}
.tg-only-card {
    background: #1e2c3a;
    border-radius: 20px;
    padding: 40px 32px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.tg-only-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: #2b5278;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: #5aabef;
    box-shadow: 0 0 0 8px rgba(90,171,239,0.1);
}
.tg-only-title {
    font-size: 20px;
    font-weight: 700;
    color: #e8f4ff;
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}
.tg-only-desc {
    font-size: 14px;
    line-height: 1.6;
    color: #8baabf;
    margin-bottom: 20px;
}
.tg-only-hint {
    font-size: 12px;
    color: #5a7a8f;
    line-height: 1.5;
    border-top: 1px solid rgba(90,171,239,0.1);
    padding-top: 16px;
    margin-top: 0;
}

/* ===== MISC ===== */
.section-title {
    font-size: 13px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text3);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent2); }
.inline-loader {
    display: inline-flex; align-items: center;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
.num-format { font-feature-settings: "tnum"; }
.confirm-dialog { text-align: center; padding: 8px 0; }
.confirm-dialog p { color: var(--text2); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; justify-content: center; }
