/* 
   SMARTDOCTORS Premium Minimalist UI
   High-End Clinical Aesthetic
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #F1F5F9;
    /* Light Gray / Slate 100 */
    --bg-white: #FFFFFF;
    --accent-blue: #2563EB;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.03);
    --shadow-large: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* TOP NAVBAR */
.top-nav {
    background: var(--bg-white);
    height: 70px;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    z-index: 100;
    flex-shrink: 0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--accent-blue);
    min-width: 20px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 1.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-main);
    border-bottom-color: var(--accent-blue);
}

.nav-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.user-nav-form {
    margin: 0;
}

.user-select-box {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.user-select-box:hover {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.user-select-icon {
    font-size: 0.9rem;
    opacity: 0.7;
}

.user-select-box select,
.user-select-box .ts-wrapper {
    border: none !important;
    background: transparent !important;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    min-width: 200px;
}
.user-select-box .ts-control {
    border: none !important;
    background: transparent !important;
    padding: 0 0.5rem 0 0 !important;
    box-shadow: none !important;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
}
.user-select-box .ts-control input {
    font-size: 0.9rem;
    font-weight: 500;
}
.ts-dropdown {
    font-size: 0.9rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    margin-top: 8px;
    z-index: 99999 !important;
    background: #fff !important;
}
.ts-dropdown .option {
    padding: 0.7rem 1rem;
    cursor: pointer;
    color: #1e293b;
    background: #fff;
}
.ts-dropdown .option:hover,
.ts-dropdown .option.active {
    background: #22c55e !important;
    color: #fff !important;
}
.ts-dropdown .option:active {
    background: #16a34a !important;
    color: #fff !important;
}
.user-select-box .item {
    color: var(--text-main);
}
.user-select-box:hover .item {
    color: var(--primary-color);
}

.qa-user-badge {
    font-size: 0.7rem;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.01em;
}

.qa-user-badge b {
    color: var(--primary-color);
}

/* MAIN AREA */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.panel {
    display: none;
    width: 100%;
    max-width: 1300px;
    margin-top: 1rem;
    padding-bottom: 8rem;
}

.panel.active {
    display: block;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    text-align: center;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

/* CHAT MESSAGES */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.chat-message-row {
    display: flex;
    width: 100%;
}

.user-row {
    justify-content: flex-end;
}

.ai-row {
    justify-content: flex-start;
}

.user-bubble {
    background: var(--bg-white);
    padding: 1rem 1.5rem;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.result-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    width: 100%;
    min-width: 0;
}

.results-container {
    width: 100%;
    /* min-width: 45vw; */
    min-width: 55vw;
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

.result-answer {
    font-size: 1.15rem;
    line-height: 1.7;
    font-weight: 500;
    color: var(--text-main);
}

.result-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-white);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.chat-welcome h2 {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.chat-welcome p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.source-item {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.source-content {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-main);
}

.result-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--accent-blue);
    margin-bottom: 0.25rem;
    margin-top: 1rem;
}

.result-label:first-child {
    margin-top: 0;
}

.match-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #EFF6FF;
    color: var(--accent-blue);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 1rem;
    border: 1px solid #DBEAFE;
}

.qa-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
}

.qa-question {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-blue);
}

.qa-answer {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

.qa-date {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: #F1F5F9;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 500;
}

.qa-actions-wrapper {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #F1F5F9;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.action-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.source-meta {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.meta-value {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.chat-input-footer {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    padding: 0 1.5rem;
}

.chat-input-wrap {
    background: var(--bg-white);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.chat-input-wrap input,
.chat-input-wrap textarea {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    padding: 0.5rem 0;
    resize: none;
    background: transparent;
}

.chat-send-btn {
    background: var(--accent-blue);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    margin-left: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    background: #1d4ed8;
}

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-group textarea {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    font-family: inherit;
    font-size: 1rem;
    background: #F8FAFC;
    transition: all 0.2s;
    resize: none;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-cancel {
    background: #F1F5F9;
    color: var(--text-muted);
}

.btn-cancel:hover {
    background: #E2E8F0;
}

/* KB SEARCH */
.kb-search-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1.5rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.kb-search-wrap {
    width: 100%;
    background: var(--bg-white);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.kb-search-wrap:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.kb-search-wrap input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: var(--text-main);
}

.kb-search-wrap input::placeholder {
    color: var(--text-muted);
}

.kb-search-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    min-height: 1.2rem;
}

.qa-card.hidden {
    display: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: var(--bg-white);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    margin-top: 1rem;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.85;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.empty-state-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2.5rem;
    right: 2.5rem;
    width: 64px;
    height: 64px;
    border-radius: 32px;
    background: var(--accent-blue);
    color: white;
    border: none;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 50;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
}

.fab-icon {
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
}

/* FLASH MESSAGES */
.flash-message {
    padding: 1rem 2rem;
    background: #1E293B;
    color: white;
    border-radius: 100px;
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    font-weight: 600;
}

/* AUTH PAGES (Login / Register) */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: var(--bg-main);
}

.auth-card {
    background: var(--bg-white);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
    text-align: center;
}

.auth-card .logo-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-weight: 500;
}

.auth-card .form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.auth-card .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.auth-card .form-group input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    background: #F8FAFC;
    transition: all 0.2s;
    color: var(--text-main);
}

.auth-card .form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background: var(--accent-blue);
    color: white;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.auth-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}

.auth-links {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--accent-blue);
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}

.auth-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ===== HAMBURGER MENU ===== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-main);
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== ADMIN DASHBOARD CLASSES ===== */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.stat-card-watermark {
    position: absolute;
    right: -10px;
    top: -10px;
    font-size: 5rem;
    opacity: 0.03;
    transform: rotate(15deg);
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.stat-card-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-progress {
    margin-top: 1rem;
    height: 4px;
    background: #f1f5f9;
    border-radius: 2px;
}

.stat-progress-bar {
    height: 100%;
    border-radius: 2px;
}

.health-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.health-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.misses-card {
    background: var(--bg-white);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-large);
}

.misses-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.misses-badge {
    font-size: 0.75rem;
    background: #fee2e2;
    color: #b91c1c;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
}

.misses-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.admin-table th {
    padding: 1.2rem 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.admin-table td {
    padding: 1.2rem 1.5rem;
}

.admin-table tr {
    border-bottom: 1px solid #f1f5f9;
}

.uid-pill {
    font-size: 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.freq-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
}

.user-action-btn {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-width: 1px;
    border-style: solid;
    font-size: 0.85rem;
}

.user-action-btn:hover {
    opacity: 0.8;
}

.btn-reset {
    background: rgba(245, 158, 11, 0.1);
    color: rgb(245, 158, 11);
    border-color: rgba(245, 158, 11, 0.3);
}

.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    color: rgb(239, 68, 68);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===== RESPONSIVE: TABLET ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel {
        max-width: 100%;
    }
}

/* ===== RESPONSIVE: MOBILE ===== */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    .hamburger-btn {
        display: block;
    }

    .top-nav {
        height: 56px;
        padding: 0 0.75rem;
        position: sticky;
        top: 0;
    }

    .nav-left {
        gap: 0;
        flex-shrink: 0;
    }

    .logo-text {
        display: none;
    }

    .nav-right {
        display: flex;
        flex: 1;
        justify-content: flex-end;
    }

    .user-select-box {
        padding: 0.35rem 0.6rem;
        background: #f0f4f8;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        gap: 0.3rem;
    }
    .user-select-icon {
        font-size: 0.8rem;
    }
    .user-select-box select {
        min-width: 0;
        max-width: 180px;
        font-size: 0.8rem;
        -webkit-appearance: none;
        appearance: none;
        background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right center;
        padding-right: 14px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background: var(--bg-white);
        padding: 1rem;
        gap: 0;
        z-index: 150;
        border-top: 1px solid var(--border-color);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-item {
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        border-left: 3px solid transparent;
        font-size: 1rem;
    }

    .nav-item.active {
        border-left-color: var(--accent-blue);
        background: #f8fafc;
        border-bottom-color: var(--border-color);
    }

    .main-content {
        padding: 1rem 0.75rem;
    }

    .panel {
        padding-bottom: 6rem;
    }

    .panel-title {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }

    .results-container {
        min-width: 0;
        width: 100%;
    }

    .result-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .user-bubble {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
        border-radius: 14px;
    }

    .result-answer {
        font-size: 1rem;
    }

    .qa-card {
        padding: 1rem;
    }

    .chat-welcome {
        padding: 2rem 1rem;
    }

    .chat-welcome h2 {
        font-size: 1.5rem;
    }

    .chat-welcome p {
        font-size: 0.95rem;
    }

    .chat-input-footer {
        bottom: 1rem;
        padding: 0 0.5rem;
    }

    .chat-input-wrap {
        padding: 0.5rem 1rem;
    }

    .chat-input-wrap input {
        font-size: 0.95rem;
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
        margin-left: 0.5rem;
    }

    .fab {
        bottom: 5rem;
        right: 1.25rem;
        width: 52px;
        height: 52px;
    }

    .fab-icon {
        font-size: 1.5rem;
    }

    .modal {
        padding: 1.5rem;
        margin: 0.75rem;
        max-width: calc(100% - 1.5rem);
        border-radius: 16px;
    }

    .modal-title {
        font-size: 1.15rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-card h2 {
        font-size: 1.25rem;
    }

    .source-content {
        font-size: 0.95rem;
    }

    .hidden-on-mobile {
        display: none;
    }

    /* Stats page mobile */
    .stats-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .health-badge {
        align-self: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .stat-card-value {
        font-size: 1.6rem;
    }

    .stat-card-watermark {
        display: none;
    }

    /* Tables → compact card layout on mobile */
    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 0.75rem;
        border-bottom: 1px solid var(--border-color);
        gap: 0.25rem 0.75rem;
        align-items: center;
    }

    .admin-table td {
        padding: 0.15rem 0;
        font-size: 0.9rem;
    }

    .admin-table td::before {
        content: attr(data-label);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.03em;
        margin-right: 0.3rem;
    }

    .admin-table td[data-label] {
        display: inline-flex;
        align-items: baseline;
        gap: 0.2rem;
    }

    .misses-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        padding: 1rem;
    }

    .misses-badge {
        margin-left: 0;
    }

    .misses-footer {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }

    /* History table compact mobile */
    .history-table thead {
        display: none;
    }

    .history-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        padding: 0.6rem 0.5rem;
        border-bottom: 1px solid var(--border-color);
        gap: 0.15rem 0.6rem;
        align-items: center;
    }

    .history-table td {
        padding: 0.1rem 0;
        font-size: 0.85rem;
    }

    .history-table td::before {
        content: attr(data-label);
        font-size: 0.6rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-right: 0.25rem;
    }

    .history-table td[data-label] {
        display: inline-flex;
        align-items: baseline;
        gap: 0.15rem;
    }

    .history-table td[data-label="Ερώτηση"] {
        flex-basis: 100%;
        font-weight: 600;
        font-size: 0.95rem;
    }

    .history-table td[data-label="Ερώτηση"]::before {
        display: none;
    }

    /* Users table mobile */
    .user-actions-row {
        flex-direction: row !important;
        gap: 0.5rem;
    }

    /* KB search mobile */
    .kb-search-container {
        margin-bottom: 1rem;
    }

    .kb-search-wrap {
        padding: 0.5rem 1rem;
    }
}

/* ===== RESPONSIVE: SMALL PHONES ===== */
@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card-value {
        font-size: 1.4rem;
    }

    .nav-item {
        font-size: 0.9rem;
    }
}