/* ===== CondoDeskPro – Custom Theme Override ===== */

/* ----- Root variables ----- */
:root {
    --cp-bg: #F5F7FA;
    --cp-sidebar: #1F2937;
    --cp-sidebar-hover: #374151;
    --cp-sidebar-active: #2563EB;
    --cp-primary: #2563EB;
    --cp-success: #10B981;
    --cp-warning: #F59E0B;
    --cp-danger: #EF4444;
    --cp-text-muted: #6B7280;
    --cp-card-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ----- Global body ----- */
body {
    background-color: var(--cp-bg) !important;
    font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ----- MudBlazor overrides ----- */

.mud-appbar {
    background-color: #ffffff !important;
    color: #111827 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.08) !important;
}

.mud-main-content {
    background-color: var(--cp-bg) !important;
}

/* ----- Sidebar branding ----- */
.cp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 12px;
    border-bottom: 1px solid #374151;
    color: #ffffff;
}

.cp-sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--cp-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.cp-sidebar-brand-text {
    line-height: 1.2;
}

.cp-sidebar-brand-text h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.cp-sidebar-brand-text span {
    font-size: 11px;
    color: #9CA3AF;
}

/* ----- Sidebar nav links ----- */
.cp-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 8px;
    margin: 2px 8px;
    color: #D1D5DB !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: background .15s, color .15s;
}

.cp-nav-link:hover {
    background-color: var(--cp-sidebar-hover) !important;
    color: #ffffff !important;
}

.cp-nav-link.active {
    background-color: var(--cp-sidebar-active) !important;
    color: #ffffff !important;
    font-weight: 500;
}

.cp-nav-section {
    padding: 16px 16px 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #6B7280;
}

/* ----- Help link at bottom ----- */
.cp-sidebar-footer {
    padding: 8px;
    border-top: 1px solid #374151;
    margin-top: auto;
}

/* ----- Stat cards ----- */
.cp-stat-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--cp-card-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow .15s;
}

.cp-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.cp-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.cp-stat-icon.blue   { background: #EFF6FF; color: var(--cp-primary); }
.cp-stat-icon.green  { background: #ECFDF5; color: var(--cp-success); }
.cp-stat-icon.orange { background: #FFFBEB; color: var(--cp-warning); }
.cp-stat-icon.purple { background: #F5F3FF; color: #7C3AED; }

.cp-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.cp-stat-label {
    font-size: 13px;
    color: var(--cp-text-muted);
    margin-top: 2px;
}

.cp-stat-link {
    font-size: 12px;
    color: var(--cp-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

/* ----- Section card (content panels) ----- */
.cp-section-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: var(--cp-card-shadow);
    padding: 20px;
}

.cp-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cp-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-see-all {
    font-size: 13px;
    color: var(--cp-primary);
    text-decoration: none;
}

/* ----- Priority / status badges ----- */
.badge-urgent   { background: #FEF2F2; color: var(--cp-danger);  font-size:11px; font-weight:600; padding:3px 8px; border-radius:4px; text-transform:uppercase; letter-spacing:.05em; }
.badge-important { background: #FFFBEB; color: var(--cp-warning); font-size:11px; font-weight:600; padding:3px 8px; border-radius:4px; text-transform:uppercase; letter-spacing:.05em; }
.badge-info     { background: #EFF6FF; color: var(--cp-primary); font-size:11px; font-weight:600; padding:3px 8px; border-radius:4px; text-transform:uppercase; letter-spacing:.05em; }
.badge-normal   { background: #F3F4F6; color: #6B7280;           font-size:11px; font-weight:600; padding:3px 8px; border-radius:4px; text-transform:uppercase; letter-spacing:.05em; }

.status-open       { background: #FEF2F2; color: var(--cp-danger);   padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; }
.status-inprogress { background: #FFFBEB; color: var(--cp-warning);  padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; }
.status-resolved   { background: #ECFDF5; color: var(--cp-success);  padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; }
.status-closed     { background: #F3F4F6; color: #6B7280;            padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; }

.role-admin  { background: #EFF6FF; color: var(--cp-primary); padding:2px 8px; border-radius:10px; font-size:12px; font-weight:500; }
.role-owner  { background: #ECFDF5; color: var(--cp-success); padding:2px 8px; border-radius:10px; font-size:12px; font-weight:500; }
.role-tenant { background: #F5F3FF; color: #7C3AED;           padding:2px 8px; border-radius:10px; font-size:12px; font-weight:500; }

/* ----- Announcement card ----- */
.cp-announce-item {
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.cp-announce-item:last-child { border-bottom: none; }

.cp-announce-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 3px;
}

.cp-announce-desc {
    font-size: 13px;
    color: var(--cp-text-muted);
}

.cp-announce-time {
    font-size: 12px;
    color: #9CA3AF;
}

/* ----- Event list ----- */
.cp-event-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}

.cp-event-item:last-child { border-bottom: none; }

.cp-event-date {
    width: 44px;
    text-align: center;
    flex-shrink: 0;
}

.cp-event-date .day {
    font-size: 18px;
    font-weight: 700;
    color: var(--cp-primary);
    line-height: 1;
}

.cp-event-date .month {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--cp-text-muted);
}

.cp-event-info .title   { font-size: 14px; font-weight: 500; color: #111827; }
.cp-event-info .sub     { font-size: 12px; color: var(--cp-text-muted); }
.cp-event-time          { margin-left: auto; font-size: 13px; color: var(--cp-text-muted); flex-shrink:0; }

/* ----- Document row ----- */
.cp-doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}

.cp-doc-item:last-child { border-bottom: none; }

.cp-doc-icon { font-size: 22px; color: var(--cp-danger); flex-shrink:0; }

.cp-doc-name   { font-size: 14px; font-weight: 500; color: #111827; }
.cp-doc-meta   { font-size: 12px; color: var(--cp-text-muted); }
.cp-doc-size   { margin-left: auto; font-size: 13px; color: var(--cp-text-muted); flex-shrink:0; padding-right:8px; }

/* ----- Reminder cards (right panel) ----- */
.cp-reminder-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
}

.cp-reminder-item:last-child { border-bottom: none; }

.cp-reminder-icon { font-size: 18px; color: var(--cp-text-muted); margin-top:2px; }
.cp-reminder-label { font-size: 14px; font-weight: 500; color: #111827; }
.cp-reminder-sub   { font-size: 12px; color: var(--cp-text-muted); }
.cp-reminder-status-red    { font-size: 12px; font-weight:600; color: var(--cp-danger); }
.cp-reminder-status-green  { font-size: 12px; font-weight:600; color: var(--cp-success); }
.cp-reminder-status-gray   { font-size: 12px; font-weight:600; color: var(--cp-text-muted); }

/* ----- My Unit card ----- */
.cp-unit-row { display:flex; justify-content:space-between; padding:5px 0; font-size:13px; border-bottom:1px solid #F3F4F6; }
.cp-unit-row:last-child { border-bottom:none; }
.cp-unit-key   { color: var(--cp-text-muted); }
.cp-unit-val   { font-weight: 500; color: #111827; }

/* ----- Quick links ----- */
.cp-quick-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--cp-primary);
    text-decoration: none;
    border-bottom: 1px solid #F3F4F6;
    cursor: pointer;
}

.cp-quick-link:last-child { border-bottom: none; }
.cp-quick-link:hover { color: #1D4ED8; }

/* ----- Parking spot card ----- */
.cp-parking-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: var(--cp-card-shadow);
    padding: 16px;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color .15s;
}

.cp-parking-card.occupied { border-color: var(--cp-danger); }
.cp-parking-card.available { border-color: var(--cp-success); }
.cp-parking-card.reserved  { border-color: var(--cp-warning); }

.cp-parking-num  { font-size: 22px; font-weight: 700; color: #111827; }
.cp-parking-type { font-size: 12px; color: var(--cp-text-muted); }

/* ----- Calendar ----- */
.cp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.cp-cal-day-header {
    font-size: 12px;
    font-weight: 600;
    color: var(--cp-text-muted);
    padding: 4px 0;
}

.cp-cal-day {
    padding: 6px 4px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    min-height: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cp-cal-day:hover { background: #EFF6FF; }
.cp-cal-day.today { background: var(--cp-primary); color: #fff; font-weight: 700; border-radius: 50%; width: 30px; height: 30px; margin: auto; }
.cp-cal-day.other-month { color: #D1D5DB; }
.cp-cal-dots { display:flex; gap:4px; justify-content:center; margin-top:3px; flex-wrap:wrap; }
.cp-cal-dot  { width:7px; height:7px; border-radius:50%; display:inline-block; flex-shrink:0; }

/* ----- Table overrides ----- */
.cp-data-table .mud-table-head th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--cp-text-muted);
    background: #F9FAFB !important;
}

/* ----- Avatar initials ----- */
.cp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.cp-avatar.blue   { background: var(--cp-primary); }
.cp-avatar.green  { background: var(--cp-success); }
.cp-avatar.purple { background: #7C3AED; }
.cp-avatar.orange { background: var(--cp-warning); }

/* ----- Page header ----- */
.cp-page-header { margin-bottom: 24px; }
.cp-page-header h4 { font-size: 22px; font-weight: 700; color: #111827; margin:0; }
.cp-page-header p  { font-size: 14px; color: var(--cp-text-muted); margin:2px 0 0; }

/* ----- Top search bar ----- */
.cp-search-input .mud-input-root { background: #F9FAFB; border-radius: 8px; }

/* ----- Notification badge ----- */
.cp-notif-btn { color: #6B7280 !important; }

/* ----- Profile chip ----- */
.cp-profile-area { display:flex; align-items:center; gap:8px; cursor:pointer; }
.cp-profile-name  { font-size:14px; font-weight:500; color:#111827; }
.cp-profile-role  { font-size:12px; color:var(--cp-text-muted); line-height:1; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .cp-stat-card { padding: 14px; }
    .cp-stat-value { font-size: 22px; }
}

@media (max-width: 600px) {
    /* Right-side drawers (TicketDetailsDrawer, DocumentViewer, etc.) */
    .mud-drawer-right .mud-drawer-paper {
        width: calc(100vw - 8px) !important;
        max-width: calc(100vw - 8px) !important;
    }
}

/* -- Skeleton loader -------------------------------- */
@keyframes cp-shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
.cp-skeleton { background:linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size:800px 100%; animation:cp-shimmer 1.4s infinite linear; }

/* -- PWA install button ----------------------------- */
.cp-pwa-install-button {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 8500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    background: #2563EB;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(37,99,235,.35);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, background .15s;
}

.cp-pwa-install-button:hover {
    background: #1D4ED8;
    box-shadow: 0 10px 28px rgba(37,99,235,.45);
    transform: translateY(-1px);
}

/* -- Mobile bottom navigation ----------------------- */
.cdp-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: #1F2937;
    border-top: 1px solid rgba(255,255,255,.08);
    z-index: 8000;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
    box-shadow: 0 -2px 12px rgba(0,0,0,.25);
}
.cdp-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #9CA3AF;
    text-decoration: none;
    font-size: 10px;
    padding: 6px 10px;
    border-radius: 8px;
    transition: color .15s, background .15s;
    min-width: 48px;
}
.cdp-bottom-nav-item.active,
.cdp-bottom-nav-item:hover {
    color: #3B82F6;
    background: rgba(59,130,246,.12);
}
/* Show only on mobile */
@media (max-width: 959px) {
    .cdp-bottom-nav { display: flex; }
    /* Add bottom padding to main content so it isn't hidden behind bottom nav */
    .mud-main-content > div { padding-bottom: 72px !important; }
    .cp-pwa-install-button { bottom: 76px; left: 12px; padding: 10px 12px; }
}


/* -- Search results section headers --------------------------------------- */
.search-section-header {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Phase 21 — Reporting & BI
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Report module hub cards */
.rpt-module-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 20px;
    transition: box-shadow .15s, transform .15s;
}
.rpt-module-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

/* Tags inside module cards */
.rpt-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: #EFF6FF;
    color: #1D4ED8;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* KPI banner cards */
.rpt-kpi-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.rpt-kpi-value { font-size: 28px; font-weight: 800; color: #111827; line-height: 1; }
.rpt-kpi-label { font-size: 12px; color: #6B7280; margin-top: 2px; }

/* Colored KPI pills */
.rpt-kpi-pill {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.rpt-kpi-pill strong { display: block; font-size: 20px; font-weight: 800; color: #111827; line-height: 1.1; }
.rpt-kpi-pill span   { display: block; font-size: 11px; color: #6B7280; margin-top: 1px; }
.rpt-kpi-pill.blue   { border-left: 3px solid #1D4ED8; }
.rpt-kpi-pill.green  { border-left: 3px solid #16a34a; }
.rpt-kpi-pill.orange { border-left: 3px solid #d97706; }
.rpt-kpi-pill.yellow { border-left: 3px solid #ca8a04; }
.rpt-kpi-pill.red    { border-left: 3px solid #dc2626; }
.rpt-kpi-pill.purple { border-left: 3px solid #7c3aed; }

/* Score cards */
.rpt-score-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 16px;
    border: 2px solid #e5e7eb;
    text-align: center;
}
.rpt-score-card.mini { padding: 12px; }
.rpt-score-value { font-size: 38px; font-weight: 900; line-height: 1; }
.rpt-score-label { font-size: 11px; color: #6B7280; margin-top: 4px; font-weight: 600; }
.rpt-score-bar   { background: #e5e7eb; border-radius: 2px; height: 4px; margin-top: 10px; overflow: hidden; }

/* Bar charts (horizontal) */
.rpt-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.rpt-bar-track {
    flex: 1;
    background: #F3F4F6;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}
.rpt-bar-fill {
    height: 8px;
    border-radius: 4px;
    background: #1D4ED8;
    transition: width .4s ease;
}

/* Status badges */
.rpt-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.rpt-badge.success { background: #DCFCE7; color: #15803d; }
.rpt-badge.warning { background: #FEF3C7; color: #b45309; }
.rpt-badge.danger  { background: #FEE2E2; color: #b91c1c; }
.rpt-badge.info    { background: #DBEAFE; color: #1d4ed8; }

/* Alert rows */
.rpt-alert-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.rpt-alert-row.warning { background: #FFFBEB; color: #92400e; border-left: 3px solid #d97706; }
.rpt-alert-row.danger  { background: #FEF2F2; color: #991b1b; border-left: 3px solid #dc2626; }
.rpt-alert-row.info    { background: #EFF6FF; color: #1e40af; border-left: 3px solid #3b82f6; }

/* Renewal rows */
.rpt-renewal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #F3F4F6;
    gap: 8px;
}
.rpt-renewal-row:last-child { border-bottom: none; }

/* Data table */
.rpt-table {
    border-collapse: collapse;
    font-size: 13px;
}
.rpt-table th {
    background: #F9FAFB;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #E5E7EB;
    white-space: nowrap;
}
.rpt-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #F3F4F6;
    vertical-align: middle;
    color: #374151;
}
.rpt-table tbody tr:hover { background: #FAFAFA; }
.rpt-table tfoot td       { background: #F0F9FF; }

/* Donut-style display */
.rpt-donut-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    margin: 8px 0;
}
.rpt-donut-seg {
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 32px;
    font-weight: 800;
    color: #fff;
}
.rpt-donut-seg.green  { background: #16a34a; }
.rpt-donut-seg.orange { background: #d97706; }

/* Dot legend */
.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
}
.dot.green  { background: #16a34a; }
.dot.orange { background: #d97706; }

/* Text color helpers */
.text-orange { color: #d97706 !important; }
.text-red    { color: #dc2626 !important; }
.fw-bold     { font-weight: 700 !important; }
.text-right  { text-align: right !important; }

/* ── SSL / Sécurité — bas du menu latéral ─────────────────────────────── */
.cp-sidebar-ssl {
    margin-top: auto;
    padding: 14px 12px 12px;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cp-sidebar-ssl-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16,185,129,.12);
    border: 1px solid rgba(16,185,129,.25);
    border-radius: 8px;
    padding: 7px 10px;
}

.cp-ssl-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(16,185,129,.2);
    border-radius: 6px;
    color: #6ee7b7;
    flex-shrink: 0;
}

.cp-ssl-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cp-ssl-title {
    font-size: 11px;
    font-weight: 700;
    color: #6ee7b7;
    letter-spacing: .02em;
}

.cp-ssl-sub {
    font-size: 10px;
    color: #94a3b8;
    letter-spacing: .04em;
}

.cp-ssl-cert-link {
    display: block;
    text-align: center;
    opacity: .7;
    transition: opacity .15s;
}
.cp-ssl-cert-link:hover { opacity: 1; }

/* ── Resident AI Assistant — full page (/assistant) ─────────────────────── */
.ra-page {
    display: flex;
    height: calc(100vh - 64px);   /* account for app-bar */
    overflow: hidden;
    background: #f8fafc;
    margin: -28px -32px;          /* bleed outside the default padding */
}

/* ── Sidebar ── */
.ra-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .2s ease;
}

.ra-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px 12px;
    border-bottom: 1px solid #f3f4f6;
}

.ra-sidebar-logo {
    width: 34px; height: 34px;
    background: #eff6ff;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
}

.ra-conv-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 6px;
}
.ra-conv-list::-webkit-scrollbar { width: 4px; }
.ra-conv-list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 2px; }

.ra-conv-item {
    position: relative;
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s;
    margin-bottom: 2px;
}
.ra-conv-item:hover { background: #f9fafb; }
.ra-conv-item--active { background: #eff6ff !important; border-right: 2px solid #3b82f6; }

.ra-conv-title {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.ra-conv-date {
    font-size: 10px;
    color: #64748b;
    margin-top: 2px;
}

.ra-conv-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.ra-rename-input {
    width: 100%;
    background: #fff;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    color: #1f2937;
    outline: none;
}

.ra-sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid #f3f4f6;
}

/* ── Main chat area ── */
.ra-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
}

.ra-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
    flex-shrink: 0;
}

.ra-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.ra-messages::-webkit-scrollbar { width: 5px; }
.ra-messages::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

/* ── Welcome splash ── */
.ra-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0 8px;
    gap: 12px;
}

.ra-welcome-avatar {
    width: 72px; height: 72px;
    background: #EFF6FF;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(59,130,246,.15);
}

.ra-location-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    color: #15803d;
    font-weight: 500;
}

.ra-starter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 4px;
    width: 100%;
    max-width: 560px;
}

.ra-starter-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 14px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    text-align: left;
    transition: background .15s, border-color .15s, transform .1s;
    line-height: 1.3;
}
.ra-starter-card:hover { background: #eff6ff; border-color: #bfdbfe; transform: translateY(-1px); }

.ra-starter-icon { font-size: 20px; }

/* ── Message bubbles ── */
.ra-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.ra-msg--user {
    flex-direction: row-reverse;
}

.ra-bubble {
    max-width: 72%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
}

.ra-bubble--user {
    background: #3b82f6;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ra-bubble--ai {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    border-left: 3px solid #e5e7eb;
}

.ra-ai-avatar {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.ra-msg-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-left: 2px;
    font-size: 11px;
    color: #94a3b8;
}

.ra-feedback {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    opacity: .45;
    padding: 0;
    transition: opacity .1s, transform .1s;
}
.ra-feedback:hover { opacity: 1; transform: scale(1.15); }
.ra-feedback--active  { opacity: 1; filter: drop-shadow(0 0 4px #22c55e); }
.ra-feedback--neg     { opacity: 1; filter: drop-shadow(0 0 4px #ef4444); }

/* Typing dots */
.ra-typing-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    margin: 0 2px;
    animation: ra-blink 1.3s infinite both;
}
.ra-typing-dot:nth-child(2) { animation-delay: .2s; }
.ra-typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ra-blink { 0%,80%,100% { opacity:.25; } 40% { opacity:1; } }

/* ── Input bar ── */
.ra-input-bar {
    padding: 14px 20px 16px;
    border-top: 1px solid #f1f5f9;
    background: #fff;
    flex-shrink: 0;
}

.ra-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 10px 12px 10px 16px;
    transition: border-color .15s;
}
.ra-input-wrap:focus-within { border-color: #93c5fd; background: #fff; }

.ra-textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    outline: none;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    max-height: 140px;
    overflow-y: auto;
}
.ra-textarea::placeholder { color: #94a3b8; }

.ra-submit-btn {
    width: 36px; height: 36px;
    background: #2563eb;
    border: none; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    color: #fff;
    transition: background .15s, transform .1s;
}
.ra-submit-btn:hover:not(:disabled) { background: #1d4ed8; transform: scale(1.06); }
.ra-submit-btn:disabled { background: #e2e8f0; cursor: default; }

/* ── Shared icon buttons ── */
.ra-icon-btn {
    background: rgba(255,255,255,.08);
    border: none;
    border-radius: 7px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: background .12s, color .12s;
}
.ra-icon-btn:hover { background: rgba(255,255,255,.14); color: #e2e8f0; }

.ra-icon-btn-xs {
    background: none;
    border: none;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: .65;
    transition: opacity .1s;
}
.ra-icon-btn-xs:hover { opacity: 1; }

/* Sidebar icon btn (on white bg) */
.ra-sidebar .ra-icon-btn {
    background: #f3f4f6;
    color: #6b7280;
}
.ra-sidebar .ra-icon-btn:hover { background: #e5e7eb; color: #1f2937; }

/* Topbar icon btn (on white bg) */
.ra-topbar .ra-icon-btn {
    background: #f1f5f9;
    color: #64748b;
}
.ra-topbar .ra-icon-btn:hover { background: #e2e8f0; color: #1e293b; }

/* Mobile sidebar toggle */
@media (max-width: 640px) {
    .ra-page { margin: -28px -16px; }
    .ra-sidebar { width: 0; position: absolute; z-index: 200; height: 100%; }
    .ra-sidebar--open { width: 260px; }
    .ra-menu-toggle { display: flex !important; }
}
@media (min-width: 641px) {
    .ra-menu-toggle { display: flex; }
}
