/**
 * AI Municipal Hub - Styles
 */

:root {
    --aimh-primary: #2563eb;
    --aimh-primary-dark: #1d4ed8;
    --aimh-secondary: #64748b;
    --aimh-success: #10b981;
    --aimh-warning: #f59e0b;
    --aimh-error: #ef4444;
    --aimh-bg: #f8fafc;
    --aimh-card: #ffffff;
    --aimh-text: #1e293b;
    --aimh-text-light: #64748b;
    --aimh-border: #e2e8f0;
    --aimh-shadow: 0 1px 3px rgba(0,0,0,0.1);
    --aimh-shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --aimh-radius: 8px;
    --aimh-radius-lg: 12px;
}

/* Base */
.aimh-dashboard, .aimh-chatbot, .aimh-requests-page, .aimh-meetings-page, .aimh-agenda-builder, .aimh-settings {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--aimh-text);
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============ BUTTONS ============ */
.aimh-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--aimh-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.aimh-btn-primary { background: var(--aimh-primary); color: white; }
.aimh-btn-primary:hover { background: var(--aimh-primary-dark); }
.aimh-btn-secondary { background: var(--aimh-bg); color: var(--aimh-text); border: 1px solid var(--aimh-border); }
.aimh-btn-secondary:hover { background: #e2e8f0; }
.aimh-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============ FORMS ============ */
.aimh-input, .aimh-select, .aimh-textarea {
    padding: 10px 14px;
    border: 1px solid var(--aimh-border);
    border-radius: var(--aimh-radius);
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.aimh-input:focus, .aimh-select:focus, .aimh-textarea:focus {
    outline: none;
    border-color: var(--aimh-primary);
}

.aimh-form-group { margin-bottom: 16px; }
.aimh-form-group label { display: block; font-weight: 500; margin-bottom: 6px; }
.aimh-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.aimh-form-full { grid-column: 1 / -1; }
.aimh-form-row { display: flex; gap: 16px; }
.aimh-form-row .aimh-form-group { flex: 1; }
.aimh-field-help { font-size: 12px; color: var(--aimh-text-light); margin-top: 4px; }

/* ============ DASHBOARD ============ */
.aimh-dash-header { margin-bottom: 24px; text-align: center; }
.aimh-dash-header h1 { margin: 0; font-size: 32px; }
.aimh-dash-header p { margin: 8px 0 0; color: var(--aimh-text-light); }

.aimh-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 30px;
}

@media (max-width: 900px) {
    .aimh-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .aimh-stats-grid { grid-template-columns: 1fr; }
}

.aimh-stat-card {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--aimh-shadow);
    border: 1px solid var(--aimh-border);
    text-decoration: none;
    display: block;
    transition: all 0.2s ease;
}

.aimh-stat-link:hover {
    border-color: var(--aimh-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.aimh-stat-link:hover .aimh-stat-value {
    transform: scale(1.1);
}

.aimh-stat-icon { font-size: 28px; display: block; margin-bottom: 8px; }
.aimh-stat-value { 
    font-size: 36px; 
    font-weight: 700; 
    color: var(--aimh-primary); 
    display: block;
    transition: transform 0.2s;
}
.aimh-stat-label { font-size: 13px; color: var(--aimh-text-light); display: block; margin-top: 4px; }

.aimh-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.aimh-action-btn {
    padding: 12px 20px;
    background: var(--aimh-card);
    border: 1px solid var(--aimh-border);
    border-radius: var(--aimh-radius);
    text-decoration: none;
    color: var(--aimh-text);
    font-weight: 500;
    transition: all 0.2s;
}

.aimh-action-btn:hover { border-color: var(--aimh-primary); color: var(--aimh-primary); }
.aimh-action-primary { background: var(--aimh-primary); color: white; border-color: var(--aimh-primary); }
.aimh-action-primary:hover { background: var(--aimh-primary-dark); color: white; }

.aimh-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.aimh-dash-card {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    padding: 20px;
    box-shadow: var(--aimh-shadow);
}

.aimh-dash-card h3 { margin: 0 0 16px; font-size: 16px; }
.aimh-dash-full { grid-column: 1 / -1; }
.aimh-card-link { display: block; text-align: right; margin-top: 12px; color: var(--aimh-primary); text-decoration: none; font-size: 14px; }

.aimh-mini-map { height: 300px; border-radius: var(--aimh-radius); }

/* List Items */
.aimh-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    margin-bottom: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.aimh-list-item:hover {
    background: #e2e8f0;
}

.aimh-list-icon { font-size: 24px; }
.aimh-list-content { flex: 1; }
.aimh-list-content strong { display: block; font-size: 14px; color: var(--aimh-text); }
.aimh-list-content span { font-size: 13px; color: var(--aimh-text-light); }

.aimh-empty-small {
    padding: 20px;
    text-align: center;
    color: var(--aimh-text-light);
    font-size: 14px;
}

.aimh-empty-small a {
    color: var(--aimh-primary);
    text-decoration: none;
}

.aimh-empty-small a:hover {
    text-decoration: underline;
}

/* Status */
.aimh-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    text-transform: uppercase;
}

.aimh-status-open { background: #fee2e2; color: #dc2626; }
.aimh-status-in_progress { background: #fef3c7; color: #92400e; }
.aimh-status-closed { background: #dcfce7; color: #16a34a; }

/* ============ CHATBOT ============ */
.aimh-chatbot { max-width: 700px; }

.aimh-chat-container {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    box-shadow: var(--aimh-shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 700px;
}

.aimh-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aimh-chat-title { display: flex; align-items: center; gap: 12px; }
.aimh-chat-avatar { width: 44px; height: 44px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #667eea; }
.aimh-chat-info { display: flex; flex-direction: column; }
.aimh-chat-name { font-weight: 700; font-size: 17px; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.aimh-chat-status { font-size: 13px; color: white; opacity: 0.95; display: flex; align-items: center; gap: 6px; }
.aimh-status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3); }
.aimh-chat-reset { background: rgba(255,255,255,0.25); border: none; color: white; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; transition: all 0.2s; }
.aimh-chat-reset:hover { background: rgba(255,255,255,0.35); transform: rotate(180deg); }

.aimh-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--aimh-bg);
}

.aimh-message { display: flex; gap: 10px; max-width: 85%; animation: aimhFadeIn 0.3s; }
.aimh-message-bot { align-self: flex-start; }
.aimh-message-user { align-self: flex-end; flex-direction: row-reverse; }
.aimh-msg-avatar { 
    width: 36px; 
    height: 36px; 
    background: white;
    border: 2px solid #667eea;
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
    flex-shrink: 0;
    color: #667eea;
}
.aimh-message-user .aimh-msg-avatar { 
    background: #667eea;
    border-color: #667eea;
    color: white;
}
.aimh-msg-content { background: white; padding: 12px 16px; border-radius: 16px; border-top-left-radius: 4px; font-size: 15px; line-height: 1.6; box-shadow: var(--aimh-shadow); color: #1f2937; }
.aimh-msg-content a { color: var(--aimh-primary); }
.aimh-message-user .aimh-msg-content { background: var(--aimh-primary); color: white; border-radius: 16px; border-top-right-radius: 4px; }
.aimh-message-user .aimh-msg-content a { color: #fff; }

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

/* Typing indicator */
.aimh-typing { display: flex; gap: 4px; padding: 12px 16px; background: white; border-radius: 16px; width: fit-content; }
.aimh-typing span { width: 8px; height: 8px; background: var(--aimh-secondary); border-radius: 50%; animation: aimhBounce 1.4s infinite both; }
.aimh-typing span:nth-child(2) { animation-delay: 0.2s; }
.aimh-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aimhBounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Quick buttons */
.aimh-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-quick-btn { padding: 10px 16px; background: var(--aimh-bg); border: 1px solid var(--aimh-border); border-radius: 20px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.aimh-quick-btn:hover { background: var(--aimh-primary); color: white; border-color: var(--aimh-primary); }

/* Categories */
.aimh-categories { padding: 16px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-cat-prompt { margin: 0 0 12px; font-weight: 500; }
.aimh-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.aimh-cat-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; background: var(--aimh-bg); border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); cursor: pointer; transition: all 0.2s; }
.aimh-cat-btn:hover { border-color: var(--aimh-primary); background: #eff6ff; }
.aimh-cat-icon { font-size: 24px; }
.aimh-cat-name { font-size: 12px; text-align: center; }

/* Map panel */
.aimh-map-panel, .aimh-photo-panel, .aimh-summary-panel { padding: 16px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-map-prompt, .aimh-photo-prompt { margin: 0 0 12px; font-weight: 500; }
.aimh-chat-map { height: 220px; border-radius: var(--aimh-radius); }
.aimh-address { margin: 10px 0; font-size: 14px; color: var(--aimh-text-light); }
.aimh-map-actions, .aimh-photo-actions, .aimh-summary-actions { display: flex; gap: 10px; margin-top: 12px; }

/* Photo */
.aimh-photo-preview { margin: 10px 0; }
.aimh-photo-preview img { max-width: 200px; border-radius: var(--aimh-radius); }

/* Summary */
.aimh-summary-panel h4 { margin: 0 0 12px; }
.aimh-summary-content { background: var(--aimh-bg); padding: 16px; border-radius: var(--aimh-radius); margin-bottom: 12px; }
.aimh-summary-row { margin-bottom: 8px; }

/* Meeting Selector for Minutes */
.aimh-meeting-select { padding: 16px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-meeting-list { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; }
.aimh-meeting-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    background: var(--aimh-bg);
    border: 1px solid var(--aimh-border);
    border-radius: var(--aimh-radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.aimh-meeting-btn:hover { border-color: var(--aimh-primary); background: #eff6ff; }
.aimh-meeting-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.aimh-meeting-date { font-size: 12px; color: var(--aimh-text-light); }

/* Minutes Recording Panel */
.aimh-minutes-panel { padding: 16px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-minutes-panel h4 { margin: 0 0 12px; }
.aimh-minutes-info { font-size: 13px; color: var(--aimh-text-light); margin-bottom: 12px; }
.aimh-minutes-current-item {
    background: var(--aimh-bg);
    padding: 14px;
    border-radius: var(--aimh-radius);
    margin-bottom: 16px;
    border-left: 3px solid var(--aimh-primary);
}
.aimh-minutes-item-num { font-size: 11px; color: var(--aimh-primary); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.aimh-minutes-item-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.aimh-minutes-item-desc { font-size: 13px; color: var(--aimh-text-light); }
.aimh-minutes-form .aimh-form-group { margin-bottom: 12px; }
.aimh-minutes-form label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.aimh-minutes-form .aimh-textarea { width: 100%; padding: 10px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); font-size: 14px; font-family: inherit; resize: vertical; }
.aimh-minutes-form .aimh-input, .aimh-minutes-form .aimh-select { width: 100%; padding: 10px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); font-size: 14px; }
.aimh-minutes-actions { display: flex; gap: 10px; margin-top: 12px; }
.aimh-minutes-progress { font-size: 12px; color: var(--aimh-text-light); margin-top: 12px; text-align: center; }

/* Input */
.aimh-chat-input-area { padding: 16px 20px; background: white; border-top: 1px solid var(--aimh-border); }
.aimh-input-row { display: flex; gap: 10px; align-items: flex-end; }
.aimh-chat-input { flex: 1; padding: 12px 16px; border: 1px solid var(--aimh-border); border-radius: 24px; font-size: 15px; resize: none; max-height: 120px; font-family: inherit; }
.aimh-chat-input:focus { outline: none; border-color: var(--aimh-primary); }
.aimh-send-btn { width: 48px; height: 48px; background: var(--aimh-primary); border: none; border-radius: 50%; color: white; cursor: pointer; font-size: 18px; }
.aimh-disclaimer { margin: 8px 0 0; font-size: 12px; color: var(--aimh-text-light); text-align: center; }

/* ============ REQUESTS MAP - SPLIT LAYOUT ============ */
.aimh-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.aimh-page-header h1 { margin: 0; }

.aimh-split-layout {
    display: flex;
    height: calc(100vh - 200px);
    min-height: 600px;
    gap: 0;
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    overflow: hidden;
    box-shadow: var(--aimh-shadow);
}

.aimh-list-panel {
    width: 420px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--aimh-border);
    background: white;
}

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

.aimh-list-header h2 { margin: 0; font-size: 16px; font-weight: 600; }

.aimh-pagination { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--aimh-text-light); }

.aimh-page-btn {
    width: 28px; height: 28px;
    border: 1px solid var(--aimh-border);
    background: white; border-radius: 4px;
    cursor: pointer; font-size: 16px;
}
.aimh-page-btn:hover { background: var(--aimh-bg); }
.aimh-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.aimh-list-filters {
    display: flex; flex-direction: column; gap: 8px;
    padding: 12px 16px; background: var(--aimh-bg);
    border-bottom: 1px solid var(--aimh-border);
}
.aimh-list-filters .aimh-input, .aimh-list-filters .aimh-select { font-size: 13px; padding: 8px 12px; }

/* Request Cards */
.aimh-request-cards { flex: 1; overflow-y: auto; padding: 0; }

.aimh-request-card {
    display: flex; gap: 12px; padding: 16px;
    border-bottom: 1px solid var(--aimh-border);
    cursor: pointer; transition: background 0.15s;
}
.aimh-request-card:hover { background: #f8fafc; }
.aimh-request-card.active { background: #eff6ff; border-left: 3px solid var(--aimh-primary); }

.aimh-request-thumb {
    width: 60px; height: 60px; border-radius: 6px;
    background: var(--aimh-bg); overflow: hidden; flex-shrink: 0;
}
.aimh-request-thumb img { width: 100%; height: 100%; object-fit: cover; }
.aimh-request-thumb-icon {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.aimh-request-info { flex: 1; min-width: 0; }
.aimh-request-category { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.aimh-request-ticket { font-size: 12px; color: var(--aimh-text-light); margin-bottom: 4px; }
.aimh-request-address { font-size: 13px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aimh-request-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; }

.aimh-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.aimh-status-open { background: #dcfce7; color: #166534; }
.aimh-status-in_progress { background: #fef3c7; color: #92400e; }
.aimh-status-closed { background: #e2e8f0; color: #475569; }

.aimh-request-date { color: var(--aimh-text-light); }
.aimh-request-desc { font-size: 13px; color: var(--aimh-text-light); margin-top: 4px; }

/* Map Panel */
.aimh-map-panel-full { flex: 1; display: flex; flex-direction: column; position: relative; }

.aimh-map-controls {
    position: absolute; top: 12px; left: 12px; right: 12px;
    z-index: 1000; display: flex; gap: 12px; pointer-events: none;
}
.aimh-map-controls > * { pointer-events: auto; }

.aimh-map-search {
    flex: 1; padding: 10px 16px; border: none; border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); font-size: 14px;
}
.aimh-map-search:focus { outline: none; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

.aimh-map-layers { display: flex; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.aimh-layer-btn {
    padding: 10px 16px; border: none; background: white;
    font-size: 12px; font-weight: 600; cursor: pointer; color: var(--aimh-text-light);
}
.aimh-layer-btn:first-child { border-right: 1px solid var(--aimh-border); }
.aimh-layer-btn:hover { background: #f8fafc; }
.aimh-layer-btn.active { background: #1e293b; color: white; }

.aimh-split-layout .aimh-full-map { flex: 1; min-height: 400px; }
.aimh-full-map { height: 400px; border-radius: var(--aimh-radius-lg); }

/* Floating Action Button */
.aimh-fab-report {
    position: fixed; bottom: 24px; right: 24px;
    width: 56px; height: 56px; background: var(--aimh-primary); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    text-decoration: none; z-index: 1000; transition: all 0.2s;
}
.aimh-fab-report:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5); }

@media (max-width: 900px) {
    .aimh-split-layout { flex-direction: column; height: auto; }
    .aimh-list-panel { width: 100%; max-height: 50vh; border-right: none; border-bottom: 1px solid var(--aimh-border); }
    .aimh-map-panel-full { min-height: 400px; }
}

/* ============ MEETINGS ============ */
.aimh-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--aimh-border); padding-bottom: 8px; }
.aimh-tab { padding: 10px 20px; background: none; border: none; cursor: pointer; font-size: 14px; color: var(--aimh-text-light); border-radius: var(--aimh-radius) var(--aimh-radius) 0 0; }
.aimh-tab.active { background: var(--aimh-primary); color: white; }

.aimh-meetings-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.aimh-meeting-card { background: var(--aimh-card); border-radius: var(--aimh-radius); padding: 20px; box-shadow: var(--aimh-shadow); }
.aimh-meeting-board { font-size: 12px; color: var(--aimh-primary); font-weight: 600; text-transform: uppercase; margin-bottom: 4px; }
.aimh-meeting-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.aimh-meeting-datetime, .aimh-meeting-location { font-size: 14px; color: var(--aimh-text-light); margin-bottom: 4px; }
.aimh-meeting-actions { margin-top: 12px; display: flex; gap: 16px; }
.aimh-link { color: var(--aimh-primary); text-decoration: none; font-size: 14px; }

/* ============ AGENDA BUILDER ============ */
.aimh-builder-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.aimh-builder-header h1 { margin: 0; }
.aimh-meeting-form { background: var(--aimh-card); border-radius: var(--aimh-radius-lg); padding: 24px; box-shadow: var(--aimh-shadow); }

.aimh-sections-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 16px; padding-top: 24px; border-top: 1px solid var(--aimh-border); }
.aimh-sections-header h3 { margin: 0; }
.aimh-sections-container { display: flex; flex-direction: column; gap: 16px; }

.aimh-section { background: var(--aimh-bg); border-radius: var(--aimh-radius); padding: 16px; }
.aimh-section-header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.aimh-section-drag { cursor: move; color: var(--aimh-text-light); }
.aimh-section-title { flex: 1; padding: 8px 12px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); }
.aimh-consent-check { display: flex; align-items: center; gap: 4px; font-size: 13px; white-space: nowrap; }
.aimh-remove-section { background: none; border: none; color: var(--aimh-error); cursor: pointer; font-size: 18px; }

.aimh-section-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.aimh-item { background: white; border-radius: var(--aimh-radius); padding: 12px; }
.aimh-item-header { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.aimh-item-drag { cursor: move; color: var(--aimh-text-light); }
.aimh-item-title { flex: 1; padding: 8px 12px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); }
.aimh-remove-item { background: none; border: none; color: var(--aimh-error); cursor: pointer; }
.aimh-item-desc { width: 100%; padding: 8px 12px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); font-family: inherit; resize: vertical; }

.aimh-add-item { width: 100%; padding: 8px; background: white; border: 1px dashed var(--aimh-border); border-radius: var(--aimh-radius); cursor: pointer; color: var(--aimh-text-light); }
.aimh-add-item:hover { border-color: var(--aimh-primary); color: var(--aimh-primary); }

.aimh-form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--aimh-border); }

/* ============ SETTINGS ============ */
.aimh-settings-section { background: var(--aimh-card); border-radius: var(--aimh-radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--aimh-shadow); }
.aimh-settings-section h2 { margin: 0 0 20px; font-size: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--aimh-border); }

/* ============ TOAST ============ */
.aimh-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    background: #1e293b;
    color: white;
    border-radius: var(--aimh-radius);
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s;
}

.aimh-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.aimh-toast.error { background: var(--aimh-error); }
.aimh-toast.success { background: var(--aimh-success); }

/* ============ MISC ============ */
.aimh-notice { padding: 20px; background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--aimh-radius); text-align: center; }
.aimh-empty { text-align: center; padding: 40px; color: var(--aimh-text-light); }
.aimh-loading { text-align: center; padding: 40px; color: var(--aimh-text-light); }

/* ============ WIDGET ============ */
.aimh-widget { 
    position: fixed; 
    bottom: 20px; 
    right: 20px; 
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Closed state with character */
.aimh-widget-closed {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.aimh-widget-bubble {
    background: white;
    padding: 12px 16px;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    font-size: 14px;
    color: #1f2937;
    max-width: 180px;
    position: relative;
    animation: aimh-bubble-appear 0.3s ease;
}

.aimh-widget-bubble span {
    display: block;
    padding-right: 16px;
}

.aimh-bubble-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.aimh-bubble-close:hover {
    color: #6b7280;
}

@keyframes aimh-bubble-appear {
    from { opacity: 0; transform: translateY(10px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.aimh-widget-toggle { 
    width: 70px; 
    height: 70px; 
    border-radius: 50%; 
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border: 3px solid white;
    cursor: pointer; 
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
    padding: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aimh-widget-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(37, 99, 235, 0.5);
}

.aimh-widget-avatar {
    width: 50px;
    height: 50px;
}

/* Popup styles */
.aimh-widget-popup { 
    position: absolute; 
    bottom: 85px; 
    right: 0; 
    width: 380px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: aimh-popup-appear 0.25s ease;
}

@keyframes aimh-popup-appear {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.aimh-widget-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aimh-widget-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aimh-widget-title {
    font-weight: 600;
    font-size: 15px;
}

.aimh-widget-status {
    font-size: 12px;
    opacity: 0.9;
}

.aimh-widget-status::before {
    color: #4ade80;
}

.aimh-widget-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.aimh-widget-close:hover {
    background: rgba(255,255,255,0.3);
}

.aimh-widget-popup .aimh-chat-container { 
    height: 450px;
    border-radius: 0;
    box-shadow: none;
}

.aimh-widget-popup .aimh-chat-header {
    display: none; /* Hide inner header since we have widget header */
}

.aimh-mode-widget .aimh-chat-container { height: 450px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .aimh-chat-container { height: 100vh; border-radius: 0; }
    .aimh-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .aimh-quick-actions { justify-content: stretch; }
    .aimh-action-btn { flex: 1; text-align: center; }
    .aimh-form-row { flex-direction: column; }
    .aimh-widget-popup { 
        width: calc(100vw - 20px); 
        right: -10px;
        bottom: 80px;
    }
    .aimh-widget-popup .aimh-chat-container {
        height: 60vh;
    }
    .aimh-widget-bubble {
        max-width: 150px;
        font-size: 13px;
    }
    .aimh-widget-toggle {
        width: 60px;
        height: 60px;
    }
    .aimh-widget-avatar {
        width: 42px;
        height: 42px;
    }
    .aimh-page-header { flex-direction: column; gap: 12px; text-align: center; }
}

/* ============ BOUNDARIES ============ */
.aimh-radio-group { display: flex; flex-direction: column; gap: 8px; }
.aimh-radio-group label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* ============ INBOX ============ */
.aimh-inbox-list { display: flex; flex-direction: column; gap: 12px; }
.aimh-inbox-item { background: var(--aimh-card); border-radius: var(--aimh-radius); padding: 16px; box-shadow: var(--aimh-shadow); border-left: 4px solid transparent; }
.aimh-inbox-item.unread { border-left-color: var(--aimh-primary); background: #f0f9ff; }
.aimh-inbox-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.aimh-inbox-from { font-weight: 600; }
.aimh-inbox-request { color: var(--aimh-primary); font-size: 13px; }
.aimh-inbox-time { color: var(--aimh-text-light); font-size: 12px; }
.aimh-inbox-preview { color: var(--aimh-text-light); font-size: 14px; margin-bottom: 8px; }
.aimh-inbox-link { color: var(--aimh-primary); text-decoration: none; font-size: 14px; }
.aimh-badge { background: var(--aimh-error); color: white; font-size: 12px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }

/* ============ REQUEST DETAIL ============ */
.aimh-request-detail { max-width: 1000px; }
.aimh-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.aimh-detail-card { background: var(--aimh-card); border-radius: var(--aimh-radius-lg); padding: 20px; box-shadow: var(--aimh-shadow); }
.aimh-detail-card h3 { margin: 0 0 16px; font-size: 16px; }
.aimh-detail-row { margin-bottom: 12px; font-size: 14px; }
.aimh-detail-photos { margin-top: 12px; }

/* Messages Thread */
.aimh-messages-thread { max-height: 400px; overflow-y: auto; margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.aimh-thread-msg { padding: 12px 16px; border-radius: var(--aimh-radius); }
.aimh-thread-citizen { background: #e3f2fd; border-left: 3px solid #2196f3; }
.aimh-thread-staff { background: #e8f5e9; border-left: 3px solid #4caf50; }
.aimh-thread-header { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.aimh-thread-header strong { color: var(--aimh-text); }
.aimh-thread-header span { color: var(--aimh-text-light); }
.aimh-thread-body { font-size: 14px; line-height: 1.5; }

/* Reply Form */
.aimh-reply-form { background: var(--aimh-bg); padding: 16px; border-radius: var(--aimh-radius); }
.aimh-reply-form h4 { margin: 0 0 12px; font-size: 14px; }
.aimh-reply-form .aimh-form-row { margin-bottom: 12px; }
.aimh-reply-form .aimh-textarea { margin-bottom: 12px; }
.aimh-internal-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 12px; }

/* Staff Actions */
.aimh-staff-actions { margin-top: 20px; }
.aimh-staff-actions .aimh-form-row { align-items: center; }

@media (max-width: 768px) {
    .aimh-detail-grid { grid-template-columns: 1fr; }
}

/* ============ MEETING VIEW ============ */
.aimh-meeting-view { max-width: 900px; margin: 0 auto; }
.aimh-meeting-header { margin-bottom: 24px; }
.aimh-back-link { color: var(--aimh-primary); text-decoration: none; font-size: 14px; display: inline-block; margin-bottom: 12px; }
.aimh-meeting-board-label { color: var(--aimh-primary); font-size: 13px; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.aimh-meeting-header h1 { margin: 0 0 12px; font-size: 28px; }
.aimh-meeting-meta { display: flex; gap: 20px; color: var(--aimh-text-light); font-size: 15px; flex-wrap: wrap; }
.aimh-meeting-staff-actions { margin-top: 16px; }

/* View Tabs */
.aimh-view-tabs { display: flex; gap: 8px; margin-bottom: 24px; border-bottom: 2px solid var(--aimh-border); padding-bottom: 0; }
.aimh-view-tab { padding: 12px 20px; text-decoration: none; color: var(--aimh-text-light); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.aimh-view-tab:hover { color: var(--aimh-primary); }
.aimh-view-tab.active { color: var(--aimh-primary); border-bottom-color: var(--aimh-primary); }

/* Agenda Content */
.aimh-agenda-content, .aimh-minutes-content { background: var(--aimh-card); border-radius: var(--aimh-radius-lg); padding: 24px; box-shadow: var(--aimh-shadow); }
.aimh-agenda-section, .aimh-minutes-section { margin-bottom: 32px; }
.aimh-agenda-section:last-child, .aimh-minutes-section:last-child { margin-bottom: 0; }
.aimh-section-title { font-size: 18px; font-weight: 600; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--aimh-border); display: flex; align-items: center; gap: 12px; }
.aimh-consent-badge { font-size: 11px; background: #e3f2fd; color: #1976d2; padding: 4px 8px; border-radius: 4px; font-weight: 500; }

/* Agenda Items */
.aimh-agenda-items, .aimh-minutes-items { display: flex; flex-direction: column; gap: 16px; }
.aimh-agenda-item, .aimh-minutes-item { display: flex; gap: 12px; padding: 16px; background: var(--aimh-bg); border-radius: var(--aimh-radius); }
.aimh-item-number { font-weight: 700; color: var(--aimh-primary); min-width: 24px; }
.aimh-item-content { flex: 1; }
.aimh-item-content h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.aimh-item-content p { margin: 0 0 8px; color: var(--aimh-text-light); font-size: 14px; line-height: 1.6; }
.aimh-item-presenter { font-size: 13px; color: var(--aimh-text-light); font-style: italic; }
.aimh-item-attachments { margin-top: 8px; font-size: 13px; }
.aimh-item-attachments a { color: var(--aimh-primary); margin-left: 8px; }

/* Minutes specific */
.aimh-minutes-notes { margin-bottom: 12px; }
.aimh-minutes-notes strong { display: block; margin-bottom: 4px; font-size: 13px; color: var(--aimh-text); }
.aimh-action-taken, .aimh-vote-result { font-size: 14px; margin-top: 8px; padding: 8px 12px; background: white; border-radius: 4px; }
.aimh-vote-result { background: #e8f5e9; color: #2e7d32; }

/* Print Actions */
.aimh-print-actions { margin-top: 24px; text-align: center; }

@media print {
    .aimh-back-link, .aimh-view-tabs, .aimh-print-actions, .aimh-meeting-staff-actions { display: none !important; }
    .aimh-agenda-content, .aimh-minutes-content { box-shadow: none; }
}

/* ============ AI MODAL ============ */
.aimh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

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

.aimh-modal-header h3 { margin: 0; font-size: 18px; }
.aimh-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--aimh-text-light); }
.aimh-modal-body { padding: 20px; }

.aimh-ai-options { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.aimh-ai-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    background: var(--aimh-bg);
    border: 2px solid var(--aimh-border);
    border-radius: var(--aimh-radius);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.aimh-ai-option:hover { border-color: var(--aimh-primary); background: #eff6ff; }
.aimh-ai-option span { font-size: 13px; color: var(--aimh-text-light); margin-top: 4px; }

.aimh-ai-custom label { display: block; margin-bottom: 8px; font-weight: 500; }
.aimh-ai-custom textarea { width: 100%; padding: 12px; border: 1px solid var(--aimh-border); border-radius: var(--aimh-radius); margin-bottom: 12px; font-family: inherit; }
.aimh-ai-custom textarea:focus { outline: none; border-color: var(--aimh-primary); }

/* ============ MINUTES RECORDER ============ */
.aimh-minutes-recorder { max-width: 900px; margin: 0 auto; }
.aimh-meeting-info-bar {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--aimh-bg);
    padding: 16px 20px;
    border-radius: var(--aimh-radius);
    margin-bottom: 24px;
    font-size: 14px;
}

.aimh-minutes-section {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--aimh-shadow);
}

.aimh-minutes-section h2 {
    margin: 0 0 20px;
    font-size: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--aimh-border);
}

.aimh-minutes-general .aimh-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.aimh-minutes-item-card {
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    padding: 16px;
    margin-bottom: 16px;
}

.aimh-minutes-item-card:last-child { margin-bottom: 0; }

.aimh-minutes-item-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
}

.aimh-minutes-item-header .aimh-item-num {
    color: var(--aimh-primary);
    font-weight: 700;
}

.aimh-minutes-item-card .aimh-item-desc {
    font-size: 13px;
    color: var(--aimh-text-light);
    margin: 0 0 12px;
}

.aimh-minutes-fields { margin-top: 12px; }
.aimh-minutes-fields .aimh-form-group { margin-bottom: 12px; }
.aimh-minutes-fields .aimh-form-row { display: flex; gap: 16px; }
.aimh-minutes-fields .aimh-form-row .aimh-form-group { flex: 1; margin-bottom: 0; }

@media (max-width: 768px) {
    .aimh-minutes-general .aimh-form-grid { grid-template-columns: 1fr; }
    .aimh-minutes-fields .aimh-form-row { flex-direction: column; }
}

/* ============ KNOWLEDGE BASE ============ */
.aimh-knowledge { max-width: 1100px; margin: 0 auto; }

.aimh-knowledge-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.aimh-action-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    white-space: nowrap;
}

.aimh-action-card:hover {
    border-color: #3b82f6;
    background: #f0f7ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.aimh-action-card:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.aimh-action-card.aimh-action-ai {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #a7f3d0;
}

.aimh-action-card.aimh-action-ai:hover {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.aimh-action-icon { 
    font-size: 20px;
    line-height: 1;
}

.aimh-action-title { 
    font-weight: 600; 
    font-size: 14px;
    color: #0f172a;
}

.aimh-action-desc { 
    display: none;
}

/* AI Helper Buttons */
.aimh-ai-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
    vertical-align: middle;
    transition: all 0.2s;
    font-weight: 500;
}

.aimh-ai-btn:hover,
.aimh-ai-btn:focus {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
    outline: none;
}

/* Form Cards */
.aimh-form-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

.aimh-form-card h3 { 
    margin: 0 0 6px; 
    font-size: 18px;
    color: #0f172a;
}

.aimh-form-card > p {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 14px;
}

.aimh-form-group {
    margin-bottom: 16px;
}

.aimh-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.aimh-form-group small {
    font-weight: 400;
    color: #64748b;
}

.aimh-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .aimh-form-row {
        grid-template-columns: 1fr;
    }
}

.aimh-input, .aimh-select, .aimh-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.aimh-input:hover, .aimh-select:hover, .aimh-textarea:hover {
    border-color: #94a3b8;
}

.aimh-input:focus, .aimh-select:focus, .aimh-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.aimh-input::placeholder, .aimh-textarea::placeholder {
    color: #94a3b8;
}

.aimh-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.aimh-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.aimh-help-box {
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    padding: 16px;
    margin-top: 16px;
    font-size: 13px;
}

.aimh-help-box pre {
    background: white;
    padding: 12px;
    border-radius: var(--aimh-radius);
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
}

.aimh-csv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
}

.aimh-csv-table th, .aimh-csv-table td {
    padding: 8px 12px;
    border: 1px solid var(--aimh-border);
    text-align: left;
}

.aimh-csv-table th { background: var(--aimh-bg); font-weight: 600; }

.aimh-knowledge-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.aimh-knowledge-filters .aimh-input { 
    flex: 1; 
    background: white;
}

.aimh-knowledge-filters .aimh-select { 
    width: 180px;
    background: white;
}

.aimh-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
}

.aimh-empty-icon { font-size: 64px; margin-bottom: 16px; }
.aimh-empty-state h3 { margin: 0 0 8px; }
.aimh-empty-state p { color: var(--aimh-text-light); margin-bottom: 16px; }
.aimh-empty-state ul { text-align: left; max-width: 300px; margin: 0 auto; }
.aimh-empty-state li { margin-bottom: 8px; }

#aimh-no-search-results {
    padding: 40px 20px;
}

.aimh-articles-grid { display: flex; flex-direction: column; gap: 8px; }

.aimh-article-category-header h3 {
    margin: 24px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--aimh-primary);
    color: var(--aimh-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aimh-article-category-header:first-child h3 { margin-top: 0; }

.aimh-articles-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.aimh-article-card {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius);
    padding: 16px;
    box-shadow: var(--aimh-shadow);
    transition: transform 0.15s;
}

.aimh-article-card:hover { transform: translateY(-2px); }

.aimh-article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.aimh-article-header h4 { margin: 0; font-size: 15px; line-height: 1.3; }
.aimh-article-actions { display: flex; gap: 4px; flex-shrink: 0; }
.aimh-article-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.aimh-article-actions button:hover { opacity: 1; }

.aimh-article-keywords { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.aimh-keyword {
    background: var(--aimh-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: var(--aimh-text-light);
}

.aimh-article-preview { font-size: 13px; color: var(--aimh-text-light); line-height: 1.5; }

@media (max-width: 768px) {
    .aimh-knowledge-actions { grid-template-columns: repeat(2, 1fr); }
    .aimh-knowledge-filters { flex-direction: column; }
    .aimh-knowledge-filters .aimh-select { width: 100%; }
}

/* ============ ANALYTICS WIDGET - WHITE BACKGROUND ============ */
.aimh-analytics-widget {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.aimh-analytics-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #667eea;
}

.aimh-analytics-header h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aimh-analytics-summary {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.aimh-stat-mini {
    font-size: 14px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 8px;
}

.aimh-stat-mini strong {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    display: inline-block;
    margin-right: 4px;
}

.aimh-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.aimh-analytics-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.aimh-analytics-section h4 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #111827;
    font-weight: 600;
}

.aimh-section-hint {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #6b7280;
}

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

.aimh-question-item {
    background: white;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.aimh-question-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(3px);
}

.aimh-question-item.aimh-unanswered {
    border-left-color: #f59e0b;
}

.aimh-question-text {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #111827;
    line-height: 1.5;
}

.aimh-question-meta {
    font-size: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    color: #6b7280;
}

.aimh-question-count {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.aimh-question-warning {
    color: #dc2626;
    font-weight: 600;
}

.aimh-add-to-kb {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 12px;
    transition: all 0.2s;
    margin-left: auto;
}

.aimh-add-to-kb:hover {
    background: #dbeafe;
    color: #4f46e5;
    transform: translateY(-1px);
}

.aimh-empty-small {
    text-align: center;
    padding: 30px 20px;
    color: #9ca3af;
    font-style: italic;
    font-size: 14px;
}

/* Chat Reset Button */
.aimh-chat-reset {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    color: var(--aimh-text);
    opacity: 0.7;
}

.aimh-chat-reset:hover {
    opacity: 1;
    background: rgba(102, 126, 234, 0.1);
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .aimh-analytics-widget {
        padding: 20px;
    }
    
    .aimh-analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .aimh-analytics-summary {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============ CHATBOT WIDGET - MODERN DESIGN ============ */

/* Widget Container */
.aimh-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.aimh-widget-closed {
    position: relative;
}

/* Floating Button - Larger, More Prominent */
.aimh-widget-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
}

.aimh-widget-toggle:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(79, 70, 229, 0.5);
}

.aimh-widget-toggle:active {
    transform: translateY(-2px);
}

.aimh-widget-icon {
    width: 36px;
    height: 36px;
}

/* Speech Bubble */
.aimh-widget-bubble {
    position: absolute;
    bottom: 80px;
    right: 0;
    background: white;
    color: #1f2937;
    padding: 14px 18px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    animation: slideUp 0.3s ease-out;
    max-width: 250px;
}

.aimh-widget-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

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

.aimh-bubble-close {
    background: #f3f4f6;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: 10px;
}

.aimh-bubble-close:hover {
    background: #e5e7eb;
}

/* Chat Popup - Larger, More Space */
.aimh-widget-popup {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 48px);
    height: 680px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: popIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #e5e7eb;
}

@keyframes popIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Widget Header - Bold Design */
.aimh-widget-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.aimh-widget-header-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.aimh-widget-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    color: white;
    letter-spacing: -0.4px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.aimh-widget-icon-small {
    font-size: 22px;
}

.aimh-widget-status {
    font-size: 13px;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: white;
}

.aimh-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.aimh-widget-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.aimh-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Widget Footer */
.aimh-widget-footer {
    padding: 14px 20px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.aimh-widget-footer small {
    font-size: 11px;
    color: #6b7280;
}

/* Widget Mode Adjustments */
.aimh-chatbot.aimh-mode-widget {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aimh-chatbot.aimh-mode-widget .aimh-chat-container {
    height: 100%;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.aimh-chatbot.aimh-mode-widget .aimh-chat-header {
    display: none;
}

.aimh-chatbot.aimh-mode-widget .aimh-chat-messages {
    height: auto;
    flex: 1;
}

.aimh-chatbot.aimh-mode-widget .aimh-chat-input-area {
    border-radius: 0;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .aimh-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .aimh-widget-popup {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .aimh-widget-toggle {
        width: 56px;
        height: 56px;
    }
    
    .aimh-widget-icon {
        width: 28px;
        height: 28px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .aimh-widget-toggle {
        border: 2px solid white;
    }
    
    .aimh-widget-popup {
        border: 2px solid #1f2937;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .aimh-widget-toggle,
    .aimh-widget-popup,
    .aimh-widget-bubble,
    .aimh-bubble-close,
    .aimh-widget-close {
        animation: none;
        transition: none;
    }
    
    .aimh-widget-pulse {
        display: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aimh-widget-popup {
        background: #1f2937;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }
    
    .aimh-widget-bubble {
        background: #374151;
        color: #f3f4f6;
    }
    
    .aimh-widget-bubble::after {
        border-top-color: #374151;
    }
    
    .aimh-widget-footer {
        background: #111827;
        border-top-color: #374151;
    }
    
    .aimh-widget-footer small {
        color: #9ca3af;
    }
}

/* Focus Visible Polyfill for Better Accessibility */
.aimh-widget-toggle:focus-visible,
.aimh-widget-close:focus-visible,
.aimh-bubble-close:focus-visible {
    outline: 3px solid #fbbf24;
    outline-offset: 3px;
}

/* ============ BOARD MEMBERS ============ */
.aimh-board-members {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.aimh-board-section {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--aimh-shadow);
}

.aimh-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--aimh-border);
}

.aimh-board-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.aimh-member-count {
    color: var(--aimh-text-light);
    font-size: 14px;
}

.aimh-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.aimh-member-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    transition: all 0.2s;
}

.aimh-member-card:hover {
    box-shadow: var(--aimh-shadow);
}

.aimh-member-card.inactive {
    opacity: 0.6;
}

.aimh-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--aimh-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.aimh-member-info strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.aimh-member-title,
.aimh-member-seat {
    display: block;
    font-size: 13px;
    color: var(--aimh-text-light);
}

.aimh-member-title {
    color: var(--aimh-primary);
    font-weight: 500;
}

.aimh-member-actions {
    display: flex;
    gap: 4px;
}

.aimh-btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.aimh-btn-icon:hover {
    background: var(--aimh-border);
}

.aimh-no-members {
    color: var(--aimh-text-light);
    padding: 20px;
    text-align: center;
}

/* ============ AGENDA TEMPLATES ============ */
.aimh-agenda-templates {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.aimh-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.aimh-template-card {
    background: var(--aimh-card);
    border-radius: var(--aimh-radius-lg);
    padding: 20px;
    box-shadow: var(--aimh-shadow);
    transition: all 0.2s;
}

.aimh-template-card:hover {
    box-shadow: var(--aimh-shadow-lg);
    transform: translateY(-2px);
}

.aimh-template-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.aimh-template-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.aimh-badge {
    background: var(--aimh-primary);
    color: white;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.aimh-template-board {
    color: var(--aimh-text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.aimh-template-stats {
    display: flex;
    gap: 16px;
    color: var(--aimh-text-light);
    font-size: 13px;
    margin-bottom: 8px;
}

.aimh-template-desc {
    font-size: 14px;
    color: var(--aimh-text-light);
    margin: 8px 0;
}

.aimh-template-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--aimh-border);
}

/* Template Form */
.aimh-template-sections {
    margin: 16px 0;
    padding: 16px;
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
}

.aimh-template-sections > label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
}

.aimh-template-section {
    background: white;
    border: 1px solid var(--aimh-border);
    border-radius: var(--aimh-radius);
    padding: 12px;
    margin-bottom: 12px;
}

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

.aimh-section-header .aimh-input {
    flex: 1;
}

.aimh-checkbox-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    white-space: nowrap;
}

.aimh-section-items {
    padding-left: 16px;
    margin-bottom: 8px;
}

.aimh-template-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.aimh-template-item .aimh-input {
    flex: 1;
    font-size: 13px;
    padding: 6px 10px;
}

.aimh-btn-sm {
    font-size: 12px;
    padding: 4px 12px;
}

/* ============ ROLL CALL VOTING ============ */
.aimh-vote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.aimh-vote-member {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
}

.aimh-vote-member-name {
    flex: 1;
    font-weight: 500;
}

.aimh-vote-buttons {
    display: flex;
    gap: 4px;
}

.aimh-vote-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--aimh-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.aimh-vote-btn:hover {
    border-color: var(--aimh-primary);
}

.aimh-vote-btn.active-aye {
    background: var(--aimh-success);
    border-color: var(--aimh-success);
    color: white;
}

.aimh-vote-btn.active-nay {
    background: var(--aimh-error);
    border-color: var(--aimh-error);
    color: white;
}

.aimh-vote-btn.active-abstain {
    background: var(--aimh-warning);
    border-color: var(--aimh-warning);
    color: white;
}

.aimh-vote-summary {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    font-weight: 500;
}

.aimh-vote-summary .aye { color: var(--aimh-success); }
.aimh-vote-summary .nay { color: var(--aimh-error); }
.aimh-vote-summary .abstain { color: var(--aimh-warning); }

/* ============ MOTION RECORDING ============ */
.aimh-motion-panel {
    background: var(--aimh-bg);
    border-radius: var(--aimh-radius);
    padding: 16px;
    margin: 16px 0;
}

.aimh-motion-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.aimh-motion-row .aimh-form-group {
    flex: 1;
}

.aimh-quick-motion-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.aimh-quick-motion-btn {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--aimh-border);
    background: white;
    border-radius: 6px;
    cursor: pointer;
}

.aimh-quick-motion-btn:hover {
    background: var(--aimh-bg);
}

.aimh-quick-motion-btn.selected {
    background: var(--aimh-primary);
    color: white;
    border-color: var(--aimh-primary);
}
