* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #172033;
}

header {
    height: 70px;
    background: white;
    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    color: #4f46e5;
    font-size: 23px;
    font-weight: 800;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #f59e0b;
}

.layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 235px;
    background: #111827;
    padding: 25px 15px;
    flex-shrink: 0;
}

.sidebar-title {
    color: #9ca3af;
    font-size: 12px;
    font-weight: bold;
    margin: 5px 12px 15px;
}

.nav {
    display: block;
    width: 100%;
    padding: 13px;
    margin: 4px 0;

    border: none;
    border-radius: 8px;

    background: transparent;
    color: #d1d5db;

    text-decoration: none;
    text-align: left;

    cursor: pointer;

    font-size: 14px;
}

.nav:hover,
.nav.active {
    background: #4f46e5;
    color: white;
}

main {
    flex: 1;
    max-width: 1200px;
    padding: 30px;
}

h1 {
    margin-top: 0;
    font-size: 30px;
}

.subtitle {
    color: #667085;
    margin-bottom: 25px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 22px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04);
}

.card-title {
    color: #667085;
    font-size: 14px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 25px;
    font-weight: 800;
}

.upload-box {
    margin-top: 22px;
    background: white;

    border: 2px dashed #c7d2fe;
    border-radius: 15px;

    padding: 40px;

    text-align: center;
}

.upload-icon {
    font-size: 50px;
}

.file-button,
.primary,
.success-button {
    display: inline-block;

    padding: 12px 22px;

    border: none;
    border-radius: 8px;

    color: white;

    font-weight: bold;

    cursor: pointer;
}

.file-button,
.primary {
    background: #4f46e5;
}

.success-button {
    background: #10b981;
}

.file-button:hover,
.primary:hover {
    background: #4338ca;
}

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

input[type="file"] {
    display: none;
}

.selected-file {
    margin: 15px;
    color: #4f46e5;
    font-weight: bold;
}

.message {
    display: none;

    margin-top: 18px;

    padding: 13px;

    border-radius: 8px;

    text-align: left;
}

.message.show {
    display: block;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.message.info {
    background: #dbeafe;
    color: #1e40af;
}

.progress-wrap {
    display: none;
    margin-top: 25px;
    text-align: left;
}

.progress-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: bold;
}

.progress {
    width: 100%;
    height: 13px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: #4f46e5;
    transition: width 0.2s;
}

.small {
    color: #667085;
    font-size: 13px;
}

.input {
    width: 100%;

    padding: 15px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    outline: none;

    font-size: 15px;
}

.input:focus {
    border-color: #4f46e5;
}

.answer {
    display: none;

    margin-top: 20px;

    padding: 20px;

    background: #f9fafb;

    border-left: 4px solid #4f46e5;

    border-radius: 8px;

    white-space: pre-wrap;

    line-height: 1.7;
}

.list-item {
    padding: 15px 0;
    border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 850px) {

    .sidebar {
        width: 190px;
    }

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

@media (max-width: 650px) {

    .sidebar {
        display: none;
    }

    main {
        padding: 20px;
    }
}
/* =====================================================
   ASK AI - DARK MODE FIX
===================================================== */

html[data-dark-mode="on"] .answer-box {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

html[data-dark-mode="on"] .answer-result {
    background: #111827 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

html[data-dark-mode="on"] .answer-result p {
    color: #e5e7eb !important;
}

html[data-dark-mode="on"] .result-header {
    color: #f9fafb !important;
}

html[data-dark-mode="on"] .result-header span {
    color: #9ca3af !important;
}

html[data-dark-mode="on"] .answer-heading {
    color: #f9fafb !important;
}

html[data-dark-mode="on"] .empty-state {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

html[data-dark-mode="on"] .empty-state h3 {
    color: #f9fafb !important;
}

html[data-dark-mode="on"] .empty-state p {
    color: #d1d5db !important;
}

html[data-dark-mode="on"] .loading {
    color: #e5e7eb !important;
}