/* ==========================================
   DESIGN SYSTEM & VARIABLES
   ========================================== */
:root {
    --primary-color: #f59e0b; /* Amber - warm & friendly for IRT/UMKM */
    --primary-hover: #d97706;
    --primary-light: #fef3c7;
    --background: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    
    --shadow-sm: 0 2px 4px rgba(148, 163, 184, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(148, 163, 184, 0.1), 0 4px 6px -2px rgba(148, 163, 184, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(148, 163, 184, 0.15), 0 10px 10px -5px rgba(148, 163, 184, 0.04);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
}

body {
    background: var(--background);
    color: var(--text-main);
    overflow-x: hidden;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   SIDEBAR & NAVIGATION
   ========================================== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    color: var(--sidebar-text);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.brand p {
    font-size: 11px;
    color: var(--sidebar-text);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--sidebar-active);
}

.nav-item.active {
    border-left: 4px solid var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-info h4 {
    font-size: 14px;
    color: white;
}

.user-info span {
    font-size: 11px;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    max-width: 1200px;
}

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

.greeting h2 {
    font-size: 28px;
    font-weight: 700;
}

.greeting p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--background);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
    padding: 0;
}

.btn-text:hover {
    color: var(--text-main);
}

/* ==========================================
   TABS & DASHBOARD PANELS
   ========================================== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    border-radius: var(--radius-md);
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.card-gradient-1 {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.card-gradient-2 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.card-gradient-3 {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 16px;
}

.stat-card h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-footer {
    font-size: 11px;
    opacity: 0.8;
}

/* Details Panels */
.dashboard-details {
    display: flex;
    gap: 24px;
    margin-top: 24px;
}

.details-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.margin-top { margin-top: 24px; }

.panel-header {
    margin-bottom: 20px;
}

.panel-header.flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.panel-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Custom Donut Chart (SVG) */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    padding: 10px 0;
}

.custom-donut-chart {
    position: relative;
    width: 140px;
    height: 140px;
}

.circular-chart {
    display: block;
    max-height: 100%;
}

.circle-bg {
    fill: none;
    stroke: #f1f5f9;
    stroke-width: 2.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.segment-dapur { stroke: #f59e0b; }
.segment-elektronik { stroke: #10b981; }
.segment-umkm { stroke: #3b82f6; }
.segment-transport { stroke: #ec4899; }

.percentage-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.pct-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
}

.pct-text {
    font-size: 11px;
    color: var(--text-muted);
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.legend-item:hover {
    background: rgba(0,0,0,0.02);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-val {
    margin-left: auto;
    font-weight: 600;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-dapur { background: #fef3c7; color: #d97706; }
.badge-elektronik { background: #d1fae5; color: #059669; }
.badge-umkm { background: #dbeafe; color: #1d4ed8; }
.badge-transport { background: #fce7f3; color: #db2777; }
.badge-lainnya { background: #f1f5f9; color: #475569; }

/* ==========================================
   SCAN / UPLOAD TAB PANEL
   ========================================== */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.active {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.drop-zone-content {
    text-align: center;
    padding: 20px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.drop-zone:hover .upload-icon {
    color: var(--primary-color);
    transform: scale(1.1);
}

.drop-zone .main-text {
    font-weight: 500;
}

.drop-zone .sub-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Pulsing scan laser animation */
.scan-laser {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    display: none;
    animation: scanAnimation 2s infinite linear;
}

@keyframes scanAnimation {
    0% { top: 0%; }
    50% { top: 100%; }
    100% { top: 0%; }
}

.preview-area {
    margin-top: 20px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 400px;
    border: 1px solid var(--border-color);
}

.preview-area img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

.api-config-collapsible {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.api-config-content {
    margin-top: 10px;
    padding: 16px;
    background: #f1f5f9;
    border-radius: var(--radius-sm);
}

.api-config-content p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
}

.form-group input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

/* Results Display */
.empty-state-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-results i {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
}

.processing-results {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Digital Receipt */
.digital-receipt-view {
    animation: fadeIn 0.4s ease;
}

.receipt-paper {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    position: relative;
    margin-bottom: 20px;
}

.receipt-paper::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 6px;
    background: radial-gradient(circle, transparent, transparent 50%, white 50%, white) 0 0/12px 12px repeat-x;
}

.receipt-head {
    text-align: center;
    margin-bottom: 16px;
}

.receipt-head h4 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.receipt-head p {
    font-size: 12px;
    color: var(--text-muted);
}

.receipt-divider {
    border: none;
    border-top: 1px dashed #cbd5e1;
    margin: 16px 0;
}

.receipt-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.receipt-item-name {
    flex-grow: 1;
}

.receipt-item-price {
    font-weight: 500;
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
}

.category-select-container {
    margin-bottom: 20px;
}

.category-select-container label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.category-select-container select {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

/* ==========================================
   WARRANTIES PANEL & MODAL
   ========================================== */
.warranty-alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: #fffbeb;
    border-left: 4px solid var(--warning);
}

.alert-item.urgent {
    background: #fef2f2;
    border-left-color: var(--danger);
}

.alert-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning);
}

.alert-item.urgent .alert-icon-wrap {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.alert-info h5 {
    font-size: 13px;
    font-weight: 600;
}

.alert-info p {
    font-size: 11px;
    color: var(--text-muted);
}

/* Warranties Grid */
.warranties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.warranty-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

.warranty-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.warranty-card h4 {
    font-size: 16px;
    font-weight: 600;
}

.warranty-store {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.warranty-timeline {
    margin-top: auto;
    font-size: 12px;
}

.progress-bar-bg {
    background: #f1f5f9;
    height: 6px;
    border-radius: 3px;
    margin: 8px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--success);
    border-radius: 3px;
}

.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-image-container {
    margin-top: 16px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: var(--radius-sm);
}

.modal-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==========================================
   FILTERS
   ========================================== */
.filters-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group select, .filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
}

/* ==========================================
   ANALISIS KESEHATAN KEUANGAN
   ========================================== */
.income-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.income-input-container label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-with-currency {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
}

.input-with-currency span {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 14px;
    margin-right: 4px;
}

.input-with-currency input {
    border: none;
    outline: none;
    font-weight: 600;
    font-size: 14px;
    width: 120px;
    color: var(--text-main);
}

.financial-health-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    margin-top: 16px;
}

.health-gauge {
    background: rgba(248, 250, 252, 0.5);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border-color);
}

.flex-row-space {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.health-insights {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid #fde68a;
}

.insight-icon-wrap {
    width: 40px;
    height: 40px;
    background: #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.insight-text h4 {
    font-size: 15px;
    font-weight: 700;
    color: #78350f;
    margin-bottom: 4px;
}

.insight-text p {
    font-size: 12.5px;
    color: #92400e;
    line-height: 1.5;
}

/* Upload Method Tabs */
.upload-method-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.btn-upload-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-upload-tab:hover {
    color: var(--text-main);
}

.btn-upload-tab.active {
    background: white;
    color: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

/* Text Upload */
.text-upload-container textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    outline: none;
    resize: vertical;
    background: #fafafb;
    color: #334155;
}

.text-upload-container textarea:focus {
    border-color: var(--primary-color);
    background: white;
}

/* ==========================================
   TREN HARGA & INFLASI LOKAL
   ========================================== */
.price-trends-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.price-trend-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.price-trend-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fef2f2;
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.price-trend-info {
    flex-grow: 1;
}

.price-trend-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.price-trend-info p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.price-trend-stats {
    text-align: right;
}

.price-trend-percentage {
    font-size: 14px;
    font-weight: 700;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-end;
}

.price-trend-old-new {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================
   CHATBOT FINANSIAL PINTAR
   ========================================== */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
}

.chatbot-toggle-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.3);
}

.chatbot-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(217, 119, 6, 0.4);
}

.chatbot-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 350px;
    height: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.chatbot-header {
    background: var(--sidebar-bg);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-info h4 {
    font-size: 14px;
    font-weight: 600;
}

.bot-info span {
    font-size: 11px;
    opacity: 0.8;
}

.btn-close-chat {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}

.chat-bubble.bot {
    background: #f1f5f9;
    color: var(--text-main);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.chat-bubble.user {
    background: var(--primary-light);
    color: var(--primary-hover);
    font-weight: 500;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chatbot-input-area {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: white;
}

.chatbot-input-area input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    outline: none;
}

.chatbot-input-area input:focus {
    border-color: var(--primary-color);
}

.btn-send-chat {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-send-chat:hover {
    background: var(--primary-hover);
}

/* Typing Indicator Animation */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ==========================================
   RESPONSIVE DESIGN (MOBILE ADAPTATION)
   ========================================== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        padding: 15px 20px;
    }
    
    .brand {
        margin-bottom: 10px;
    }
    
    .nav-menu {
        flex-direction: row;
        justify-content: space-around;
        overflow-x: auto;
        padding: 4px 0;
    }
    
    .nav-item {
        padding: 8px 10px;
        font-size: 11px;
        flex-direction: column;
        gap: 4px;
        flex-shrink: 0;
    }
    
    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
    }
    
    .user-profile {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .greeting h2 {
        font-size: 22px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .upload-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-details {
        flex-direction: column;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .financial-health-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   AUTH SCREEN & CARD STYLING
   ========================================== */
.auth-container {
    background: radial-gradient(circle at 10% 20%, rgba(253, 244, 215, 0.4) 0%, rgba(248, 250, 252, 0.8) 90%);
}

.auth-container .details-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    padding: 36px 30px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: var(--radius-sm);
}

.auth-tab {
    flex: 1;
    text-align: center;
    border: none;
    background: transparent;
    padding: 8px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
}

.auth-tab.active {
    background: white;
    color: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   TOAST NOTIFICATION STYLING
   ========================================== */
.toast-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    min-width: 250px;
    max-width: 350px;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    pointer-events: auto;
}

.toast-card.success {
    border-left: 4px solid var(--success);
    color: #065f46;
}

.toast-card.error {
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.toast-card.info {
    border-left: 4px solid var(--primary-color);
    color: #92400e;
}

.toast-card i {
    width: 18px;
    height: 18px;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-card.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ==========================================
   BATCH UPLOAD & PREVIEW GRID
   ========================================== */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .pdf-icon-placeholder {
    width: 48px;
    height: 48px;
    color: var(--danger);
}

.preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
}

.preview-item .remove-btn:hover {
    background: var(--danger);
}

.preview-item .item-spinner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.item-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.item-success-icon {
    width: 24px;
    height: 24px;
    background: var(--success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.batch-item-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #fff;
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.batch-item-card:hover {
    transform: translateY(-2px);
}

.batch-item-header {
    background: #f8fafc;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.batch-item-header strong {
    font-size: 14px;
    color: var(--text-dark);
}

.batch-item-body {
    padding: 16px;
}

/* ==========================================
   DUE TIMELINE
   ========================================== */
.due-timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.due-timeline-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8fafc;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.due-timeline-item:hover {
    transform: translateX(4px);
}

.due-timeline-item.danger {
    border-left-color: var(--danger);
    background: rgba(225, 29, 72, 0.02);
}

.due-timeline-item.warning {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.02);
}

.due-timeline-item.success {
    border-left-color: var(--success);
    background: rgba(16, 185, 129, 0.02);
}

.due-item-info h5 {
    margin: 0;
    font-size: 14px;
    color: var(--text-dark);
}

.due-item-info p {
    margin: 4px 0 0 0;
    font-size: 11px;
    color: var(--text-muted);
}

.due-item-date {
    text-align: right;
}

.due-item-date strong {
    display: block;
    font-size: 14px;
    color: var(--text-dark);
}

.due-item-date span {
    font-size: 11px;
    font-weight: 600;
}

.due-item-date .due-badge-danger {
    color: var(--danger);
}

.due-item-date .due-badge-warning {
    color: var(--warning);
}

.due-item-date .due-badge-success {
    color: var(--success);
}



