@import url('https://aione.ge/fonts/fonts.css');

:root {
    --bg: #FFF5EE;
    --panel: #ffffff;
    --panel-border: rgba(0,0,0,.06);
    --text: #1a1a2e;
    --muted: #6b7280;
    --primary: #F26522;
    --primary-hover: #d4551a;
    --primary-light: rgba(242,101,34,.1);
    --ok: #10b981;
    --ok-light: rgba(16,185,129,.1);
    --danger: #ef4444;
    --danger-light: rgba(239,68,68,.1);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow-card: 0 2px 12px rgba(0,0,0,.06);
    --shadow-lg: 0 4px 24px rgba(0,0,0,.08);
    --font-main: 'BPG Nino Mtavruli', 'BPG Nino Mtavruli Normal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-alt: 'GF Alaverdi', 'GF Alaverdi Nus', -apple-system, sans-serif;
    --transition: .2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { overflow-x: hidden; }

body {
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
    width: 100%;
}

body.theme-light {
    --bg: #FFF5EE;
    --panel: #ffffff;
    --panel-border: rgba(0,0,0,.06);
    --text: #1a1a2e;
    --muted: #6b7280;
    --primary: #F26522;
    --primary-hover: #d4551a;
}

body.theme-dark {
    --bg: #0f0f14;
    --panel: #1a1a24;
    --panel-border: rgba(255,255,255,.08);
    --text: #f0f0f5;
    --muted: #9ca3af;
    --primary: #F26522;
    --primary-hover: #ff7a3d;
    --ok: #34d399;
    --danger: #f87171;
    --shadow-card: 0 2px 12px rgba(0,0,0,.3);
}

/* ================================================================
   LAYOUT
   ================================================================ */

.shell {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    overflow-x: hidden;
}

body.app-shell .shell {
    padding-top: 68px;
    padding-bottom: 80px;
}

/* ================================================================
   TOP BAR (BOG header style)
   ================================================================ */

.app-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg);
    gap: 8px;
}

.top-user-block {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.top-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.top-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

.top-user-meta {
    min-width: 0;
    overflow: hidden;
}

.top-user-meta strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.top-user-meta .muted { font-size: 11px; }

.top-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.app-topbar .top-actions {
    width: auto;
    flex-wrap: nowrap;
}

/* ================================================================
   BOTTOM NAVIGATION (BOG tab style)
   ================================================================ */

.app-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1200;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px 10px;
    background: var(--panel);
    border-top: 1px solid var(--panel-border);
    box-shadow: 0 -2px 16px rgba(0,0,0,.04);
}

.bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: color var(--transition);
    border: none;
    background: none;
    cursor: pointer;
}

.bottom-tab i { font-size: 20px; }

.bottom-tab.active,
.bottom-tab:hover {
    color: var(--primary);
}

.bottom-tab-center {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-top: -24px;
    box-shadow: 0 4px 16px rgba(242,101,34,.3);
    border: 3px solid var(--bg);
}

.bottom-tab-center:hover { color: #fff; }

/* ================================================================
   HERO / PAGE HEADERS
   ================================================================ */

.hero {
    text-align: left;
    margin-bottom: 20px;
    padding: 4px 0;
}

.hero h1 {
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-alt);
    margin-bottom: 4px;
}

.hero p {
    color: var(--muted);
    font-size: 13px;
    font-family: var(--font-alt);
    line-height: 1.5;
}

/* ================================================================
   CARDS (BOG rounded white card style)
   ================================================================ */

.card {
    background: var(--panel);
    border: none;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
}

.card h2, .card h3 { margin-top: 0; }

/* ================================================================
   KPI / STATS (BOG balance/portfolio style)
   ================================================================ */

.kpi {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.kpi .item {
    background: var(--panel);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    box-shadow: var(--shadow-card);
    text-align: center;
    overflow: hidden;
}

.kpi .label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi .value {
    font-size: 18px;
    font-weight: 800;
    margin-top: 2px;
    color: var(--text);
}

/* ================================================================
   CATEGORY GRID (BOG home categories)
   ================================================================ */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
    padding: 14px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
}

.category-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform var(--transition);
}

.category-icon:hover { transform: scale(1.08); }

.category-icon.#0000FF { background: var(--primary-light); color: var(--primary); }
.category-icon.green { background: var(--ok-light); color: var(--ok); }
.category-icon.red { background: var(--danger-light); color: var(--danger); }
.category-icon.blue { background: rgba(59,130,246,.1); color: #3b82f6; }
.category-icon.purple { background: rgba(139,92,246,.1); color: #8b5cf6; }
.category-icon.teal { background: rgba(20,184,166,.1); color: #14b8a6; }

.category-label {
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: var(--text);
}

/* ================================================================
   FORMS & INPUTS (BOG rounded input style)
   ================================================================ */

label {
    display: block;
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-card {
    max-width: 400px;
    margin: 24px auto;
    padding: 24px;
}

/* ================================================================
   BUTTONS (BOG rounded style)
   ================================================================ */

.btn {
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(242,101,34,.25);
}

.btn-secondary {
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-card);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 15px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* ================================================================
   ALERTS (BOG product card style notifications)
   ================================================================ */

.alert {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
}

.alert-error {
    background: var(--danger-light);
    border: 1px solid rgba(239,68,68,.2);
    color: var(--danger);
}

.alert-ok {
    background: var(--ok-light);
    border: 1px solid rgba(16,185,129,.2);
    color: #047857;
}

/* ================================================================
   PROJECT LIST (BOG transaction/product list)
   ================================================================ */

.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--panel);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    width: 100%;
}

.project-card-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.project-card-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.project-card-title {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ================================================================
   TASK LIST (BOG transaction list style)
   ================================================================ */

.task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--panel);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    width: 100%;
}

.task-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.task-icon.pending { background: rgba(148,163,184,.15); color: #64748b; }
.task-icon.progress { background: rgba(59,130,246,.12); color: #2563eb; }
.task-icon.done { background: var(--ok-light); color: var(--ok); }
.task-icon.failed { background: var(--danger-light); color: var(--danger); }

.task-body {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.task-title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.task-meta {
    font-size: 11px;
    color: var(--muted);
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.task-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.task-actions .icon-btn {
    width: 30px; min-width: 30px; height: 30px;
    font-size: 12px;
}

/* ================================================================
   STATUS PILLS
   ================================================================ */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.status-pending { background: rgba(148,163,184,.15); color: #475569; }
.status-progress { background: rgba(59,130,246,.12); color: #1d4ed8; }
.status-done { background: var(--ok-light); color: #047857; }
.status-failed { background: var(--danger-light); color: #b91c1c; }
.status-unknown { background: rgba(100,116,139,.1); color: #475569; }

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9px;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.source-app { background: rgba(59,130,246,.1); color: #2563eb; }
.source-cursor { background: rgba(139,92,246,.1); color: #7c3aed; }
.source-chat { background: var(--ok-light); color: #047857; }

/* ================================================================
   SECTION HEADERS
   ================================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 2px;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
}

.section-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

/* ================================================================
   NOTIFICATIONS
   ================================================================ */

.notifications { position: relative; }
.notifications-toggle { position: relative; }

.notification-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid var(--bg);
}

.notifications-menu {
    position: fixed;
    right: 10px;
    top: 56px;
    width: min(320px, 90vw);
    max-height: 380px;
    overflow: auto;
    display: none;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 10px;
    z-index: 1300;
    box-shadow: var(--shadow-lg);
}

.notifications-menu.is-open { display: block; }

.notification-empty {
    padding: 12px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.notification-item-form { margin: 0; }

.notification-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--bg);
    color: var(--text);
    border: none;
    border-radius: var(--radius-xs);
    padding: 10px 12px;
    margin-bottom: 6px;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition);
}

.notification-item:hover { background: var(--primary-light); }

.notification-title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
}

.notification-meta {
    color: var(--muted);
    font-size: 11px;
}

/* ================================================================
   TOPBAR / SECTION STYLE
   ================================================================ */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* ================================================================
   MODALS (BOG rounded overlay)
   ================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    z-index: 9999;
}

.modal-overlay.is-open { display: flex; }

.modal {
    width: 100%;
    max-width: 480px;
    background: var(--panel);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 20px;
    max-height: 90vh;
    overflow: auto;
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal h3 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 800;
}

.modal .actions { justify-content: flex-end; }

/* ================================================================
   SEARCH BAR
   ================================================================ */

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.search-bar input {
    flex: 1;
    background: var(--panel);
    border: none;
    box-shadow: var(--shadow-card);
}

/* ================================================================
   TABLES (fallback for project table)
   ================================================================ */

.projects-table {
    width: 100%;
    border-collapse: collapse;
}

.projects-table th {
    text-align: left;
    padding: 10px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 1px solid var(--panel-border);
}

.projects-table td {
    padding: 10px;
    border-bottom: 1px solid var(--panel-border);
    font-size: 13px;
}

/* ================================================================
   TASK META NOTES
   ================================================================ */

.task-meta-note {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.35;
}

.live-indicator {
    margin: 8px 0;
    font-size: 12px;
    color: var(--muted);
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-xs);
}

.live-indicator strong { color: var(--primary); }

/* ================================================================
   MUTED & LINKS
   ================================================================ */

.muted { color: var(--muted); }

a {
    color: var(--text);
    text-decoration: none;
}

a:hover { color: var(--primary); }

code {
    background: rgba(0,0,0,.05);
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 12px;
}

/* ================================================================
   BALANCE CARD (BOG investment style)
   ================================================================ */

.balance-card {
    background: linear-gradient(135deg, var(--primary), #e8450e);
    color: #fff;
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(242,101,34,.25);
    overflow: hidden;
    width: 100%;
}

.balance-label {
    font-size: 12px;
    opacity: .85;
    margin-bottom: 4px;
    font-weight: 600;
}

.balance-amount {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.balance-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.2);
}

/* ================================================================
   PERIOD SELECTOR (BOG chart period tabs)
   ================================================================ */

.period-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,.04);
    border-radius: 999px;
    padding: 3px;
    margin-bottom: 14px;
}

.period-tab {
    flex: 1;
    padding: 8px 4px;
    border-radius: 999px;
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.period-tab.active {
    background: var(--panel);
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ================================================================
   PRODUCT CARD (BOG deposit/loan style)
   ================================================================ */

.product-card {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--primary);
}

.product-card-title {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
}

.product-card-detail {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.product-card-rate {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
}

/* ================================================================
   RESPONSIVE (mobile-first, BOG-like)
   ================================================================ */

@media (max-width: 768px) {
    .shell { padding: 10px; }
    body.app-shell .shell { padding: 10px; padding-top: 56px; padding-bottom: 74px; }
    .app-topbar { padding: 8px 12px; }
    .top-user-meta strong { max-width: 120px; font-size: 13px; }
    .top-avatar, .top-avatar-fallback { width: 32px; height: 32px; font-size: 13px; }
    .icon-btn { width: 34px; min-width: 34px; height: 34px; font-size: 14px; }
    .category-grid { gap: 8px; padding: 10px; }
    .category-icon { width: 48px; height: 48px; font-size: 18px; }
    .category-label { font-size: 10px; }
    .kpi .value { font-size: 16px; }
    .balance-amount { font-size: 24px; }
    .bottom-tab { font-size: 9px; }
    .bottom-tab i { font-size: 18px; }
    .bottom-tab-center { width: 46px; height: 46px; font-size: 20px; margin-top: -20px; }

    .projects-table { min-width: 100% !important; border: 0; }
    .projects-table thead { display: none; }
    .projects-table tr {
        display: block; margin-bottom: 8px;
        background: var(--panel); border-radius: var(--radius-sm);
        box-shadow: var(--shadow-card); overflow: hidden;
    }
    .projects-table td {
        display: flex; justify-content: space-between; gap: 8px;
        width: 100%; border-bottom: 1px solid var(--panel-border) !important;
        padding: 8px 12px; font-size: 12px;
    }
    .projects-table td:last-child { border-bottom: 0 !important; }
    .projects-table td::before {
        content: attr(data-label); color: var(--muted);
        font-weight: 600; min-width: 70px; font-size: 11px;
    }
    .modal { width: 100%; max-height: 88vh; overflow: auto; }
}

/* ================================================================
   STATISTICS SECTION  
   ================================================================ */

.statistics {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
}

.statistics h2 {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
}

.statistics .item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--panel-border);
}

.statistics .item:last-child { border-bottom: none; }
