/* ========================================
   Analista Bancario IA — Navigation Shell
   Bloomberg-inspired dark theme
   ======================================== */

:root {
    --bg: #050810;
    --bg2: #0a0e27;
    --bg3: #1a1f3a;
    --border: #1a1f3a;
    --orange: #ff8c00;
    --orange-dim: rgba(255,140,0,0.15);
    --green: #00e676;
    --red: #e63946;
    --blue: #448aff;
    --text: #e0e0e0;
    --text-dim: #888;
    --sidebar-w: 56px;
    --topbar-h: 48px;
}

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* ---- Topbar ---- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-h);
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-brand h1 {
    font-size: 14px;
    font-weight: 700;
    color: var(--orange);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.topbar-brand .divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

.topbar-brand .subtitle {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.data-badge {
    font-size: 11px;
    color: var(--green);
    background: rgba(0,230,118,0.1);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,230,118,0.2);
}

.user-info {
    font-size: 12px;
    color: var(--text-dim);
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}
.btn-logout:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 90;
}

.sidebar-section {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-section-title {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 0;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-dim);
    font-size: 13px;
    text-decoration: none;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-item:hover {
    background: var(--orange-dim);
    color: var(--text);
}

.nav-item.active {
    background: var(--orange-dim);
    color: var(--orange);
    border-left-color: var(--orange);
}

.nav-item .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.nav-item .icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item .nav-label {
    display: none;
}

/* Tooltip on hover */
.nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(var(--sidebar-w) + 6px);
    background: var(--bg3);
    color: var(--text);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 200;
    border: 1px solid var(--border);
}

.nav-item:hover::after {
    opacity: 1;
}

/* ---- Main Content (iframe area) ---- */
.main-content {
    position: fixed;
    top: var(--topbar-h);
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    background: var(--bg);
}

.main-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ---- Reports Panel ---- */
.reports-panel {
    padding: 32px;
    overflow-y: auto;
    height: 100%;
}

.reports-panel h2 {
    font-size: 20px;
    color: var(--orange);
    margin-bottom: 8px;
}

.reports-panel p {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 24px;
}

.report-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    max-width: 900px;
}

.report-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    transition: border-color 0.2s;
}

.report-card:hover {
    border-color: var(--orange);
}

.report-card h3 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
}

.report-card p {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.btn-download {
    background: linear-gradient(135deg, var(--orange), #e67e00);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255,140,0,0.3);
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Upload Panel ---- */
.upload-panel {
    padding: 32px;
    overflow-y: auto;
    height: 100%;
}

.upload-panel h2 {
    font-size: 20px;
    color: var(--orange);
    margin-bottom: 8px;
}

.upload-zone {
    max-width: 600px;
    margin-top: 24px;
    background: var(--bg2);
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: border-color 0.2s;
}

.upload-zone.drag-over {
    border-color: var(--orange);
    background: var(--orange-dim);
}

.upload-zone label {
    display: block;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sample-hint {
    font-size: 11px;
    color: var(--text-dim);
    margin: -4px 0 10px;
    font-family: 'DM Sans', sans-serif;
}
.sample-hint a {
    color: var(--orange);
    text-decoration: none;
}
.sample-hint a:hover {
    text-decoration: underline;
}

.upload-zone input[type="file"] {
    display: block;
    margin: 0 auto 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.btn-upload {
    background: var(--green);
    border: none;
    color: #000;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 16px;
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.upload-status {
    margin-top: 16px;
    font-size: 13px;
    padding: 10px;
    border-radius: 6px;
    display: none;
}

.upload-status.success {
    display: block;
    background: rgba(0,230,118,0.1);
    color: var(--green);
    border: 1px solid rgba(0,230,118,0.2);
}

.upload-status.error {
    display: block;
    background: rgba(230,57,70,0.1);
    color: var(--red);
    border: 1px solid rgba(230,57,70,0.2);
}

/* ---- Welcome Panel ---- */
.welcome-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.welcome-panel h2 {
    font-size: 24px;
    color: var(--orange);
    margin-bottom: 12px;
}

.welcome-panel p {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 400px;
}

/* ---- Fullscreen Toggle ---- */
.btn-fullscreen {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-fullscreen:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.btn-fullscreen svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Fullscreen mode */
body.fullscreen .topbar {
    transform: translateY(-100%);
    transition: transform 0.25s ease;
}

body.fullscreen .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}

body.fullscreen .main-content {
    top: 0;
    left: 0;
    transition: top 0.25s ease, left 0.25s ease;
}

/* Exit fullscreen floating button */
.btn-exit-fullscreen {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 200;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 0;
}

body.fullscreen .btn-exit-fullscreen {
    display: flex;
    opacity: 0.4;
}

body.fullscreen .btn-exit-fullscreen:hover {
    opacity: 1;
    border-color: var(--orange);
    color: var(--orange);
}

.btn-exit-fullscreen svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Smooth transitions for non-fullscreen */
.topbar, .sidebar, .main-content {
    transition: transform 0.25s ease, top 0.25s ease, left 0.25s ease;
}

/* ---- Theme Toggle ---- */
.btn-theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.btn-theme-toggle:hover {
    border-color: var(--orange);
    color: var(--orange);
}

.btn-theme-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Dark mode: show sun icon, hide moon */
html[data-theme="dark"] .icon-moon,
html:not([data-theme="light"]) .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun,
html:not([data-theme="light"]) .icon-sun { display: block; }

/* Light mode: show moon icon, hide sun */
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }

/* View/Tab toggle buttons */
.view-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    transition: all .15s;
}
.view-btn:hover { border-color: var(--orange); color: var(--text-primary); }
.view-btn.active { background: rgba(255,140,0,.12); border-color: var(--orange); color: var(--orange); }

/* Powered by badge */
.powered-by {
    position: fixed;
    bottom: 8px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    color: var(--text-dim);
    opacity: 0.5;
    z-index: 10;
}
.powered-by img {
    opacity: 0.7;
}
html[data-theme="light"] .powered-by img {
    filter: none;
}
html:not([data-theme="light"]) .powered-by img {
    filter: brightness(1.5);
}
