:root {
    color-scheme: light;
    --bg-0: #f3f6fb;
    --bg-1: #e8eef7;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --text-1: #0f172a;
    --text-2: #475569;
    --muted: #94a3b8;
    --border: rgba(15, 23, 42, 0.08);
    --accent: #0f766e;
    --accent-2: #f59e0b;
    --success: #16a34a;
    --danger: #dc2626;
    --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.12);
    --shadow-sm: 0 6px 16px rgba(15, 23, 42, 0.08);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --nav-height: 88px;
    --nav-height-mobile: 72px;
    --panel-border: rgba(15, 23, 42, 0.06);
    --panel-grad: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(245, 158, 11, 0.12));
}

.app-body {
    font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
    color: var(--text-1);
    background: linear-gradient(180deg, var(--bg-0), var(--bg-1));
    padding-top: 0;
}

.app-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(14, 116, 144, 0.12), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(245, 158, 11, 0.12), transparent 48%),
        linear-gradient(120deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.04));
    pointer-events: none;
    z-index: -1;
}

main {
    animation: fadeInUp 0.6s ease-out both;
}

.page-container {
    max-width: 100%;
    width: 100%;
}

.page-hero {
    background: var(--panel-grad);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-2);
    margin-bottom: 0;
}

.index-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 18px;
    box-shadow: var(--shadow-sm);
}

.index-bar-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    font-weight: 700;
    margin-bottom: 10px;
}

.index-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(160px, 1fr);
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.index-pill {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    min-width: 160px;
}

.index-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.index-meta {
    color: var(--text-2);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

.index-change {
    font-weight: 700;
    margin-top: 8px;
}

.index-change.up {
    color: #0f766e;
}

.index-change.down {
    color: #b91c1c;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.status-pill.success {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.status-pill.danger {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.kpi-card {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    font-weight: 700;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 6px 0 0;
}

.section-title {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.panel-muted {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.18);
}

.stock-card {
    border: 1px solid var(--border);
    border-left: 4px solid rgba(15, 118, 110, 0.5);
    border-radius: var(--radius-md);
    padding: 16px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    height: 100%;
}

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stock-metric {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.criteria-panel {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.criteria-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(15, 23, 42, 0.08);
}

.criteria-row:last-child {
    border-bottom: 0;
}

.criteria-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.criteria-row.success .criteria-badge {
    background: rgba(16, 185, 129, 0.14);
    color: #0f766e;
}

.criteria-row.danger .criteria-badge {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.criteria-text {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.35;
}

.criteria-toggle {
    border-color: rgba(15, 23, 42, 0.15);
    color: var(--text-2);
}

.search-spinner {
    border: 3px solid rgba(15, 118, 110, 0.25);
    border-top-color: var(--accent);
    border-radius: 50%;
    width: 1.1rem;
    height: 1.1rem;
    animation: spin 0.8s linear infinite;
}

.app-navbar {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    min-height: var(--nav-height);
    top: 0;
    z-index: 1030;
}

.navbar-brand {
    font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    color: var(--text-1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand .brand-mark {
    padding: 6px 10px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.navbar-brand .brand-sub {
    color: var(--text-2);
    font-weight: 600;
}

.navbar .nav-link {
    color: var(--text-2);
    font-weight: 600;
    margin-left: 6px;
    position: relative;
}

.navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 2px;
    background: linear-gradient(90deg, rgba(15, 118, 110, 0.4), rgba(245, 158, 11, 0.6));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--text-1);
}

.navbar .nav-link:hover::after,
.navbar .nav-link:focus::after,
.navbar .nav-link.active::after {
    transform: scaleX(1);
}

.app-navbar .navbar-collapse {
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
}

.navbar-nav {
    gap: 4px;
}

.container {
    margin-top: 24px;
    margin-bottom: 56px;
}

.auth-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    max-width: 440px;
    width: 100%;
    padding: 20px;
}

.auth-title {
    font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.card-title {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card-subtitle,
.text-muted {
    color: var(--text-2) !important;
}

.table {
    border-collapse: separate;
    border-spacing: 0 10px;
}

.table thead th {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    color: var(--muted);
    border: 0;
}

.table thead th {
    cursor: pointer;
}

.table td,
.table th {
    white-space: nowrap;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.page-container {
    padding-left: 16px;
    padding-right: 16px;
}

@media (max-width: 992px) {
    .page-hero {
        padding: 20px 22px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .kpi-card {
        padding: 16px;
    }

    .kpi-value {
        font-size: 1.35rem;
    }

    .stock-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .app-navbar {
        min-height: var(--nav-height-mobile);
    }

    .container {
        margin-top: 16px;
        margin-bottom: 40px;
    }

    .page-hero {
        padding: 18px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.05rem;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-value {
        font-size: 1.2rem;
    }

    .stock-card {
        padding: 14px;
    }

    .stock-metric {
        font-size: 0.85rem;
    }

    .criteria-panel {
        padding: 10px;
    }

    .input-group {
        width: 100%;
    }

    .btn-group,
    .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .page-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .page-hero {
        padding: 16px;
    }

    .status-pill {
        width: 100%;
        justify-content: center;
    }

    .card {
        border-radius: var(--radius-md);
    }

    .table {
        font-size: 0.85rem;
    }

    .table td,
    .table th {
        white-space: nowrap;
    }

    .table tbody td {
        padding: 10px 12px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin: 6px 0 12px;
    }
}

.table tbody tr {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-md);
}

.table tbody td {
    border: 0;
    padding: 14px 16px;
    vertical-align: middle;
}

.table tbody tr td:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.table tbody tr td:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: var(--surface);
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 999px;
    padding: 4px 10px;
    margin: 0 2px;
    color: var(--text-2) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(15, 118, 110, 0.4);
    color: var(--text-1) !important;
}

.badge {
    font-weight: 700;
    letter-spacing: 0.04em;
}

.btn {
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 10px 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border: none;
    box-shadow: 0 10px 18px rgba(20, 184, 166, 0.25);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #0d5f5a, #0f9e8d);
}

.btn-outline-secondary {
    color: var(--text-2);
    border-color: rgba(148, 163, 184, 0.6);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: var(--surface-2);
    color: var(--text-1);
}

.form-control,
.form-select {
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 10px 14px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.5);
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.2);
}

.chart-container {
    position: relative;
    height: 320px;
}

.app-footer {
    background: #0b1220;
    color: #e2e8f0;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.app-footer .footer-note {
    color: rgba(226, 232, 240, 0.7);
    font-size: 0.85rem;
}

.app-footer .footer-quote {
    font-style: italic;
    color: rgba(226, 232, 240, 0.8);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991px) {
    .app-body {
        padding-top: 0;
    }

    .app-navbar {
        min-height: var(--nav-height-mobile);
    }

    .app-navbar .navbar-collapse {
        margin-top: 8px;
        background: rgba(255, 255, 255, 0.98);
        border-radius: var(--radius-md);
        padding: 8px;
        box-shadow: var(--shadow-md);
    }

    .navbar .nav-link {
        margin-left: 0;
    }

    .navbar-brand .brand-sub {
        display: none;
    }

    .page-hero {
        padding: 18px 20px;
    }
}








.swal-wide {
    max-width: 520px;
}

.swal-form .swal2-input {
    margin: 8px 0;
    width: 100%;
}

.js-live-input.live-editing {
    border-color: #0f766e;
    box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}
