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

/* ── Design Tokens ──────────────────────────────────────── */

:root {
    --emami-red:       #C0272D;
    --emami-red-dark:  #9B1D22;
    --emami-red-light: #FDF2F2;
    --emami-red-mid:   #F5C6C7;
    --emami-gold:      #C8972B;
    --emami-gold-light:#FDF6E7;
    --emami-gold-mid:  #F0D89A;
    --dark:            #1E1E1E;
    --gray:            #6B7280;
    --lgray:           #F9F9F9;
    --border:          #E8E0E0;
    --white:           #FFFFFF;
    --shadow-sm:       0 1px 3px rgba(0,0,0,0.08);
    --shadow-md:       0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg:       0 8px 24px rgba(0,0,0,0.12);
}

/* ── Reset ──────────────────────────────────────────────── */

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--lgray);
    color: var(--dark);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════
   CHATBOT PAGE LAYOUT
   ═══════════════════════════════════════════════════════════ */

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

/* ── Header ─────────────────────────────────────────────── */

.header {
    height: 58px;
    min-height: 58px;
    background: var(--white);
    border-bottom: 2px solid var(--emami-red);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    flex-shrink: 0;
}

.header-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--emami-red);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-titles {
    flex: 1;
    min-width: 0;
}

.header-titles h1 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 0.04em;
    line-height: 1.2;
}

.header-titles p {
    font-size: 0.72rem;
    color: var(--gray);
    font-weight: 400;
    line-height: 1.3;
}

.header-badge {
    background: var(--emami-red-light);
    color: var(--emami-red);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--emami-red-mid);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.header-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--emami-red);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.header-admin-link {
    font-size: 0.72rem;
    color: var(--gray);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.header-admin-link:hover {
    background: var(--emami-red-light);
    color: var(--emami-red);
}

/* ── Main (chat + sidebar) ──────────────────────────────── */

.main {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
}

/* ── Chat Area ──────────────────────────────────────────── */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--white);
    border-right: 1px solid var(--border);
    min-width: 0;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Welcome / Empty State ──────────────────────────────── */

.welcome-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 40px 24px;
    gap: 8px;
}

.welcome-state .welcome-icon {
    width: 56px;
    height: 56px;
    background: var(--emami-red-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.welcome-state h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.3;
}

.welcome-state p {
    font-size: 0.875rem;
    color: var(--gray);
    max-width: 380px;
    line-height: 1.6;
}

.welcome-state .tagline {
    font-size: 0.78rem;
    color: var(--emami-gold);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-top: 4px;
    text-transform: uppercase;
}

/* ── Message Bubbles ────────────────────────────────────── */

.message {
    max-width: 76%;
    font-size: 0.875rem;
    line-height: 1.65;
    word-wrap: break-word;
    animation: fadeUp 0.22s ease-out;
}

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

.message.user {
    align-self: flex-end;
    background: var(--emami-red);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 18px 18px 4px 18px;
    font-weight: 450;
    box-shadow: var(--shadow-sm);
}

.message.bot {
    align-self: flex-start;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 84%;
}

.bot-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--emami-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.message-content {
    background: var(--lgray);
    border: 1px solid var(--border);
    border-radius: 4px 16px 16px 16px;
    padding: 12px 16px;
    flex: 1;
    min-width: 0;
}

/* ── Markdown inside bot messages ───────────────────────── */

.message-content p {
    margin: 0 0 8px;
    color: var(--dark);
}

.message-content p:last-child { margin-bottom: 0; }

.message-content strong {
    color: var(--dark);
    font-weight: 600;
}

.message-content em {
    color: var(--gray);
    font-style: italic;
}

.message-content ul,
.message-content ol {
    margin: 6px 0 10px 20px;
    color: var(--dark);
}

.message-content li { margin-bottom: 4px; }

.message-content li::marker { color: var(--emami-red); }

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    color: var(--dark);
    margin: 12px 0 6px;
    font-weight: 600;
}

.message-content h1 { font-size: 1.1rem; }
.message-content h2 { font-size: 1rem; }
.message-content h3 { font-size: 0.93rem; }
.message-content h4 { font-size: 0.875rem; }

.message-content code {
    background: var(--emami-red-light);
    color: var(--emami-red-dark);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.message-content pre {
    background: var(--dark);
    border-radius: 8px;
    padding: 12px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content pre code {
    background: none;
    color: #f9b8bb;
    padding: 0;
    font-size: 0.82rem;
}

.message-content blockquote {
    border-left: 3px solid var(--emami-red);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--gray);
}

.message-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 12px 0;
}

.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.82rem;
}

.message-content thead th {
    background: var(--emami-red-light);
    color: var(--emami-red-dark);
    font-weight: 600;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--emami-red-mid);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.message-content tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--dark);
}

.message-content tbody tr:last-child td { border-bottom: none; }
.message-content tbody tr:hover { background: var(--emami-red-light); }

/* ── Source Block ────────────────────────────────────────── */

.source-block {
    margin-top: 10px;
    border-left: 3px solid var(--emami-red);
    background: var(--emami-red-light);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
}

.source-block-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--emami-gold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.source-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    border: 1px solid var(--emami-red-mid);
    color: var(--emami-red-dark);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
}

/* ── Follow-up Buttons ───────────────────────────────────── */

.follow-ups {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.follow-up-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--dark);
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.follow-up-btn:hover {
    border-color: var(--emami-red);
    color: var(--emami-red);
    background: var(--emami-red-light);
}

.follow-up-btn svg {
    flex-shrink: 0;
    color: var(--emami-red);
}

/* ── Typing Indicator ────────────────────────────────────── */

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emami-red);
    animation: dotBounce 1.4s infinite ease-in-out;
    opacity: 0.7;
}

.typing-dots span:nth-child(2) { animation-delay: 0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
    40%           { transform: scale(1);    opacity: 1; }
}

/* ── Input Area ─────────────────────────────────────────── */

.input-area {
    padding: 12px 20px 14px;
    border-top: 1px solid var(--border);
    background: var(--white);
    flex-shrink: 0;
}

.chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.chip {
    display: inline-block;
    background: var(--emami-gold-light);
    border: 1px solid var(--emami-gold-mid);
    color: #7a5a12;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.chip:hover {
    background: var(--emami-gold-mid);
    border-color: var(--emami-gold);
    color: #5a3e08;
}

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

.btn-mic {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    cursor: default;
    opacity: 0.65;
}

.input-row input[type="text"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--lgray);
    color: var(--dark);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-row input[type="text"]:focus {
    border-color: var(--emami-red);
    box-shadow: 0 0 0 3px rgba(192, 39, 45, 0.10);
    background: var(--white);
}

.input-row input[type="text"]::placeholder { color: #adb5bd; }

.btn-send {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--emami-red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn-send:hover  { background: var(--emami-red-dark); box-shadow: var(--shadow-md); }
.btn-send:active { transform: scale(0.95); }
.btn-send:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

/* ── Sidebar ────────────────────────────────────────────── */

.sidebar {
    width: 244px;
    min-width: 244px;
    background: var(--lgray);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* Brand strip (Emami product brands) */
.brand-strip {
    background: var(--emami-red);
    padding: 7px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    flex-shrink: 0;
}

.brand-name {
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-name.gold { color: var(--emami-gold-mid); }

/* Sidebar card */
.sidebar-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 10px 12px 0;
    overflow: hidden;
}

.sidebar-card-header {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 7px;
}

.sidebar-card-header-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: var(--emami-red-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-card-title {
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-card-body {
    padding: 10px 12px;
}

/* Knowledge source items */
.ks-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.ks-item:last-child { border-bottom: none; }

.ks-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emami-gold);
    flex-shrink: 0;
}

.ks-name {
    font-size: 0.76rem;
    color: var(--dark);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.ks-badge {
    font-size: 0.62rem;
    font-weight: 600;
    background: var(--emami-red-light);
    color: var(--emami-red);
    padding: 1px 5px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* AI usage stats */
.usage-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
}

.usage-stat:last-child { border-bottom: none; }

.usage-stat-label {
    font-size: 0.73rem;
    color: var(--gray);
}

.usage-stat-value {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--dark);
}

.usage-stat-value.red   { color: var(--emami-red); }
.usage-stat-value.gold  { color: var(--emami-gold); }

/* Integration items */
.integ-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.integ-item:last-child { border-bottom: none; }

.integ-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    color: var(--white);
}

.integ-icon.sp  { background: #0078d4; }
.integ-icon.sap { background: #1a6932; }
.integ-icon.ps  { background: #6b21a8; }

.integ-info { flex: 1; min-width: 0; }

.integ-name {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.integ-status {
    font-size: 0.65rem;
    color: var(--gray);
}

.integ-badge {
    font-size: 0.6rem;
    font-weight: 600;
    background: var(--emami-gold-light);
    color: var(--emami-gold);
    padding: 1px 5px;
    border-radius: 10px;
    border: 1px solid var(--emami-gold-mid);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Sidebar footer */
.sidebar-footer {
    margin: 10px 12px 12px;
    padding: 10px 12px;
    background: var(--emami-red-light);
    border: 1px solid var(--emami-red-mid);
    border-radius: 8px;
    text-align: center;
}

.sidebar-footer .footer-brand {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--emami-red-dark);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-footer .footer-addr {
    font-size: 0.65rem;
    color: var(--gray);
    margin-top: 2px;
    line-height: 1.4;
}

.sidebar-footer .footer-stats {
    font-size: 0.65rem;
    color: var(--emami-red);
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PAGE
   ═══════════════════════════════════════════════════════════ */

.admin-body {
    background: var(--lgray);
    min-height: 100vh;
}

.admin-header {
    background: var(--white);
    border-bottom: 2px solid var(--emami-red);
    padding: 0 28px;
    height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.admin-header h1 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 0.04em;
}

.admin-header p {
    font-size: 0.72rem;
    color: var(--gray);
}

.admin-header-titles { flex: 1; }

.admin-back-link {
    font-size: 0.76rem;
    color: var(--emami-red);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.admin-back-link:hover { color: var(--emami-red-dark); }

.admin-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 28px 20px;
}

/* ── Upload Zone ─────────────────────────────────────────── */

.upload-zone {
    border: 2px dashed var(--emami-red-mid);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.22s;
    margin-bottom: 24px;
    background: var(--emami-red-light);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--emami-red);
    background: #fce8e8;
    box-shadow: 0 0 0 4px rgba(192,39,45,0.07);
}

.upload-zone:hover .upload-icon,
.upload-zone.dragover .upload-icon {
    stroke: var(--emami-red);
}

.upload-icon { margin-bottom: 12px; stroke: var(--emami-red-mid); }

.upload-zone p {
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.upload-zone .formats {
    font-size: 0.75rem;
    color: var(--gray);
    margin-top: 6px;
}

/* ── Stats Bar ───────────────────────────────────────────── */

.stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

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

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--emami-red-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--emami-red);
    line-height: 1;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 2px;
}

/* ── Section Title ───────────────────────────────────────── */

.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 14px;
    background: var(--emami-red);
    border-radius: 2px;
}

/* ── Doc List ────────────────────────────────────────────── */

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: box-shadow 0.15s, border-color 0.15s;
    box-shadow: var(--shadow-sm);
}

.doc-item:hover {
    border-color: var(--emami-red-mid);
    box-shadow: var(--shadow-md);
}

.doc-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--emami-red-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-info { flex: 1; min-width: 0; }

.doc-info .name {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-info .meta {
    font-size: 0.73rem;
    color: var(--gray);
    margin-top: 2px;
}

/* ── Buttons ─────────────────────────────────────────────── */

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: var(--emami-red);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover  { background: var(--emami-red-dark); box-shadow: var(--shadow-md); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-danger {
    background: var(--emami-red-light);
    color: var(--emami-red);
    border: 1px solid var(--emami-red-mid);
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-danger:hover { background: #fcd5d6; border-color: var(--emami-red); }

/* ── Progress Bar ────────────────────────────────────────── */

.progress-bar {
    height: 4px;
    background: var(--emami-red-mid);
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
    display: none;
}

.progress-bar .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--emami-red), var(--emami-gold));
    width: 0%;
    transition: width 0.3s;
    border-radius: 2px;
}

/* ── Toast ───────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--white);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: #16a34a; }
.toast.error   { background: var(--emami-red); }

/* ── Empty State ─────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-state svg { margin-bottom: 12px; opacity: 0.4; }

.empty-state p { font-size: 0.875rem; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar { display: none; }
    .message { max-width: 88%; }
    .message.bot { max-width: 94%; }
    .chips { gap: 4px; }
    .chip { font-size: 0.7rem; padding: 4px 9px; }
}

@media (max-width: 480px) {
    .admin-container { padding: 16px 12px; }
    .stats-bar { flex-direction: column; }
    .header { padding: 0 12px; }
    .header-badge { display: none; }
}
