/* Roula Rouva identity. Palette and original artwork: https://rrcorfurealestate.com/
   Keep status/error colours distinct from the corporate accent. */
:root {
    --rr-red: #e21f2a;
    --rr-red-dark: #be1720;
    --rr-blue: #26445e;
    --rr-beige: #f7f3f0;
    --bg: #f9f6f4;
    --ink: var(--rr-blue);
    --muted: #636d77;
    --line: #e4e6e9;
    --green: var(--rr-red-dark);
    --green-deep: #9d171f;
    --soft: #fef2f3;
    --sand: var(--rr-beige);
    --shadow: 0 5px 25px #26445e12;
}
body { color: #40444a; }
/* Shared readable typography for data views at every viewport size. */
:root {
    --data-text-size: 15px;
    --data-secondary-size: 13px;
}
h1, h2, h3, h4 { font-family: Georgia, 'Times New Roman', serif; color: var(--rr-blue); }
.rr-brand { flex-direction: column; gap: 10px; padding: 0 10px; letter-spacing: 0; }
.rr-brand-full { display: block; width: 100%; height: auto; }
.rr-brand-compact { display: none; }
.rr-brand-caption { color: var(--rr-blue); font: 600 10px var(--font-ui); letter-spacing: 2px; white-space: nowrap; }
.rr-brand-caption span { color: var(--rr-red-dark); margin-left: 6px; }
.workspace-name { margin-top: 24px; background: var(--rr-beige); }
.workspace-name strong, .breadcrumb strong, .stat>strong, .property-price { color: var(--rr-blue); }
.sidebar nav a { color: #555c65; }
.sidebar nav a:hover { background: var(--rr-beige); color: var(--rr-blue); }
.sidebar nav a.active { color: var(--rr-red-dark); background: var(--soft); }
.sidebar nav a.active:after { background: var(--rr-red); }
.nav-heading, .eyebrow, .stat>span, .stat>small, .property-body p, .property-meta { color: var(--muted); }
.button { color: var(--rr-blue); border-color: #ccd1d5; }
.button:hover { background: var(--rr-beige); border-color: #b4b1ae; }
.button.primary { background: var(--rr-red); border-color: var(--rr-red); color: #fff; }
.button.primary:hover { background: var(--rr-red-dark); border-color: var(--rr-red-dark); }
.stat.accent { background: #e8eef6; border-color: #ccdceb; }
.stat.accent>strong, .stat>span svg { color: var(--rr-blue); }
.avatar, .avatar.pastel { background: var(--rr-beige); color: var(--rr-blue); }
button:focus-visible, a:focus-visible { outline-color: var(--rr-blue); }
input:focus, select:focus, textarea:focus { border-color: var(--rr-blue); box-shadow: 0 0 0 3px #26445e18; }
input[type=checkbox] { accent-color: var(--rr-red-dark); }
.login-story { background: var(--rr-blue); }
.login-story .rr-brand { width: 280px; max-width: 100%; padding: 18px 22px; background: #fff; border-radius: 4px; }
.login-story h1 { color: #fff; }
.login-story p, .login-story .eyebrow { color: #e8eef6; }
.login-form>p { color: var(--muted); }
.demo-note { background: var(--rr-beige); color: #636d77; }
.demo-note strong { color: var(--rr-blue); }
.assistant-banner { background: var(--rr-blue); }
.assistant-banner p { color: #e8eef6; }
.assistant-context h2, .assistant-composer h2, .assistant-context select,
.assistant-priority, .assistant-match strong, .assistant-match b,
.assistant-result h3, .assistant-answer, .assistant-draft summary,
.assistant-draft input, .assistant-draft textarea, .assistant-prompt textarea,
.assistant-check, .assistant-usage b { color: var(--rr-blue); }
.assistant-shortcuts button, .assistant-draft { background: var(--rr-beige); border-color: var(--line); color: var(--rr-blue); }
.assistant-shortcuts button:hover:not(:disabled), .assistant-priority:hover, .assistant-match:hover { background: #e8eef6; border-color: #ccdceb; }
.assistant-result-icon { background: var(--soft); color: var(--rr-red-dark); }
.assistant-sources a { color: var(--rr-red-dark); border-color: var(--line); }
.assistant-columns input:focus-visible, .assistant-columns textarea:focus-visible,
.assistant-columns button:focus-visible { outline-color: var(--rr-blue); }
.assistant-check input { accent-color: var(--rr-red-dark); }
.app-footer { color: var(--rr-blue); }
.mini-spark i { background: #6b9fc5; }
.bar-new { background: #ccdceb; }
.bar-contacted { background: #9fc0da; }
.bar-qualified { background: #6b9fc5; }
.bar-viewing { background: #4883af; }
.bar-offer { background: var(--rr-blue); }
.chart-column, .chart-column strong { color: var(--rr-blue); }
.panel-foot { background: var(--rr-beige); color: var(--muted); }
/* Shared content, forms and secondary screens use the same brand tokens. */
.property-body h3, .lead-name strong, .kanban-card strong, .kanban-card b,
.timeline article>strong, .mail-row strong, .email-body, .settings-panel h3,
.empty h2, .stage-summary strong, .endpoint code { color: var(--rr-blue); }
.property-type, .result-count, .search-field, .segmented button, label,
label small, .muted, .small-text, .section-heading p, .lead-name small,
.kanban-heading, .kanban-card small, .kanban-card>span, .timeline article>small,
.timeline article p, .task-description>small, .task-description p,
.task-date, .task-date>small, .team-row small, .team-row .role-label,
.info-card p, .source-chart>div>span, .source-chart small,
.settings-panel p, .endpoint small, .mail-row small, .mail-row p,
.publish-row small, .loading, .empty { color: var(--muted); }
input, textarea, select { color: var(--rr-blue); border-color: var(--line); }
input::placeholder, textarea::placeholder { color: #75808a; }
input:focus, textarea:focus, select:focus { outline-color: #26445e44; }
thead, .kanban-column, .info-card, .endpoint, .upload-zone { background: var(--rr-beige); }
th { color: var(--muted); }
td { color: #555c65; border-color: var(--line); }
tbody tr:hover, .mail-row:hover { background: #f9f6f4; }
.kanban-card, .info-card, .endpoint, .upload-zone, .empty.large,
.property-meta, .timeline article { border-color: var(--line); }
.property-placeholder { color: var(--rr-blue); background: linear-gradient(135deg, #e8eef6, var(--rr-beige)); }
.property-image:after { background: linear-gradient(transparent 55%, #26445e40); }
.badge { background: var(--rr-beige); color: #555c65; }
.property-image>.badge { color: #555c65; }
.property-image>.badge.available { color: #41703b; }
.modal-backdrop { background: #263e54a3; }
.modal { border-color: var(--line); box-shadow: 0 20px 80px #263e5440; }
.timeline-dot, .horizontal-track>div { background: #4883af; }
.horizontal-track, .empty-icon { background: #e8eef6; }
.empty-icon { color: var(--rr-blue); }
.empty.large { background: #fff; }
.tree-line { color: #a9b0b7; }
.assistant-help, .assistant-match small, .assistant-match span,
.assistant-result header small, .assistant-draft>small, .assistant-sources,
.assistant-footnote, .assistant-usage span, .assistant-priority small,
.assistant-composer .form-actions small, .assistant-composer .form-actions>span { color: var(--muted); }
.assistant-priority, .assistant-match, .assistant-result header,
.assistant-usage { border-color: var(--line); }
.activity-icon { color: var(--rr-blue); background: #e8eef6; }
.agenda-title strong { color: var(--rr-blue); }
.agenda-title small, .agenda-time, .panel-heading p { color: var(--muted); }
.agenda-time.overdue-text { color: #a15b3f; }
.agenda-row { border-color: var(--line); }
.agenda-row:hover { background: var(--rr-beige); }
.panel-heading>a, .section-heading>a { color: var(--rr-red-dark); }
@media (max-width: 950px) {
    .sidebar .rr-brand { padding: 0; }
    .sidebar .rr-brand-full, .sidebar .rr-brand-caption { display: none; }
    .sidebar .rr-brand-compact { display: block; width: 42px; height: 42px; object-fit: contain; }
}
@media (max-width: 640px) {
    .login-story .rr-brand { width: 215px; padding: 12px 18px; }
    .stat>strong { font-size: clamp(15px, 4.1vw, 24px); letter-spacing: -.5px; overflow-wrap: anywhere; }
}

/* Translations and customer text must remain readable at narrow widths. */
.page-heading > div, .heading-actions, .panel-heading > div, .section-heading > div { min-width: 0; }
.heading-actions, .form-actions, .segmented { flex-wrap: wrap; }
.button { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.main-content, .modal { overflow-wrap: anywhere; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
.table-wrap table:not(.mailbox-table) { min-width: 720px; }
input, select, textarea { min-width: 0; max-width: 100%; }
.sidebar nav a { height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
.sidebar nav a span { min-width: 0; overflow-wrap: anywhere; }
.agenda-title { flex: 1; }
.agenda-title strong, .agenda-title small { white-space: normal; overflow: visible; text-overflow: clip; max-width: none; overflow-wrap: anywhere; }
.agenda-time { flex-shrink: 0; }
.assistant-usage > div { flex-wrap: wrap; }
.assistant-usage span { flex: 1 1 85px; min-width: 0; }
.bar { height: var(--stage-share); }
.global-search input { width: 300px; }
@media (min-width: 641px) and (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .topbar { height: auto; min-height: 78px; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
    .top-actions { margin-left: auto; }
}
/* Native selects cannot wrap their selected option. Show its complete value
   below the field only when the browser measures that it does not fit. */
label[data-selected-overflow]::after {
    content: attr(data-selected-overflow);
    display: block;
    margin-top: 6px;
    font-size:var(--type-caption, 13px);
    font-weight: 400;
    line-height: 1.6;
    color: var(--rr-blue);
    overflow-wrap: anywhere;
}
@media (max-width: 950px) {
    .sidebar nav a { padding-left: 0; padding-right: 0; }
}
@media (max-width: 640px) {
    .page-heading { flex-direction: column; align-items: stretch; }
    .heading-actions { width: 100%; }
    .heading-actions .button { white-space: normal; }
    .team-row > div { flex: 1 1 calc(100% - 50px); min-width: 0; }
    .panel-heading, .section-heading { flex-wrap: wrap; }
    .topbar { height: auto; min-height: 65px; gap: 8px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
    .breadcrumb { min-width: 0; flex-wrap: wrap; gap: 8px; }
    .top-actions { margin-left: auto; }
    .form-grid, .mailbox-server-grid { grid-template-columns: minmax(0, 1fr); }
    .toolbar select { flex: 1 1 170px; width: 100%; max-width: 100%; }
    .toolbar .segmented { max-width: 100%; }
    .segmented button { white-space: normal; }
    .agenda-row { flex-wrap: wrap; }
    .agenda-title { flex-basis: 110px; }
    .agenda-time { margin-left: 45px; }
    .pipeline-chart { height: auto; flex-direction: column; gap: 12px; }
    .chart-column { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(35px, 1fr) 20px; align-items: center; gap: 8px; font-size:var(--type-caption, 13px); }
    .chart-column > span { grid-column: 1; grid-row: 1; margin: 0; }
    .chart-column .bar-track { grid-column: 2; grid-row: 1; height: 14px; border: 0; }
    .chart-column strong { grid-column: 3; grid-row: 1; margin: 0; text-align: right; }
    .chart-column .bar { height: 14px; width: var(--stage-share); border-radius: 3px; }
    .settings-panel .panel-content { min-width: 0; }
    .assistant-banner > div { min-width: 0; }
    .assistant-prompt textarea { min-height: 180px; }
}
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: minmax(0, 1fr); }
    .stat > strong { font-size: 24px; }
}

/* Keep these after responsive rules so small screens retain readable text.
   Tables scroll within their wrapper; toolbars wrap onto additional rows. */
table { font-size: var(--data-text-size); line-height: 1.5; }
th { font-size: var(--data-secondary-size); font-weight: 600; color: #465563; }
td { color: #354858; }
.property-cell, .source-label, .lead-name strong { font-size: var(--data-text-size); }
.lead-name small, table small, table .small-text, table .muted {
    font-size: var(--data-secondary-size); color: #53616d; line-height: 1.5;
}
.lead-name .avatar { width: 36px; height: 36px; font-size:var(--type-caption, 13px); flex-shrink: 0; }
.toolbar input, .toolbar select, .toolbar .button, .segmented button,
.toolbar .inline-label, .search-field input, .check-label {
    font-size: var(--data-text-size); line-height: 1.5;
}
.toolbar input, .toolbar select, .toolbar .button, .segmented button { min-height: 44px; }
.toolbar select { min-width: 170px; }
.toolbar .inline-label input { width: 175px; }
.toolbar .inline-label { flex-wrap: wrap; }
.search-field { min-width: 0; max-width: 100%; color: #53616d; border-color: #b8c2ca; }
.toolbar select, .toolbar input { border-color: #b8c2ca; }
input::placeholder, textarea::placeholder { color: #5d6974; opacity: 1; }
.segmented button { color: #465563; }
.segmented button.selected { color: #9d171f; font-weight: 600; }
.result-count { font-size: var(--data-secondary-size); color: #53616d; }
.badge, .team-row .badge { font-size:var(--type-caption, 13px); font-weight: 600; line-height: 1.5; }
.badge.new { color: #466034; }
.badge.contacted, .badge.qualified { color: #69591d; }
.badge.viewing { color: #3d5879; }
.badge.offer { color: #69467f; }
.badge.won, .badge.available, .badge.active, .badge.accepted, .badge.sent,
.property-image > .badge.available { color: #38632f; }
.badge.lost, .badge.inactive, .badge.unconfirmed { color: #944635; }
.badge.reserved { color: #705917; }
.kanban-heading, .kanban-card strong, .kanban-card b,
.team-row strong, .mail-row strong, .task-description > strong,
.agenda-title strong, .property-body h3 { font-size: var(--data-text-size); }
.kanban-card small, .kanban-card > span, .task-description > small,
.task-description p, .task-date, .task-date > small, .team-row small,
.team-row .role-label, .mail-row small, .mail-row p, .agenda-title small,
.agenda-time, .property-body p, .property-meta, .property-access,
.mailbox-table label, .mailbox-table small {
    font-size: var(--data-secondary-size); color: #53616d; line-height: 1.5;
}
.mailbox-table input, .mailbox-table select, .mailbox-table .button { font-size: 14px; }
@media (max-width: 640px) {
    .toolbar .inline-label { width: 100%; }
    .toolbar .inline-label input { flex: 1; }
}

/* Assignment needs attention independently of the lead's pipeline stage. */
.unassigned-owner {
    display: inline-block;
    padding: 4px 9px;
    border: 1px solid #edc58d;
    border-radius: 5px;
    background: #fff3df;
    color: #804600;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}

/* Lead details: readable form sections and a distinct history column. */
.modal:has(:is(.lead-dialog, .property-dialog)) { width: 1180px; background: #f8f7f5; padding: 28px; }
:is(.lead-dialog, .property-dialog) { font-size: 15px; line-height: 1.5; }
:is(.lead-dialog, .property-dialog) .modal-heading { margin-bottom: 16px; }
:is(.lead-dialog, .property-dialog) .modal-heading h2 { font-size: 28px; margin: 6px 0 10px; }
:is(.lead-dialog, .property-dialog) .eyebrow { font-size:var(--type-caption, 13px); letter-spacing: 1px; }
:is(.lead-dialog, .property-dialog) h3 { font-size: 19px; }
:is(.lead-dialog, .property-dialog) label { font-size: 14px; font-weight: 600; color: #465563; margin-bottom: 0; }
:is(.lead-dialog, .property-dialog) input, :is(.lead-dialog, .property-dialog) select, :is(.lead-dialog, .property-dialog) textarea { font-size: 15px; min-height: 44px; border-color: #bec8d0; }
:is(.lead-dialog, .property-dialog) .button, :is(.lead-dialog, .property-dialog) .text-button { font-size: 14px; min-height: 42px; }
:is(.lead-dialog, .property-dialog) .form-grid { gap: 18px; }
:is(.lead-dialog, .property-dialog) .lead-detail-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-form-section, :is(.lead-dialog, .property-dialog) .timeline-panel { background: white; padding: 22px; border: 1px solid #dfe3e6; border-radius: 12px; }
.detail-form-section { margin-bottom: 18px; }
.detail-form-section h3 { margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #e4e6e9; }
:is(.lead-dialog, .property-dialog) .form-actions { padding: 16px; background: white; border: 1px solid #dfe3e6; border-radius: 10px; }
:is(.lead-dialog, .property-dialog) .timeline { max-height: none; padding-top: 8px; }
:is(.lead-dialog, .property-dialog) .timeline article > small { font-size:var(--type-small, 14px); color: #53616d; }
:is(.lead-dialog, .property-dialog) .timeline article > strong { font-size: 15px; }
:is(.lead-dialog, .property-dialog) .timeline article p { font-size: 14px; color: #465563; line-height: 1.7; }
:is(.lead-dialog, .property-dialog) .timeline-panel .section-heading { gap: 12px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .section-heading > div { flex-direction: row; flex-wrap: wrap; gap: 8px; }
:is(.lead-dialog, .property-dialog) .workflow-panel { background: #edf3f6; border-color: #ccdbe3; padding: 22px; margin: 20px 0 24px; }
:is(.lead-dialog, .property-dialog) .notice { font-size: 14px; color: #465c35; }
.workflow-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.workflow-metrics > div { background: #fff; padding: 14px 16px; border: 1px solid #dce5ea; border-radius: 8px; }
.workflow-metrics strong { font-size:var(--type-small, 14px); color: #53616d; font-weight: 600; }
.workflow-metrics p { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--rr-blue); }
:is(.lead-dialog, .property-dialog) .workflow-call { margin: 18px 0 14px; padding-top: 18px; border-top: 1px solid #ccdbe3; }
:is(.lead-dialog, .property-dialog) .workflow-call textarea { min-height: 80px; }
@media (max-width: 950px) { :is(.lead-dialog, .property-dialog) .lead-detail-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .modal:has(:is(.lead-dialog, .property-dialog)) { padding: 20px 14px; }
    :is(.lead-dialog, .property-dialog) .modal-heading h2 { font-size: 24px; }
    .detail-form-section, :is(.lead-dialog, .property-dialog) .timeline-panel, :is(.lead-dialog, .property-dialog) .workflow-panel { padding: 16px; }
    .workflow-metrics { grid-template-columns: minmax(0, 1fr); }
    :is(.lead-dialog, .property-dialog) input, :is(.lead-dialog, .property-dialog) select, :is(.lead-dialog, .property-dialog) textarea { font-size: 16px; }
}
:is(.lead-dialog, .property-dialog) > .button { margin-bottom: 20px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .workflow-panel { margin: 0 0 26px; padding: 16px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .workflow-metrics { grid-template-columns: minmax(0, 1fr); gap: 8px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .workflow-metrics > div { padding: 10px 12px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .workflow-metrics p { margin-top: 3px; }
:is(.lead-dialog, .property-dialog) .timeline-panel .workflow-call { grid-template-columns: minmax(0, 1fr); }
:is(.lead-dialog, .property-dialog) input, :is(.lead-dialog, .property-dialog) select, :is(.lead-dialog, .property-dialog) textarea { font-weight: 400; }

.property-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.property-sections .detail-form-section { margin-bottom: 0; min-width: 0; }
.property-dialog label small, .property-dialog .muted, .property-dialog .small-text,
.property-dialog .publish-row small { font-size:var(--type-small, 14px); line-height: 1.6; color: #53616d; }
.property-dialog .property-media { margin-top: 24px; }
.property-dialog textarea { min-height: 180px; }
.property-dialog .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.property-dialog .media-grid img { height: 140px; }
.property-dialog .media-grid a, .property-dialog .media-grid .text-button,
.property-dialog .publish-row strong { font-size: 14px; }
.property-dialog .upload-zone input { max-width: 100%; min-height: 44px; font-size: 14px; }
.property-dialog .publish-row { flex-wrap: wrap; }
.property-dialog .publish-row > div { min-width: 0; }
@media (max-width: 950px) { .property-sections { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
    .property-dialog .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .property-dialog .media-grid img { height: 100px; }
}
