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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f7fb;
    color: #1f2937;
}

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 20px;
}

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

.label {
    color: #2563eb;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.intro {
    max-width: 700px;
    margin: 0 auto 35px;
    font-size: 18px;
    color: #6b7280;
    line-height: 1.6;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

button {
    padding: 15px 28px;
    border: none;
    border-radius: 10px;
    background: #2563eb;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: .2s;
}

button:hover {
    transform: translateY(-2px);
}

.secondary {
    background: white;
    color: #2563eb;
    border: 2px solid #2563eb;
}

.card {
    background: white;
    border-radius: 18px;
    padding: 35px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.card h2 {
    text-align: center;
    margin-bottom: 30px;
}

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

.features article {
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
}

.features h3 {
    margin-bottom: 10px;
}

.chat-launcher {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    padding: 0;
    font-size: 24px;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
    z-index: 1000;
}

.chat-widget {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 130px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    z-index: 999;
}

.chat-widget.open {
    display: flex;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
    background: #1d4ed8;
    color: white;
}

.chat-header div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-header span {
    font-size: 13px;
    opacity: 0.85;
}

.chat-header button {
    padding: 0;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 24px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    background: #f8fafc;
}

.message {
    width: fit-content;
    max-width: 82%;
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    line-height: 1.45;
}

.ai-message {
    background: white;
    border: 1px solid #e5e7eb;
}

.customer-message {
    margin-left: auto;
    background: #2563eb;
    color: white;
}

.quick-actions {
    display: grid;
    gap: 8px;
    margin: 12px 0 18px;
}

.quick-actions button {
    width: 100%;
    padding: 11px 13px;
    background: white;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    text-align: left;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 14px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.chat-form input {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
}

.chat-form input:focus {
    border-color: #2563eb;
}

.chat-form button {
    padding: 12px 16px;
}

@media (max-width: 600px) {
    .chat-widget {
        right: 16px;
        bottom: 86px;
        width: calc(100vw - 32px);
        height: 70vh;
    }

    .chat-launcher {
        right: 16px;
        bottom: 16px;
    }
}

.message {
    white-space: pre-line;
}

.dashboard-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.logout-link {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.logout-link:hover {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .dashboard-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .logout-link {
        text-align: center;
    }
}

/* ===== Dashboard v1 ===== */

.dashboard-subtitle {
    margin-top: 6px;
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}

.dashboard-topbar {
    align-items: center;
    text-align: left;
}

.dashboard-topbar h1 {
    margin-bottom: 0;
}

.dashboard-topbar .label {
    margin-bottom: 6px;
}

.features {
    margin-top: 24px;
}

.features article {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.features h3 {
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.features article p {
    font-size: 34px;
    font-weight: 700;
    color: #0f172a;
}

.calendar-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.calendar-card h2 {
    text-align: left;
    margin-bottom: 8px;
}

.calendar-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-weight: 600;
}

.status-online {
    color: #166534;
}

.status-offline {
    color: #92400e;
}

.appointments {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.appointments article {
    display: grid;
    grid-template-columns: 1.2fr 1.6fr 1fr 1fr 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

.appointments article h3 {
    margin: 0;
    font-size: 16px;
}

.appointments article p {
    margin: 0;
    font-size: 14px;
    color: #475569;
}

@media (max-width: 800px) {
    .dashboard-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .appointments article {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .features article p {
        font-size: 28px;
    }
}

.appointments-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 24px;
}

.appointments-header h2 {
    text-align: left;
    margin-bottom: 6px;
}

.appointments-header p {
    color: #64748b;
    font-size: 14px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-form input {
    width: 260px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
}

.search-form input:focus {
    border-color: #2563eb;
}

.search-form button {
    padding: 11px 16px;
}

.clear-search {
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}

@media (max-width: 800px) {
    .appointments-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-wrap: wrap;
    }

    .search-form input {
        width: 100%;
    }
}

.appointment-actions {
    display: flex;
    justify-content: flex-end;
}

.danger-button {
    background: white;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 9px 13px;
    font-size: 13px;
}

.danger-button:hover {
    background: #fef2f2;
}

.appointment-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.edit-button {
    display: inline-block;
    padding: 9px 13px;
    border-radius: 10px;
    background: white;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.edit-button:hover {
    background: #eff6ff;
}

/* ===== Dashboard mobile polish ===== */
@media (max-width: 600px) {
    .page {
        padding: 24px 14px;
    }

    .hero {
        margin-bottom: 28px;
        text-align: left;
    }

    .dashboard-topbar {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .dashboard-topbar h1 {
        font-size: 28px;
        line-height: 1.15;
        word-break: break-word;
    }

    .dashboard-subtitle {
        font-size: 13px;
    }

    .logout-link {
        width: auto;
        flex-shrink: 0;
        padding: 9px 12px;
        font-size: 13px;
        text-align: center;
    }

    .intro {
        margin: 18px 0 0;
        font-size: 14px;
        line-height: 1.5;
        text-align: left;
    }

    .card {
        padding: 20px;
        border-radius: 14px;
    }

    .calendar-card {
        gap: 12px;
    }

    .calendar-card h2 {
        font-size: 19px;
    }

    .calendar-status {
        font-size: 13px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .features article {
        padding: 18px;
    }

    .features article p {
        font-size: 26px;
    }

    .appointments-header {
        gap: 14px;
        margin-bottom: 18px;
    }

    .appointments-header h2 {
        font-size: 21px;
    }

    .search-form {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px;
        width: 100%;
    }

    .search-form input {
        width: 100%;
        min-width: 0;
    }

    .search-form button {
        padding: 11px 14px;
    }

    .clear-search {
        grid-column: 1 / -1;
    }

    .appointments {
        gap: 12px;
    }

    .appointments article {
        display: block;
        padding: 18px;
    }

    .appointments article h3 {
        font-size: 17px;
        margin-bottom: 12px;
    }

    .appointments article p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 6px;
    }

    .appointment-actions {
        justify-content: flex-start;
        width: 100%;
        margin-top: 14px;
    }

    .appointment-actions .edit-button,
    .appointment-actions form {
        flex: 1;
    }

    .appointment-actions .edit-button {
        text-align: center;
    }

    .appointment-actions .danger-button {
        width: 100%;
    }
}

/* ===== Dashboard tablet/mobile final fix ===== */
@media (max-width: 700px) {
    .features {
        grid-template-columns: 1fr;
    }

    .dashboard-topbar {
        flex-direction: row;
        align-items: flex-start;
    }

    .dashboard-topbar .logout-link {
        width: auto;
        flex: 0 0 auto;
    }
}

/* ===== Dashboard feedback ===== */
.dashboard-success {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    color: #166534;
    font-size: 14px;
    font-weight: 600;
}

.dashboard-success span {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #166534;
    color: white;
    font-size: 13px;
}

@media (max-width: 600px) {
    .dashboard-success {
        padding: 13px 14px;
        font-size: 13px;
        align-items: flex-start;
    }
}

.dashboard-error {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 600;
}

.dashboard-error span {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #991b1b;
    color: white;
    font-size: 13px;
}


/* ===== Openingstijden ===== */

.opening-hours-card {
    max-width: 850px;
    margin: 0 auto;
}

.settings-heading {
    margin-bottom: 28px;
}

.settings-heading h2 {
    text-align: left;
    margin-bottom: 8px;
}

.settings-heading p {
    color: #64748b;
    line-height: 1.5;
}

.opening-hours-list {
    display: grid;
    gap: 12px;
}

.opening-hours-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr 1fr;
    gap: 18px;
    align-items: center;

    padding: 16px 18px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.opening-day {
    font-size: 15px;
}

.opening-toggle {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    cursor: pointer;
}

.opening-toggle input {
    width: 18px;
    height: 18px;
}

.opening-time label {
    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 13px;
    color: #64748b;
}

.opening-time input {
    width: 100%;
    padding: 9px 10px;

    border: 1px solid #cbd5e1;
    border-radius: 9px;

    background: white;
    font-size: 14px;
}

.opening-hours-actions {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-top: 28px;
}


@media (max-width: 700px) {

    .opening-hours-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .opening-day {
        font-size: 16px;
    }

    .opening-time label {
        flex-direction: column;
        align-items: flex-start;
    }

    .opening-hours-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .opening-hours-actions button {
        width: 100%;
    }

    .opening-hours-actions .clear-search {
        text-align: center;
    }
}

/* ===== Mobile chat fullscreen polish ===== */
@media (max-width: 700px) {
    .chat-widget {
        right: 10px;
        left: 10px;
        bottom: 82px;
        width: auto;
        height: calc(100vh - 110px);
        max-width: none;
        max-height: none;
        border-radius: 16px;
    }

    .chat-header {
        padding: 16px;
    }

    .chat-header strong {
        font-size: 15px;
    }

    .chat-messages {
        padding: 14px;
    }

    .message {
        max-width: 90%;
        font-size: 14px;
    }

    .quick-actions button {
        padding: 12px;
        font-size: 14px;
    }

    .chat-form {
        padding: 10px;
    }

    .chat-form input {
        font-size: 16px;
    }

    .chat-form button {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ===== Standalone embeddable widget ===== */
.widget-only-page {
    margin: 0;
    min-height: 100vh;
    background: transparent;
}

/* ===== Onboarding ===== */

.onboarding-card {
    max-width: 850px;
    margin: 0 auto;
}

.onboarding-step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;

    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.onboarding-step h3 {
    margin-bottom: 6px;
}

.onboarding-step p {
    color: #64748b;
    line-height: 1.5;
}

.onboarding-step-action {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.widget-code-box {
    margin-top: 22px;
    padding: 16px;

    overflow-x: auto;

    background: #0f172a;
    border-radius: 12px;
}

.widget-code-box code {
    color: white;
    white-space: nowrap;
    font-size: 13px;
}

.widget-code-note {
    margin-top: 10px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 700px) {
    .onboarding-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .onboarding-step-action {
        width: 100%;
        justify-content: space-between;
    }

    .onboarding-step-action .edit-button {
        text-align: center;
    }
}

/* Afleverstatus met tekstlabels; kleur is aanvullend. */
.reminder-status { margin: 16px 0; padding: 12px 14px; background: #f5f7fa; border-radius: 10px; }
.reminder-status p { margin: 6px 0; font-size: 0.95rem; }
.reminder-badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.reminder-neutraal { background: #e2e8f0; color: #253349; }
.reminder-goed { background: #dcfce7; color: #166534; }
.reminder-fout { background: #fee2e2; color: #991b1b; }


/* Huisstijl van de makelaar: alleen publieke klantinterfaces */
.customer-page .label {
    color: var(--makelaar-merkkleur);
}

.customer-page button,
.widget-only-page .chat-launcher,
.widget-only-page .chat-form button {
    background: var(--makelaar-merkkleur);
}

.customer-page .secondary {
    background: white;
    color: var(--makelaar-merkkleur);
    border-color: var(--makelaar-merkkleur);
}

.customer-page .chat-header,
.widget-only-page .chat-header {
    background: var(--makelaar-merkkleur);
}

.customer-page .customer-message,
.widget-only-page .customer-message {
    background: var(--makelaar-merkkleur);
}

.customer-page .quick-actions button,
.widget-only-page .quick-actions button {
    background: white;
    color: var(--makelaar-merkkleur);
}

.customer-page .chat-form input:focus,
.widget-only-page .chat-form input:focus {
    border-color: var(--makelaar-merkkleur);
}

/* Bedrijfsgegevens: overzichtelijk en mobielvriendelijk formulier */
.business-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.business-form > label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    font-weight: 600;
}

.business-form > label > input:not([type="color"]) {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font: inherit;
}

.business-form input[type="color"] {
    width: 70px;
    height: 44px;
    cursor: pointer;
}

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

.business-form > .opening-hours-actions {
    grid-column: 1 / -1;
}

@media (max-width: 700px) {
    .business-form {
        grid-template-columns: 1fr;
    }
}


/* Tekst binnen de assistentblokken */
.features > article {
    min-width: 0;
}
.features > article > p {
    font-size: 1.125rem;
    line-height: 1.55;
    font-weight: 400;
    white-space: normal;
    overflow-wrap: anywhere;
}


/* Zichtbare tekst in chatinvoerveld */
.chat-form #chat-input {
    color: #172338;
    background-color: #ffffff;
    -webkit-text-fill-color: #172338;
    caret-color: #172338;
    color-scheme: light;
}
