body {
    background: url("/static/IMG_1174.JPG.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.form-container {
    max-width: 980px;
    background: linear-gradient(180deg, rgba(7, 59, 119, 0.94) 0%, rgba(25, 98, 171, 0.9) 52%, rgba(244, 246, 250, 0.95) 52%);
    padding: 22px 26px 26px;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
    margin: 54px auto;
    text-align: center;
    backdrop-filter: blur(1px);
    color: #fff;
}

.form-container.mode-file-active {
    background: linear-gradient(180deg, rgba(7, 59, 119, 0.94) 0%, rgba(25, 98, 171, 0.9) 56%, rgba(244, 246, 250, 0.95) 56%);
}

.form-container h1 {
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 800;
}

.hero-title-wrap {
    margin: 6px auto -2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hero-title {
    margin: 0;
    font-size: clamp(2.6rem, 5vw, 3.8rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.hero-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 16px;
    margin-top: -2px;
    margin-bottom: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(95, 162, 233, 0.82) 0%, rgba(63, 126, 198, 0.78) 100%);
    border: 1px solid rgba(255, 255, 255, 0.42);
    font-size: clamp(0.72rem, 1.2vw, 0.86rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #f8fbff;
    text-align: center;
    box-shadow: 0 10px 28px rgba(5, 25, 52, 0.16);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 2;
    transform: translateY(-6px);
}

.form-container.mode-file-active .hero-subtitle {
    transform: translateY(-10px);
}

.lead-text {
    margin-bottom: 18px;
    font-size: 1.2rem;
    font-weight: 600;
}

#modeChooser {
    position: relative;
    padding-top: 8px;
}

#modeDetail {
    margin-top: 6px;
}

#urlInputBlock,
#fileInputBlock {
    min-height: 150px;
}

.btn-primary {
    width: 48%;
    border-radius: 30px;
    background-color: #4c89fb;
    border: none;
}

.btn-warning {
    width: 48%;
    border-radius: 30px;
    background-color: #ffc107;
    border: none;
    color: black;
}

.btn-secondary {
    border-radius: 30px;
}

.action-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.action-row .btn {
    width: auto;
    min-width: 180px;
    height: 44px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-row.hidden {
    display: none;
}

.initial-refresh-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 8px 18px rgba(255, 193, 7, 0.28);
    z-index: 3;
}

.table-container {
    margin: 40px auto;
    max-width: 1400px;
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.mode-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}

.mode-card {
    border-radius: 12px;
    color: #fff;
    width: 300px;
    min-height: 260px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mode-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}

.mode-url {
    background: linear-gradient(180deg, #2fac5f 0%, #269a52 100%);
}

.mode-file {
    background: linear-gradient(180deg, #f39d2e 0%, #e57f0f 100%);
}

.mode-head {
    padding: 16px 12px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.mode-body {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    min-height: 120px;
}

.mode-foot {
    padding: 12px 14px 14px;
    background: rgba(0, 0, 0, 0.12);
}

.mode-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.05;
    letter-spacing: 0.2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-icon {
    font-size: 5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-desc {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-icon i {
    line-height: 1;
}

.tiktok-icon i {
    color: #ffffff;
    text-shadow: -2px 0 #ff2f56, 2px 0 #2ee8f2;
}

.data-icon i {
    color: #fff7db;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.data-file {
    font-size: 3.2rem;
    margin-left: -6px;
    margin-top: 18px;
    color: #e8edf3 !important;
}

.btn-check:checked + .mode-card {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45), 0 10px 18px rgba(0, 0, 0, 0.2);
}

.input-panel {
    border: 1px solid #d7e2ee;
    border-radius: 12px;
    background: #ffffff;
    padding: 16px;
    margin-top: 14px;
    margin-bottom: 12px;
    text-align: left;
    color: #1f2d3d;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.chart-container {
    max-width: 260px;
    height: 220px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

#sentimentChart {
    width: 220px !important;
    height: 220px !important;
    background-color: white;
    margin: 0 auto;
    display: block;
}

.chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.chart-section {
    margin-bottom: 60px;
}

.summary-text {
    margin-top: 20px;
}

.table td,
.table th {
    vertical-align: top;
    word-break: break-word;
    white-space: normal;
}

.recommendation-row {
    margin: 6px 0 14px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    justify-content: center;
    text-align: left;
}

.recommendation-label {
    white-space: nowrap;
}

.recommendation-content {
    display: inline;
}

.recommendation-item {
    display: inline;
}

.recommendation-sep {
    color: #6c757d;
    margin: 0 2px;
}

.calc-toggle-wrap {
    text-align: center;
    margin: 4px 0 10px 0;
}

.calc-panel {
    margin: 0 0 14px 0;
    padding: 12px 14px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background: #f8fafc;
}

.calc-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px 14px;
    margin-bottom: 10px;
}

.calc-formula {
    margin-bottom: 6px;
    word-break: break-word;
}

.table th {
    text-align: center;
}

.table-responsive {
    border: 1px solid #d9e2ec;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: auto;
    background: #ffffff;
    width: 100%;
}

#sentimentTable {
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0;
}

#sentimentTable th,
#sentimentTable td {
    padding: 12px 14px;
    border-color: #dbe4ee;
    font-size: 0.95rem;
    line-height: 1.45;
}

#sentimentTable th:first-child,
#sentimentTable td:first-child {
    width: 56px;
}

#sentimentTable th:nth-child(2),
#sentimentTable td:nth-child(2) {
    width: 132px;
}

#sentimentTable th:nth-child(3),
#sentimentTable td:nth-child(3) {
    width: 28%;
}

#sentimentTable th:nth-child(4),
#sentimentTable td:nth-child(4) {
    width: 24%;
}

#sentimentTable th:nth-child(5),
#sentimentTable td:nth-child(5) {
    width: 30%;
}

#sentimentTable th:nth-child(6),
#sentimentTable td:nth-child(6) {
    width: 110px;
}

#sentimentTable thead th {
    background: #183a63 !important;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    vertical-align: middle;
}

#sentimentTable tbody tr:nth-child(even) {
    background: #f8fbff;
}

#sentimentTable tbody tr:hover {
    background: #eef6ff;
}

.comment-cell,
.normalized-cell,
.label-cell {
    word-break: break-word;
    white-space: normal;
}

.comment-cell,
.normalized-cell {
    text-align: left;
}

.comment-cell {
    font-weight: 500;
    color: #1f2937;
}

.normalized-cell {
    color: #334155;
}

.label-cell,
.sentiment-cell {
    text-align: center;
}

.label-cell {
    font-size: 0.84rem;
    color: #243b53;
}

.sentiment-cell {
    white-space: nowrap;
    vertical-align: top !important;
    font-weight: 700;
    text-transform: capitalize;
}

.num-cell {
    text-align: center;
    font-weight: 600;
    vertical-align: top !important;
    color: #52606d;
}

@media (max-width: 1200px) {
    #sentimentTable {
        min-width: 980px;
    }
}

.viz-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.source-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0 18px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.source-media {
    width: 220px;
    height: 140px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.source-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.source-info {
    flex: 1;
}

.source-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.source-desc {
    color: #444;
    margin-bottom: 6px;
}

.source-meta {
    color: #666;
    margin-bottom: 8px;
}

.source-link a {
    font-weight: 600;
    text-decoration: none;
}

.results-actions {
    margin: 10px 0 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.results-actions .btn {
    min-width: 126px;
    height: 34px;
    border-radius: 18px;
    font-size: 0.88rem;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.result-logo-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.result-logo {
    max-height: 88px;
    width: auto;
}

.result-header-banner {
    margin: -20px -20px 14px -20px;
    padding: 18px 14px 12px;
    border-radius: 12px 12px 0 0;
    background: linear-gradient(180deg, #073b77 0%, #1962ab 52%);
}

.result-title {
    color: #ffffff;
    margin-bottom: 0;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.save-info {
    margin: 10px 0 14px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px dashed #bcc9d6;
    background: #f5faff;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 900px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .viz-card-wide {
        width: 100%;
    }

    .viz-card-triple {
        width: 100%;
    }
}

.viz-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 8px 10px;
    width: 280px;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.viz-card-wide {
    width: 430px;
}

.viz-card-triple {
    width: 360px;
    min-height: 220px;
}

.chart-container-wide {
    max-width: 100%;
    width: 100%;
    height: 190px;
}

.viz-title {
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.chart-note {
    margin: 8px 4px 2px;
    font-size: 0.84rem;
    line-height: 1.35;
    color: #334155;
    background: #eef4fb;
    border: 1px solid #dbe7f3;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
}

.wordcloud-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

.wordcloud-container img {
    max-width: 230px;
    max-height: 180px;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

#sentimentBarChart {
    width: 200px !important;
    height: 170px !important;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
    padding-top: 8px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-card {
    background: #ffffff;
    padding: 18px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.loading-text {
    font-weight: 600;
}

.risk-panel {
    margin: 12px 0 18px 0;
    padding: 12px 14px;
    border: 1px solid #dfe4ea;
    border-radius: 10px;
    background: #f8fafc;
    text-align: center;
}

.risk-metrics {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.risk-item {
    margin-bottom: 6px;
}

.risk-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

.risk-recs {
    margin: 0;
    padding-left: 18px;
    text-align: left;
    display: inline-block;
}

/* Tambahan untuk dashboard versi sekarang */
.dashboard-shell {
    display: grid;
    grid-template-columns: 290px 1fr;
    min-height: 100vh;
}

.dashboard-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px 18px;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.96) 0%,
        rgba(12, 22, 48, 0.94) 34%,
        rgba(12, 22, 48, 0.78) 68%,
        rgba(12, 22, 48, 0.34) 100%
    );
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.dashboard-sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.02) 28%,
        rgba(255, 255, 255, 0.01) 56%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

.dashboard-sidebar > * {
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
    padding: 0 6px;
}

.sidebar-brand > div:last-child {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar-logo {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: 0 0 88px;
}

.sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sidebar-app {
    font-size: 1.22rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    margin-top: 0;
}

.sidebar-sub {
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #c7d2fe;
    max-width: 150px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.94);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-link i {
    font-size: 1rem;
    opacity: 0.95;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(79, 70, 229, 0.3);
    text-decoration: none;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 0.88rem;
}

.sidebar-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #60a5fa;
    box-shadow: 0 0 0 6px rgba(96, 165, 250, 0.18);
}

.dashboard-main-area {
    padding: 12px 14px 20px;
}

.dashboard-topbar,
.panel-card,
.kpi-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe4ee;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

.dashboard-topbar {
    padding: 12px 18px 13px;
    border-radius: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dashboard-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.12;
}

.dashboard-subtitle {
    margin: 5px 0 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.4;
}

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
}

.toolbar-pill {
    min-width: 114px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid #dbe3f0;
    border-radius: 14px;
    color: #334155;
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn {
    border-radius: 14px;
    min-width: 132px;
    height: 36px;
    padding: 0 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.toolbar-btn.btn-light {
    background: #e5e7eb;
    border: 1px solid #cbd5e1;
    color: #111827;
}

.toolbar-btn.btn-light:hover {
    background: #d1d5db;
    border-color: #94a3b8;
    color: #0f172a;
}

.panel-card {
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 16px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.panel-head p {
    margin: 4px 0 0;
    color: #64748b;
}

.panel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.panel-actions-top {
    justify-content: flex-end;
    margin-bottom: 8px;
}

.panel-chip {
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 0.76rem;
    font-weight: 800;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.kpi-card {
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.kpi-positive {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.kpi-neutral {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.kpi-negative {
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
}

.kpi-positive .kpi-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.kpi-neutral .kpi-icon {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.kpi-negative .kpi-icon {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.kpi-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #334155;
}

.kpi-value {
    font-size: 1.85rem;
    line-height: 1.05;
    font-weight: 800;
    color: #0f172a;
}

.kpi-meta {
    margin-top: 4px;
    font-size: 0.88rem;
    color: #64748b;
}

.source-preview-panel {
    overflow: hidden;
}

.source-preview-wrap {
    display: flex;
    min-height: 340px;
    padding: 10px 0 0;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 18px;
}

.source-preview-stage {
    width: 100%;
    min-height: 300px;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 24px;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.source-preview-visual {
    flex: 0 0 340px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.source-preview-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: stretch;
}

.source-preview-media {
    position: relative;
    width: min(100%, 340px);
    aspect-ratio: 4 / 5;
    border-radius: 18px;
    overflow: hidden;
    display: block;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5edf6;
}

.source-preview-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.source-preview-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.68);
    color: #ffffff;
    display: grid;
    place-items: center;
    font-size: 1.85rem;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
}

.source-preview-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px 16px 14px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.78) 100%);
    color: #ffffff;
}

.source-preview-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.source-preview-hint {
    font-size: 0.84rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.source-preview-phone {
    width: min(100%, 334px);
    min-height: 210px;
    padding: 24px 22px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border: 1px solid #eef2f7;
    text-align: center;
}

.source-preview-icon {
    font-size: 3.2rem;
    line-height: 1;
    color: #111111;
    margin-bottom: 14px;
}

.source-preview-phone h4 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.source-preview-phone p {
    margin: 0 auto 8px;
    max-width: 230px;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #334155;
}

.source-preview-account {
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #475569;
}

.source-preview-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 172px;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff3158 0%, #ff4d6d 100%);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 800;
    text-decoration: none;
}

.source-preview-link-btn:hover {
    color: #ffffff;
    text-decoration: none;
}

.source-detail-panel {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 14px;
    padding: 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
}

.source-detail-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    color: #ffffff;
    font-size: 1.25rem;
}

.source-narrative-panel {
    width: 100%;
    padding: 18px 20px;
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
    border: 1px solid #f1e4b8;
    box-shadow: 0 10px 26px rgba(148, 163, 184, 0.08);
    min-height: 100%;
}

.source-narrative-label {
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a6700;
}

.source-narrative-title {
    margin-bottom: 10px;
    font-size: 1.02rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.6;
}

.source-narrative-text {
    font-size: 0.93rem;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.source-narrative-author {
    margin-top: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #64748b;
}

.source-detail-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.source-detail-meta {
    margin-top: 4px;
    color: #475569;
    word-break: break-word;
}

.trend-layout {
    display: grid;
    gap: 2px;
}

.trend-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.56fr) minmax(400px, 1.06fr);
    gap: 14px;
    align-items: stretch;
}

.sentiment-trend-chart {
    height: 430px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-chart-wrap {
    height: 300px;
    min-height: 300px;
    flex: 0 0 300px;
}

.trend-chart-help {
    margin: 0 0 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
}

.trend-grouping-note {
    margin: -1px 0 10px;
    font-size: 0.82rem;
    line-height: 1.38;
    color: #475569;
}

.trend-side-stack {
    display: grid;
    grid-template-rows: 188px minmax(0, 1fr);
    gap: 12px;
    height: 430px;
    min-height: 430px;
    overflow: hidden;
}

.trend-side-top {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.trend-side-head {
    margin-bottom: 12px;
}

.trend-side-head h3 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.trend-side-head p {
    margin: 4px 0 0;
    color: #64748b;
    line-height: 1.45;
}

.trend-stat-card {
    padding: 10px 14px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.78);
    margin-bottom: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.trend-stat-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.trend-stat-positif {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.trend-stat-netral {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}

.trend-stat-negatif {
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.trend-stat-label {
    font-size: 0.9rem;
    font-weight: 800;
    color: #334155;
}

.trend-stat-value {
    margin-top: 0;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #0f172a;
}

.trend-stat-meta {
    margin-top: 2px;
    font-size: 0.88rem;
    color: #64748b;
}

.trend-stat-desc {
    margin-top: 6px;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #475569;
}

.trend-stat-comment-list {
    display: grid;
    gap: 8px;
}

.trend-stat-comment-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.trend-stat-comment-rank {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 900;
}

.trend-stat-comment-text {
    color: #1e293b;
    font-size: 0.9rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.trend-comment-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.batch-comment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.trend-context-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
}

.trend-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.trend-card-value {
    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;
    color: #0f172a;
    white-space: nowrap;
}

.trend-context-session {
    margin: 4px 0 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: #64748b;
}

.trend-context-subtitle {
    margin-bottom: 10px;
    font-size: 0.86rem;
    line-height: 1.4;
    color: #475569;
}

.trend-context-note {
    margin-bottom: 10px;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #64748b;
}

.trend-keyword-panel,
.trend-summary-panel,
.trend-distribution-panel {
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
    height: 100%;
}

.trend-keyword-panel,
.trend-distribution-panel {
    display: flex;
    flex-direction: column;
}

.trend-summary-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    min-height: 0;
}

.trend-summary-top {
    padding: 12px 14px 0;
}

.trend-insight-meta {
    margin-top: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.trend-comment-empty {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.8);
    color: #64748b;
    text-align: center;
}

.trend-keyword-panel .panel-head,
.trend-summary-panel .panel-head,
.trend-distribution-panel .panel-head {
    margin-bottom: 6px;
    width: 100%;
}

.trend-keyword-panel .panel-head h3,
.trend-summary-panel .panel-head h3,
.trend-distribution-panel .panel-head h3 {
    font-size: 1.06rem;
    line-height: 1.25;
}

.trend-keyword-panel .panel-head p,
.trend-summary-panel .panel-head p,
.trend-distribution-panel .panel-head p {
    font-size: 0.84rem;
    line-height: 1.36;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.trend-keyword-chart-wrap {
    flex: 1 1 auto;
    min-height: 104px;
}

.trend-distribution-panel .donut-wrap {
    flex: 1 1 auto;
    min-height: 82px;
    max-height: 98px;
}

.trend-comments-panel {
    margin-top: 0;
}

.trend-comment-card {
    display: flex;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.92) 0%, rgba(255, 255, 255, 0.98) 100%);
    border: 1px solid #e2e8f0;
    padding: 0;
    overflow: hidden;
    height: 100%;
}

.trend-comment-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
}

.trend-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.trend-comment-like {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.batch-comment-grid .trend-stat-comment-item {
    height: 100%;
}

.score-hero {
    font-size: 2.2rem;
    font-weight: 800;
    color: #16a34a;
    line-height: 1.05;
    margin-top: 0;
    width: 100%;
}

@media (max-width: 1180px) {
    .trend-top-grid {
        grid-template-columns: 1fr;
        height: auto;
    }

    .trend-side-top,
    .trend-comment-grid {
        grid-template-columns: 1fr;
    }

    .batch-comment-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .hero-chart-wrap {
        height: 340px;
        min-height: 340px;
    }

    .trend-side-stack {
        height: auto;
        min-height: 0;
        grid-template-rows: auto auto;
    }

    .trend-keyword-panel,
    .trend-distribution-panel {
        height: auto;
        min-height: 182px;
    }
}

.score-caption {
    margin-top: 4px;
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
    width: 100%;
    line-height: 1.4;
}

.plain-summary-box {
    margin: 10px 14px 14px;
    padding: 12px 13px;
    border-radius: 16px 16px 18px 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border: 1px solid #e2e8f0;
    color: #334155;
    line-height: 1.5;
    font-size: 0.9rem;
    width: auto;
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    align-self: stretch;
    margin-bottom: 0;
    overflow: auto;
    overflow-wrap: anywhere;
}

.keyword-chart-wrap,
.donut-wrap {
    height: 150px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.event-table-wrap {
    overflow-x: auto;
}

.dashboard-event-table th {
    font-size: 0.85rem;
    color: #475569;
}

.dashboard-event-table td {
    font-size: 0.9rem;
    color: #1e293b;
}

.analysis-summary-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.analysis-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.recommendation-card {
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border: 1px solid #dbeafe;
}

.recommendation-card p {
    margin: 8px 0 0;
    color: #334155;
    line-height: 1.55;
}

.plain-recommendation-title {
    font-weight: 700;
    color: #0f172a;
}

.dashboard-rec-list {
    margin-top: 12px;
}

.simple-rec-item {
    margin-bottom: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
}

.table-panel {
    padding: 18px;
    min-height: 84vh;
    display: flex;
    flex-direction: column;
    margin-top: -6px;
}

.table-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.table-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-right: auto;
    flex: 1;
}

.table-heading .form-select {
    min-width: 170px;
    width: auto;
    margin-left: 0;
}

.table-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.selected-batch-indicator {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid #dbe4ee;
    background: #f8fafc;
    color: #334155;
    font-size: 0.88rem;
    font-weight: 700;
}

.sentiment-distribution-legend {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 8px;
    justify-content: center;
}

.distribution-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #334155;
    font-weight: 700;
    white-space: nowrap;
}

.distribution-swatch {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    flex: 0 0 11px;
}

.distribution-legend-item.positive .distribution-swatch {
    background: #22c55e;
}

.distribution-legend-item.neutral .distribution-swatch {
    background: #94a3b8;
}

.distribution-legend-item.negative .distribution-swatch {
    background: #ef4444;
}

.segment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.table-row-selected-batch {
    background: rgba(219, 234, 254, 0.45);
}

.table-row-selected-batch td {
    box-shadow: inset 0 1px 0 rgba(191, 219, 254, 0.7), inset 0 -1px 0 rgba(191, 219, 254, 0.7);
}

.dashboard-table-wrap {
    flex: 1;
    min-height: 68vh;
    max-height: 68vh;
    width: 100%;
}

.table-panel.table-panel-compact {
    min-height: auto;
}

.dashboard-table-wrap.dashboard-table-wrap-compact {
    flex: 0 0 auto;
    min-height: auto;
    max-height: none;
}

.empty-card-note {
    padding: 16px;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    border: 1px dashed #cbd5e1;
}

.sentiment-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.sentiment-positif {
    color: #166534;
    background: #dcfce7;
}

.sentiment-negatif {
    color: #991b1b;
    background: #fee2e2;
}

.sentiment-netral {
    color: #475569;
    background: #e2e8f0;
}

.dashboard-hidden {
    display: none !important;
}

@media (max-width: 1400px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        padding-bottom: 12px;
        position: static;
        height: auto;
        overflow: visible;
    }

    .sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .trend-top-grid,
    .trend-comment-grid,
    .report-grid,
    .source-preview-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-main-area {
        padding: 14px;
    }

    .dashboard-topbar,
    .table-panel-head {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-title {
        font-size: 1.45rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .hero-chart-wrap,
    .keyword-chart-wrap,
    .donut-wrap {
        height: 240px;
    }

    .source-preview-wrap {
        min-height: auto;
        padding: 8px 0 0;
    }

    .source-preview-stage {
        flex-direction: column;
        gap: 16px;
        padding: 14px;
    }

    .source-preview-visual,
    .source-preview-copy {
        flex: 1 1 auto;
        width: 100%;
    }

    .source-preview-media,
    .source-preview-phone {
        width: min(100%, 320px);
    }

    .source-preview-stage {
        min-height: auto;
        padding: 6px 0;
    }

    .source-preview-media {
        width: min(100%, 320px);
        border-radius: 18px;
    }
}
