/* ===== MEJ DX Platform — Design System ===== */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #059669;
    --secondary-light: #D1FAE5;
    --accent: #D97706;
    --accent-light: #FEF3C7;
    --error: #DC2626;
    --error-light: #FEE2E2;
    --bg: #F1F5F9;
    --surface: #FFFFFF;
    --sidebar-bg: #0F172A;
    --sidebar-hover: #1E293B;
    --sidebar-active: #1D4ED8;
    --text: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Noto Sans JP', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Sidebar ===== */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: #CBD5E1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: white;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.logo-subtitle {
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
}

.nav-section-label {
    padding: 16px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #475569;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #94A3B8;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-item.active {
    background: rgba(37, 99, 235, 0.15);
    color: white;
    border-right: 3px solid var(--primary);
}

.nav-item.active .nav-icon {
    filter: none;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-badge.warn {
    background: var(--accent);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #7C3AED);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.user-role {
    font-size: 11px;
    color: var(--text-light);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    gap: 8px;
}

.search-icon { font-size: 14px; }
.search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    width: 200px;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
    padding: 4px;
}

.notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--error);
    border-radius: 50%;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.lang-active {
    color: var(--primary);
    font-weight: 600;
}

.lang-divider { color: var(--border); }

/* ===== Page Content ===== */
.page-content {
    flex: 1;
    padding: 24px;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.blue { background: var(--primary-light); }
.stat-icon.amber { background: var(--accent-light); }
.stat-icon.green { background: var(--secondary-light); }
.stat-icon.purple { background: #EDE9FE; }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-trend {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary);
}

.stat-trend.up { color: var(--secondary); }

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-link {
    font-size: 13px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-body { padding: 16px 20px; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== Activity List ===== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-title {
    font-size: 13px;
    font-weight: 500;
}

.activity-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.pending {
    background: var(--accent-light);
    color: #B45309;
}

.status-badge.approved {
    background: var(--secondary-light);
    color: #047857;
}

.status-badge.returned {
    background: var(--error-light);
    color: var(--error);
}

/* ===== Bar Chart ===== */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-label {
    width: 100px;
    font-size: 13px;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 5px;
    transition: width 0.8s ease;
}

.bar-fill.amber { background: var(--accent); }
.bar-fill.green { background: var(--secondary); }
.bar-fill.purple { background: #7C3AED; }

.bar-value {
    width: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-note {
    margin-top: 16px;
    padding: 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--primary-dark);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-success { background: var(--secondary); color: white; }
.btn-success:hover { background: #047857; }
.btn-warn { background: var(--accent); color: white; }
.btn-warn:hover { background: #B45309; }
.btn-danger { background: var(--error); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    transition: var(--transition);
}
.btn-icon:hover { transform: scale(1.2); }

/* ===== Tables ===== */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    font-size: 13px;
    border-top: 1px solid var(--border-light);
}

.data-table tbody tr:hover {
    background: #F8FAFC;
}

.id-link {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

.type-badge {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.type-badge.travel { background: #DBEAFE; color: #1D4ED8; }
.type-badge.expense { background: #FEF3C7; color: #B45309; }
.type-badge.purchase { background: #D1FAE5; color: #047857; }
.type-badge.leave { background: #EDE9FE; color: #6D28D9; }

/* ===== Page Actions ===== */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

.filter-select, .filter-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    background: var(--surface);
    outline: none;
}

.filter-select:focus, .filter-input:focus {
    border-color: var(--primary);
}

/* ===== Approval Page ===== */
.approval-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    background: var(--error);
    color: white;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 4px;
}

.approval-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.approval-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--accent);
}

.approval-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

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

.approval-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.approval-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.approval-name {
    font-weight: 600;
    font-size: 14px;
}

.approval-dept {
    font-size: 12px;
    color: var(--text-secondary);
}

.approval-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.approval-title {
    font-size: 15px;
    margin-bottom: 8px;
}

.approval-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

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

/* ===== AI Document Page ===== */
.ai-doc-layout {
    display: flex;
    gap: 20px;
}

.ai-doc-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.ai-doc-sidebar h3 {
    font-size: 15px;
    margin-bottom: 12px;
}

.template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.template-item:hover { border-color: var(--primary-light); }
.template-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.template-icon { font-size: 24px; }

.template-info {
    display: flex;
    flex-direction: column;
}

.template-name {
    font-weight: 600;
    font-size: 13px;
}

.template-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.ai-doc-main { flex: 1; }

.ai-input-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.ai-input-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.ai-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.form-textarea {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: vertical;
    transition: var(--transition);
}

.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.lang-buttons {
    display: flex;
    gap: 8px;
}

.lang-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

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

.file-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.file-tag {
    background: var(--bg);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.btn-add-file {
    background: none;
    border: 1px dashed var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    color: var(--primary);
}

.ai-output-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.ai-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.ai-output-header h3 { font-size: 15px; }

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

.ai-output-content {
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
}

.ai-output-footer {
    padding: 12px 20px;
    background: var(--bg);
    border-top: 1px solid var(--border-light);
}

.ai-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.sources-label { font-weight: 600; }

.source-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
}

/* ===== Knowledge Page ===== */
.knowledge-layout {
    max-width: 900px;
    margin: 0 auto;
}

.knowledge-hero {
    text-align: center;
    margin-bottom: 24px;
}

.knowledge-hero h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.knowledge-hero p {
    color: var(--text-secondary);
    font-size: 14px;
}

.knowledge-search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.knowledge-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    resize: none;
    transition: var(--transition);
}

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

.knowledge-examples {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.example-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.example-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.ai-answer-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.ai-answer-header {
    padding: 12px 16px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
}

.ai-answer-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
}

.results-heading {
    font-size: 15px;
    margin-bottom: 12px;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-item {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.result-item:hover {
    box-shadow: var(--shadow-md);
}

.result-icon { font-size: 24px; }

.result-info { flex: 1; }

.result-title {
    font-weight: 500;
    font-size: 13px;
}

.result-match {
    font-size: 11px;
    color: var(--secondary);
    font-weight: 600;
}

.result-page {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ===== File Tags ===== */
.cat-badge {
    background: var(--bg);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ai-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    margin-right: 4px;
}

.file-icon { margin-right: 8px; }

.storage-info {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.storage-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.storage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

.storage-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ===== Settings ===== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.settings-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 24px;
    transition: var(--transition);
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 18px; }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body { padding: 24px; }

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1E293B;
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 300;
    font-size: 13px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ===== Typing Animation ===== */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary);
    animation: blink 0.8s infinite;
    margin-left: 2px;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
