/* Shared styles for all eRoamify pages — mobile-first */
:root {
    --bg: #0a0e1a;
    --bg2: #111827;
    --bg3: #1a2235;
    --accent: #00e676;
    --accent2: #00c853;
    --accent-dim: rgba(0,230,118,0.15);
    --gold: #ffd740;
    --text: #e8eaf6;
    --text2: #9fa8bc;
    --red: #ff5252;
    --blue: #448aff;
    --orange: #ffab40;
    --border: rgba(255,255,255,0.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    -webkit-text-size-adjust: 100%;
}

.data-warning {
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255,215,64,0.22);
    border-radius: 12px;
    background: rgba(255,215,64,0.08);
    color: var(--text2);
    font-size: 13px;
}
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

/* === NAV — mobile-first hamburger === */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,14,26,0.95);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
}
@media (min-width: 768px) { .top-nav { padding: 0 24px; } }
.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-left: -2px;
}
@media (min-width: 900px) { .nav-logo { margin-left: 18px; } }
.nav-logo img {
    width: 30px;
    height: 30px;
}
.nav-logo span {
    font-weight: 800;
    font-size: 15px;
    color: var(--accent);
    white-space: nowrap;
}
@media (min-width: 768px) {
    .nav-logo img { width: 34px; height: 34px; }
    .nav-logo span { font-size: 17px; }
}

/* Hamburger toggle */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.nav-toggle:hover { background: var(--bg3); }
.nav-toggle .bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) { .nav-toggle { display: none; } }

/* Nav links — mobile: fullscreen overlay; desktop: inline row */
.nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    height: calc(100vh - 56px);
    background: rgba(10,14,26,0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 16px 20px 32px;
    gap: 2px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 200;
}
.nav-links.open { display: flex; }
.nav-links a {
    color: var(--text2);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 14px 16px;
    border-radius: 12px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links a:hover,
.nav-links a:active { background: var(--bg3); color: var(--text); }
.nav-links a.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.nav-links .nav-sep {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}
.nav-links .nav-logout {
    color: var(--red);
    margin-top: auto;
}

/* Desktop: inline row */
@media (min-width: 900px) {
    .nav-links {
        display: flex;
        position: static;
        background: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        flex-direction: row;
        padding: 0;
        gap: 2px;
        overflow-y: visible;
        flex-shrink: 0;
        margin-right: 10px;
        height: auto;
        inset: unset;
    }
    .nav-links a {
        font-size: 13px;
        padding: 8px 14px;
        border-radius: 8px;
    }
    .nav-links .nav-sep { display: none; }
    .nav-links .nav-logout { margin-top: 0; margin-left: auto; }
    .nav-section-label { display: none; }
}

/* Nav section labels (mobile only) */
.nav-links .nav-section-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text2);
    padding: 12px 16px 3px;
    margin-top: 4px;
    opacity: 0.7;
}
/* First label = Инвестору — highlight in gold on mobile */
.nav-links .nav-section-label:first-child {
    color: var(--gold);
    opacity: 0.85;
    margin-top: 0;
    padding-top: 8px;
}

/* Shared button styles (used by investor pages + any page) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s;
    cursor: pointer;
    border: none;
}
.btn:hover { opacity: 0.82; }
.btn-gold { background: var(--gold); color: #0a0e1a; }
.btn-green { background: var(--accent); color: #0a0e1a; }
.btn-outline { border: 1px solid var(--border); color: var(--text2); background: transparent; }

/* Shared bottom journey CTA */
.cta-bar {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 36px 0 44px;
}
.cta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}
@media (min-width: 900px) {
    .cta-row { grid-template-columns: minmax(0, 1.4fr) auto; }
}
.cta-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 8px;
}
.cta-row h3 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}
.cta-row p {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.7;
    max-width: 560px;
}
.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* === DOCUMENT HERO === */
.doc-hero {
    padding: 44px 0 34px;
    background:
        radial-gradient(circle at top left, rgba(68,138,255,0.16), transparent 34%),
        radial-gradient(circle at top right, rgba(0,230,118,0.12), transparent 30%),
        linear-gradient(180deg, #0f1730 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}
@media (min-width: 768px) {
    .doc-hero { padding: 70px 0 52px; }
}
.doc-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
@media (min-width: 1100px) {
    .doc-hero-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr); }
}
.doc-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0,230,118,0.2);
    background: rgba(0,230,118,0.08);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.doc-hero-title {
    font-size: 30px;
    line-height: 1.14;
    font-weight: 800;
    max-width: 920px;
    margin-bottom: 14px;
}
@media (min-width: 768px) {
    .doc-hero-title { font-size: 46px; }
}
.doc-hero-sub {
    max-width: 840px;
    color: var(--text2);
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 18px;
}
@media (min-width: 768px) {
    .doc-hero-sub { font-size: 18px; }
}
.doc-hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.doc-hero-meta span,
.doc-hero-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 12px;
    text-decoration: none;
}
.doc-hero-meta a:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.16);
}
.doc-sidecard {
    background: linear-gradient(135deg, rgba(0,230,118,0.08), rgba(68,138,255,0.08));
    border: 1px solid rgba(0,230,118,0.18);
    border-radius: 18px;
    padding: 20px;
    min-width: 0;
}
@media (min-width: 768px) {
    .doc-sidecard { padding: 24px; }
}
.doc-sidecard h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 10px;
}
.doc-sidecard p {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.75;
    margin-bottom: 12px;
}
.doc-sidecard p:last-child {
    margin-bottom: 0;
}

/* === PAGE HEADER === */
.page-header {
    position: relative;
    overflow: hidden;
    padding: 28px 20px 24px;
    margin: 20px 0 24px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(circle at top left, rgba(68,138,255,0.16), transparent 34%),
        radial-gradient(circle at top right, rgba(0,230,118,0.12), transparent 30%),
        linear-gradient(180deg, #0f1730 0%, rgba(17,24,39,0.98) 100%);
    box-shadow: 0 22px 50px rgba(0,0,0,0.2);
}
@media (min-width: 768px) { .page-header { padding: 40px 34px 32px; margin: 28px 0 32px; } }
.page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), transparent 42%);
}
.page-header > * {
    position: relative;
    z-index: 1;
}
.page-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0,230,118,0.2);
    background: rgba(0,230,118,0.08);
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.14;
    max-width: 920px;
    margin-bottom: 8px;
}
@media (min-width: 768px) { .page-header h1 { font-size: 42px; margin-bottom: 10px; } }
.page-header p {
    max-width: 860px;
    font-size: 14px;
    color: var(--text2);
    line-height: 1.75;
    margin-top: 10px;
}
@media (min-width: 768px) { .page-header p { font-size: 16px; } }
.page-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.page-meta span,
.page-meta a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text2);
    font-size: 12px;
    text-decoration: none;
}
.page-meta a:hover {
    color: var(--text);
    border-color: rgba(255,255,255,0.16);
}
.page-header .fine-print {
    font-size: 12px;
    opacity: 0.78;
}

/* === DOCUMENT SECTIONS === */
.doc-section {
    padding: 34px 0;
    border-top: 1px solid var(--border);
}
.doc-section:first-of-type {
    border-top: none;
    padding-top: 0;
}
@media (min-width: 768px) {
    .doc-section { padding: 50px 0; }
}
.doc-section-head {
    max-width: 920px;
    margin-bottom: 22px;
}
.doc-section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}
.doc-section-sub {
    color: var(--text2);
    font-size: 14px;
    line-height: 1.75;
}
@media (min-width: 768px) {
    .doc-section-title { font-size: 32px; }
    .doc-section-sub { font-size: 15px; }
}
.doc-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    min-width: 0;
}
@media (min-width: 768px) {
    .doc-card { padding: 24px; }
}
.doc-grid-2,
.doc-grid-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}
@media (min-width: 900px) {
    .doc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .doc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* === METRIC CARDS === */
.metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 768px) { .metrics { grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 36px; } }
.metric-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)), var(--bg2);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px 12px;
    text-align: center;
}
@media (min-width: 768px) { .metric-card { padding: 24px; border-radius: 16px; } }
.metric-value { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 4px; }
@media (min-width: 768px) { .metric-value { font-size: 36px; margin-bottom: 6px; } }
.metric-value.gold { color: var(--gold); }
.metric-value.red { color: var(--red); }
.metric-value.blue { color: var(--blue); }
.metric-label { font-size: 11px; color: var(--text2); font-weight: 500; }
@media (min-width: 768px) { .metric-label { font-size: 13px; } }

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
@media (min-width: 768px) { .filter-bar { gap: 12px; margin-bottom: 20px; } }
.filter-bar input, .filter-bar select {
    background: rgba(17,24,39,0.96);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    width: 100%;
    min-width: 0;
}
@media (min-width: 480px) { .filter-bar input { width: 260px; } .filter-bar select { width: auto; } }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); }

/* === TABLE === */
.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--bg2);
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) { .table-wrap { border-radius: 20px; } }
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13px; }
@media (min-width: 768px) { table { font-size: 14px; } }
th {
    background: var(--bg3);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text2);
    position: sticky;
    top: 0;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
@media (min-width: 768px) { th { padding: 12px 16px; font-size: 12px; } }
th:hover { color: var(--text); }
th .sort-arrow { font-size: 10px; margin-left: 4px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { td { padding: 12px 16px; } }
tr:hover td { background: rgba(255,255,255,0.02); }

@media (min-width: 1024px) {
    .table-wrap {
        overflow-x: visible;
    }
    .table-wrap table {
        min-width: 0;
        table-layout: fixed;
    }
    .table-wrap th,
    .table-wrap td {
        padding-left: 10px;
        padding-right: 10px;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }
    .table-wrap th {
        letter-spacing: 0.2px;
    }
    .table-wrap .badge {
        white-space: normal;
    }
}

/* Margin bar */
.margin-bar { height: 6px; border-radius: 3px; background: var(--bg3); overflow: hidden; min-width: 50px; }
@media (min-width: 768px) { .margin-bar { min-width: 80px; } }
.margin-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.margin-bar-fill.low { background: var(--orange); }
.margin-bar-fill.negative { background: var(--red); }

/* === PAGINATION === */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 20px 0 36px;
    flex-wrap: wrap;
}
@media (min-width: 768px) { .pagination { gap: 6px; margin: 24px 0 48px; } }
.pagination button {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.pagination button:hover { background: var(--bg3); color: var(--text); }
.pagination button.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.pagination button:disabled { opacity: 0.3; cursor: default; }
.pagination .page-info { font-size: 12px; color: var(--text2); padding: 0 8px; }

/* === BADGES / TAGS === */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}
.badge-green { background: var(--accent-dim); color: var(--accent); }
.badge-gold { background: rgba(255,215,64,0.15); color: var(--gold); }
.badge-red { background: rgba(255,82,82,0.15); color: var(--red); }
.badge-blue { background: rgba(68,138,255,0.15); color: var(--blue); }
.badge-orange { background: rgba(255,171,64,0.15); color: var(--orange); }

/* === TAB SWITCHER === */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
    font-family: inherit;
}
.tab-btn:hover { background: var(--bg3); color: var(--text); }
.tab-btn.active { background: var(--accent-dim); color: var(--accent); border-color: rgba(0,230,118,0.3); font-weight: 600; }
.tab-btn .tab-count { font-size: 11px; opacity: 0.7; margin-left: 4px; }

/* === SWIPE HINT === */
.swipe-hint { display: block; text-align: center; font-size: 12px; color: var(--text2); padding: 8px 0 0; opacity: 0.6; }
@media (min-width: 768px) { .swipe-hint { display: none; } }

/* === FOOTER === */
.footer {
    padding: 34px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.01) 100%);
    color: var(--text2);
    font-size: 12px;
    line-height: 1.7;
}
@media (min-width: 768px) { .footer { padding: 42px 0; font-size: 13px; } }

/* === LOADER === */
.loader { display: flex; justify-content: center; align-items: center; min-height: 200px; }
.loader-spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === EMPTY STATE === */
.empty-state { text-align: center; padding: 48px 16px; color: var(--text2); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }

/* Country link in table */
.country-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.country-link:hover { text-decoration: underline; }
