/* ==========================================================================
   AppointmentPlanner Admin - Global Design System & Theme Styles
   ========================================================================== */

:root {
    /* Status Semantics (Theme-derived with safe fallbacks) */
    --app-status-free: var(--rz-success, #4caf50);
    --app-status-free-bg: var(--rz-success-lighter, rgba(76, 175, 80, 0.12));
    --app-status-free-border: var(--rz-success-light, rgba(76, 175, 80, 0.4));

    --app-status-booked: var(--rz-primary, #4340d2);
    --app-status-booked-bg: var(--rz-primary-lighter, rgba(67, 64, 210, 0.12));
    --app-status-booked-border: var(--rz-primary-light, rgba(67, 64, 210, 0.4));

    --app-status-locked: var(--rz-warning, #ff9800);
    --app-status-locked-bg: var(--rz-warning-lighter, rgba(255, 152, 0, 0.14));
    --app-status-locked-border: var(--rz-warning-light, rgba(255, 152, 0, 0.45));

    --app-status-cancelled: var(--rz-danger, #f44336);
    --app-status-cancelled-bg: var(--rz-danger-lighter, rgba(244, 67, 54, 0.12));
    --app-status-cancelled-border: var(--rz-danger-light, rgba(244, 67, 54, 0.4));

    --app-status-planned: var(--rz-info, #2196f3);
    --app-status-planned-bg: var(--rz-info-lighter, rgba(33, 150, 243, 0.12));
    --app-status-planned-border: var(--rz-info-light, rgba(33, 150, 243, 0.4));

    /* Surface & Border Tokens mapping to Radzen theme */
    --app-border-color: var(--rz-base-300, rgba(128, 128, 128, 0.2));
    --app-surface-0: var(--rz-panel-background-color, var(--rz-base-background-color, #ffffff));
    --app-surface-50: color-mix(in srgb, var(--rz-text-color, #212121) 4%, var(--rz-base-background-color, #ffffff));
    --app-surface-100: color-mix(in srgb, var(--rz-text-color, #212121) 8%, var(--rz-base-background-color, #ffffff));

    /* Compatibility aliases */
    --rz-border-color: var(--app-border-color);
    --rz-background-color: var(--rz-base-background-color);
    --rz-surface-0: var(--app-surface-0);
    --rz-surface-50: var(--app-surface-50);
    --rz-surface-100: var(--app-surface-100);

    /* Dimensions & Layout */
    --app-card-radius: 8px;
    --app-header-height: 60px;
    --app-sidebar-width: 250px;
    --app-transition-fast: 0.15s ease-in-out;
    --app-transition-normal: 0.25s ease-in-out;
}

/* --------------------------------------------------------------------------
   Global Layout & Shell
   -------------------------------------------------------------------------- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

.admin-header {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    height: var(--app-header-height);
    background-color: var(--rz-base-background-color, var(--app-surface-0));
    color: var(--rz-text-color);
    border-bottom: 1px solid var(--app-border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 10;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--rz-text-color);
    user-select: none;
}

.admin-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--rz-primary), var(--rz-primary-dark, #1565c0));
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.admin-brand-title {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--rz-text-title-color, var(--rz-text-color));
    margin: 0;
}

.admin-brand-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--app-status-booked-bg);
    color: var(--rz-primary);
    border: 1px solid var(--app-status-booked-border);
}

.admin-header-center {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
    flex-grow: 1;
    min-width: 0;
}

.admin-breadcrumbs {
    display: flex;
    align-items: center;
}

.admin-breadcrumbs .rz-link {
    color: var(--rz-text-color);
}

.admin-breadcrumbs .rz-link:hover,
.admin-breadcrumbs .rz-link:focus {
    color: var(--rz-primary);
}

/* Header button contrast (ButtonStyle.Base + Variant.Text) */
.admin-header .rz-button.rz-variant-text.rz-base:hover {
    background-color: var(--app-surface-100);
}

.admin-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    background-color: var(--rz-panel-background-color, var(--app-surface-100));
    border: 1px solid var(--app-border-color);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rz-text-color);
}

.admin-user-pill-icon {
    color: var(--rz-primary);
    font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   Sidebar & Navigation
   -------------------------------------------------------------------------- */
.admin-sidebar {
    background-color: var(--rz-sidebar-background-color, var(--app-surface-0)) !important;
    border-right: 1px solid var(--app-border-color);
}

.admin-nav-category {
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--rz-text-secondary-color) !important;
    padding: 1rem 1.25rem 0.35rem 1.25rem !important;
    margin: 0 !important;
}

.admin-nav-menu {
    background: transparent !important;
    padding: 0 0.5rem;
}

.admin-nav-menu .rz-navigation-item-link {
    border-radius: 6px;
    margin-bottom: 2px;
    padding: 0.625rem 0.875rem !important;
    transition: var(--app-transition-fast);
}

.admin-nav-menu .rz-navigation-item-link:hover {
    background-color: var(--app-surface-100);
}

.admin-nav-menu .rz-navigation-item-wrapper-active .rz-navigation-item-link {
    background-color: var(--app-status-booked-bg) !important;
    color: var(--rz-primary) !important;
    font-weight: 600;
}

.admin-nav-menu .rz-navigation-item-wrapper-active .rz-navigation-item-icon {
    color: var(--rz-primary) !important;
}

/* --------------------------------------------------------------------------
   Status Semantic Badges & Chips
   -------------------------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge-free {
    background-color: var(--app-status-free-bg);
    color: var(--app-status-free);
    border: 1px solid var(--app-status-free-border);
}

.status-badge-booked {
    background-color: var(--app-status-booked-bg);
    color: var(--app-status-booked);
    border: 1px solid var(--app-status-booked-border);
}

.status-badge-locked {
    background-color: var(--app-status-locked-bg);
    color: var(--app-status-locked);
    border: 1px solid var(--app-status-locked-border);
}

.status-badge-cancelled {
    background-color: var(--app-status-cancelled-bg);
    color: var(--app-status-cancelled);
    border: 1px solid var(--app-status-cancelled-border);
}

.status-badge-planned {
    background-color: var(--app-status-planned-bg);
    color: var(--app-status-planned);
    border: 1px solid var(--app-status-planned-border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot-free {
    background-color: var(--app-status-free);
}

.status-dot-booked {
    background-color: var(--app-status-booked);
}

.status-dot-locked {
    background-color: var(--app-status-locked);
}

.status-dot-cancelled {
    background-color: var(--app-status-cancelled);
}

.status-dot-planned {
    background-color: var(--app-status-planned);
}

/* --------------------------------------------------------------------------
   Admin Dialog & Modal Framework
   -------------------------------------------------------------------------- */
.admin-dialog {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0.25rem;
    min-width: 0;
}

.admin-dialog-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.admin-dialog-details {
    padding: 1.25rem;
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    background-color: var(--rz-base-background-color, var(--app-surface-50));
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-dialog-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--app-border-color);
}

.admin-dialog-actions .rz-button {
    min-width: 6.5rem;
}

.admin-dialog-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.admin-dialog-field > .rz-datepicker,
.admin-dialog-field > .rz-textbox,
.admin-dialog-field > .rz-textarea,
.admin-dialog-field > .rz-dropdown {
    width: 100%;
}

.admin-dialog-list {
    min-height: 18rem;
    max-height: 24rem;
    overflow-y: auto;
    border: 1px solid var(--app-border-color);
    border-radius: 6px;
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
}

.admin-dialog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.admin-dialog-header-card {
    padding: 0.875rem 1.125rem;
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.schedule-dialog-icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    font-size: 1.375rem;
}

.schedule-dialog-icon-badge.status-icon-free {
    background-color: var(--app-status-free-bg);
    color: var(--app-status-free);
}

.schedule-dialog-icon-badge.status-icon-booked {
    background-color: var(--app-status-booked-bg);
    color: var(--app-status-booked);
}

.schedule-dialog-icon-badge.status-icon-locked {
    background-color: var(--app-status-locked-bg);
    color: var(--app-status-locked);
}

.schedule-dialog-icon-badge.status-icon-planned {
    background-color: var(--app-status-planned-bg);
    color: var(--app-status-planned);
}

.schedule-dialog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--rz-text-secondary-color);
}

.schedule-dialog-tabs {
    border: 1px solid var(--app-border-color) !important;
    background-color: var(--rz-panel-background-color, var(--app-surface-0)) !important;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Login Page Styling
   -------------------------------------------------------------------------- */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: radial-gradient(circle at 50% 20%, var(--app-surface-100), var(--rz-base-background-color, #121212));
}

.login-card {
    width: 100%;
    max-width: 440px;
    border-radius: 12px !important;
    border: 1px solid var(--app-border-color);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
    background-color: var(--rz-panel-background-color, var(--app-surface-0)) !important;
    overflow: hidden;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--rz-primary), var(--rz-primary-dark, #1565c0));
    color: #ffffff;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.login-form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   Scheduler & Calendar System
   -------------------------------------------------------------------------- */
.schedule-page-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    gap: 0.75rem;
}

.scheduler-header-card {
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    padding: 0.875rem 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.875rem;
}

.scheduler-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.scheduler-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    color: var(--rz-text-title-color, var(--rz-text-color));
    line-height: 1.2;
}

.scheduler-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.scheduler-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--app-border-color);
    background-color: var(--app-surface-50);
    color: var(--rz-text-color);
    cursor: pointer;
    transition: var(--app-transition-fast);
    user-select: none;
    outline: none;
}

.scheduler-filter-chip:hover {
    background-color: var(--app-surface-100);
    border-color: var(--rz-text-secondary-color);
}

.scheduler-filter-chip.active {
    background-color: var(--app-status-booked-bg);
    border-color: var(--rz-primary);
    color: var(--rz-primary);
    font-weight: 600;
}

.scheduler-filter-chip.active-free {
    background-color: var(--app-status-free-bg);
    border-color: var(--app-status-free);
    color: var(--app-status-free);
    font-weight: 600;
}

.scheduler-filter-chip.active-booked {
    background-color: var(--app-status-booked-bg);
    border-color: var(--app-status-booked);
    color: var(--app-status-booked);
    font-weight: 600;
}

.scheduler-filter-chip.active-locked {
    background-color: var(--app-status-locked-bg);
    border-color: var(--app-status-locked);
    color: var(--app-status-locked);
    font-weight: 600;
}

.scheduler-filter-chip.active-planned {
    background-color: var(--app-status-planned-bg);
    border-color: var(--app-status-planned);
    color: var(--app-status-planned);
    font-weight: 600;
}

.filter-badge-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    background-color: var(--app-surface-100);
    color: var(--rz-text-color);
}

.scheduler-filter-chip.active .filter-badge-count {
    background-color: var(--rz-primary);
    color: #ffffff;
}

.scheduler-filter-chip.active-free .filter-badge-count {
    background-color: var(--app-status-free);
    color: #ffffff;
}

.scheduler-filter-chip.active-booked .filter-badge-count {
    background-color: var(--app-status-booked);
    color: #ffffff;
}

.scheduler-filter-chip.active-locked .filter-badge-count {
    background-color: var(--app-status-locked);
    color: #ffffff;
}

.scheduler-actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scheduler-wrapper {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: auto;
    min-width: 0;
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.scheduler-wrapper .rz-scheduler {
    min-width: 650px;
    height: 100%;
}

/*
 * Radzen renders day/week slots with a fixed height of 1.5em and positions appointments in em as well,
 * so the time grid never grows with the screen. The view content becomes a size container and the slot
 * unit is derived from its height, stretching slots, hour labels and appointments to fill the space.
 * 1rem stays the lower bound, so small screens keep scrolling as before.
 */
.admin-scheduler .rz-day-view .rz-view-content,
.admin-scheduler .rz-week-view .rz-view-content {
    container-type: size;
    overflow-y: scroll;
    --scheduler-slot-unit: max(1rem, calc(100cqh / (var(--scheduler-slot-count, 28) * 1.5) - 0.01px));
}

.admin-scheduler .rz-day-view .rz-slots,
.admin-scheduler .rz-week-view .rz-slots {
    font-size: var(--scheduler-slot-unit);
}

.admin-scheduler .rz-slot-hours .rz-slot-header {
    height: calc(var(--scheduler-slot-unit) * 1.5);
}

.scheduler-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 0.35rem 0.5rem;
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--app-border-color);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    cursor: pointer;
}

.scheduler-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
}

.scheduler-card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.scheduler-card-content {
    margin-left: 4px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.scheduler-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    margin-bottom: 2px;
}

.scheduler-card-status {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1;
}

.scheduler-card-body {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scheduler-card-user {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rz-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.scheduler-card-time {
    font-size: 0.6875rem;
    color: var(--rz-text-secondary-color);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Admin Tabs & Panels
   -------------------------------------------------------------------------- */
.admin-tabs {
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border: 1px solid var(--app-border-color);
}

.admin-tabs .rz-tabview-nav {
    background-color: var(--app-surface-50);
    border-bottom: 1px solid var(--app-border-color);
    padding: 0.25rem 0.5rem 0 0.5rem;
    gap: 0.25rem;
}

.admin-tabs .rz-tabview-title {
    font-size: 0.875rem;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   Card & Toolbar Helpers
   -------------------------------------------------------------------------- */
.admin-card {
    border-radius: var(--app-card-radius) !important;
    border: 1px solid var(--app-border-color);
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: var(--app-transition-fast);
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--app-border-color);
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--app-border-color);
    background-color: var(--app-surface-50);
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Custom Scrollbars
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--rz-scrollbar-color, var(--app-border-color));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rz-text-secondary-color);
}

/* --------------------------------------------------------------------------
   Chat & Communication Module
   -------------------------------------------------------------------------- */
.chat-page-container {
    height: 100%;
    min-height: 0;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.chat-grid {
    flex: 1 1 0;
    min-height: 0;
    display: grid;
    grid-template-columns: 290px 1fr 310px;
    gap: 1rem;
    height: 100%;
}

.chat-panel {
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background-color: var(--app-surface-50);
    border-bottom: 1px solid var(--app-border-color);
    min-height: 56px;
    box-sizing: border-box;
}

/* User / Contact List */
.chat-search-wrapper {
    position: relative;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--app-border-color);
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
}

.chat-search-wrapper .rz-textbox {
    width: 100%;
    padding-left: 2.25rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.chat-search-icon {
    position: absolute;
    left: 1.625rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--rz-text-secondary-color);
    pointer-events: none;
    z-index: 2;
}

.chat-user-list {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-user-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--app-transition-fast);
    border: 1px solid transparent;
    user-select: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font: inherit;
    color: inherit;
}

.chat-user-item:hover {
    background-color: var(--app-surface-100);
}

.chat-user-item:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 1px;
}

.chat-user-item.active {
    background-color: var(--app-status-booked-bg);
    border-color: var(--app-status-booked-border);
}

.chat-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rz-primary), var(--rz-primary-dark, #1565c0));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.chat-avatar-admin {
    background: linear-gradient(135deg, var(--rz-primary), #673ab7);
}

.chat-avatar-user {
    background: linear-gradient(135deg, #0288d1, #0097a7);
}

.chat-avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
}

.chat-status-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--rz-panel-background-color, var(--app-surface-0));
    background-color: var(--app-status-free);
}

.chat-user-info {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rz-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.chat-user-login {
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.chat-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 700;
    background-color: var(--app-status-booked-bg);
    color: var(--rz-primary);
    border: 1px solid var(--app-status-booked-border);
    flex-shrink: 0;
}

/* Chat Messages */
.chat-messages-container {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    background-color: var(--rz-base-background-color, var(--app-surface-50));
}

.chat-input-bar {
    padding: 0.875rem 1rem;
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border-top: 1px solid var(--app-border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-input-bar .rz-textbox {
    flex: 1 1 0;
    border-radius: 20px;
}

.chat-bubble-row {
    display: flex;
    width: 100%;
}

.chat-bubble-row-admin {
    justify-content: flex-end;
}

.chat-bubble-row-user {
    justify-content: flex-start;
}

.chat-bubble-row-system {
    justify-content: center;
}

.chat-bubble {
    max-width: 75%;
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.chat-bubble-admin {
    background: linear-gradient(135deg, var(--rz-primary), var(--rz-primary-dark, #1565c0));
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.chat-bubble-admin .chat-bubble-header {
    color: rgba(255, 255, 255, 0.85);
}

.chat-bubble-admin .chat-bubble-text {
    color: #ffffff;
}

.chat-bubble-user {
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    color: var(--rz-text-color);
    border: 1px solid var(--app-border-color);
    border-bottom-left-radius: 3px;
}

.chat-bubble-user .chat-bubble-header {
    color: var(--rz-text-secondary-color);
}

.chat-bubble-user .chat-bubble-text {
    color: var(--rz-text-color);
}

.chat-bubble-system {
    max-width: 85%;
    background-color: var(--app-status-planned-bg);
    border: 1px solid var(--app-status-planned-border);
    color: var(--app-status-planned);
    border-radius: 16px;
    padding: 0.375rem 0.875rem;
    text-align: center;
    align-items: center;
    box-shadow: none;
}

.chat-bubble-system .chat-bubble-header {
    color: var(--app-status-planned);
    font-size: 0.6875rem;
    justify-content: center;
}

.chat-bubble-system .chat-bubble-text {
    color: var(--rz-text-color);
    font-size: 0.8125rem;
}

.chat-bubble-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chat-bubble-text {
    font-size: 0.875rem;
    line-height: 1.45;
    white-space: pre-wrap;
    margin: 0;
}

/* Chat Appointment & Context Sidebar */
.chat-context-panel {
    display: flex;
    flex-direction: column;
}

.chat-context-content {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-user-profile-card {
    background-color: var(--app-surface-50);
    border: 1px solid var(--app-border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.375rem;
}

.chat-user-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--app-border-color);
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
    text-align: left;
}

.chat-appointment-card {
    background-color: var(--rz-panel-background-color, var(--app-surface-0));
    border: 1px solid var(--app-border-color);
    border-left: 4px solid var(--rz-primary);
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--app-transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chat-appointment-card:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.chat-appointment-card-free {
    border-left-color: var(--app-status-free);
}

.chat-appointment-card-booked {
    border-left-color: var(--app-status-booked);
}

.chat-appointment-card-locked {
    border-left-color: var(--app-status-locked);
}

.chat-appointment-card-planned {
    border-left-color: var(--app-status-planned);
}

.chat-appointment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chat-appointment-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rz-text-color);
}

.chat-appointment-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--rz-text-secondary-color);
}

.chat-appointment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--app-border-color);
}

.chat-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    color: var(--rz-text-secondary-color);
    flex: 1 1 0;
}

/* --------------------------------------------------------------------------
   Mobile & Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
    .chat-grid {
        grid-template-columns: 250px 1fr 260px;
        gap: 0.75rem;
    }
}

@media (max-width: 880px) {
    .chat-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        overflow-y: auto;
        height: auto;
    }

    .chat-panel {
        min-height: 350px;
    }
}

@media (max-width: 768px) {
    .admin-header {
        padding: 0 0.75rem;
    }

    .admin-header-center {
        display: none;
    }

    .admin-brand-title {
        font-size: 1rem;
    }

    .admin-brand-badge {
        display: none;
    }

    .admin-user-pill span {
        display: none;
    }

    .admin-dialog-actions {
        flex-direction: column-reverse;
        width: 100%;
    }

    .admin-dialog-actions .rz-button {
        width: 100%;
    }
}

/* User management */
.user-management-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(100%, 1440px);
    min-height: calc(100vh - var(--app-header-height));
    min-height: calc(100dvh - var(--app-header-height));
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem);
    box-sizing: border-box;
}

.user-management-page .smtp-page-header {
    margin-bottom: 0;
}

.user-management-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.user-management-title.rz-text {
    margin: 0;
    font-weight: 700;
    color: var(--rz-text-title-color, var(--rz-text-color));
}

.user-management-subtitle.rz-text,
.user-detail-subtitle.rz-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--rz-text-secondary-color);
}

.user-management-grid {
    display: grid;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.user-management-page .user-list-card,
.user-management-page .user-details-card {
    min-width: 0;
    padding: 1.25rem !important;
    background: var(--rz-panel-background-color, var(--app-surface-0)) !important;
    border: 1px solid var(--app-border-color) !important;
    border-radius: var(--app-card-radius) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05) !important;
}

.user-management-page .user-list-card {
    display: flex;
    flex-direction: column;
    min-height: 520px;
}

.user-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--app-border-color);
}

.user-section-title.rz-text {
    margin: 0;
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-weight: 700;
}

.user-search {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0.875rem 0;
    padding: 0 0.75rem;
    min-height: 42px;
    color: var(--rz-text-secondary-color);
    border: 1px solid var(--app-border-color);
    border-radius: 8px;
    background: var(--rz-base-background-color);
}

.user-search .rz-textbox {
    width: 100%;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.user-list-content {
    flex: 1;
    min-height: 0;
}

.user-list-box {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-list-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--rz-text-color);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--app-transition-fast), border-color var(--app-transition-fast);
}

.user-list-option:hover {
    background: var(--app-surface-100);
}

.user-list-option.selected {
    border-color: var(--rz-primary);
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent);
}

.user-list-option:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
}

.user-list-item-info,
.user-detail-heading {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.user-list-item-name,
.user-list-item-login {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-list-item-name {
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-size: 0.875rem;
    font-weight: 600;
}

.user-list-item-login {
    margin-top: 0.125rem;
    color: var(--rz-text-secondary-color);
    font-size: 0.75rem;
}

.user-list-chevron {
    margin-left: auto;
    color: var(--rz-text-secondary-color);
}

.user-avatar {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--app-surface-100);
    color: var(--rz-primary);
    font-weight: 700;
}

.user-empty-state,
.user-no-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    gap: 0.5rem;
    color: var(--rz-text-secondary-color);
    text-align: center;
}

.user-empty-state .rzi,
.user-no-selection .rzi {
    font-size: 2rem;
    opacity: 0.65;
}

.user-no-selection .rz-text {
    margin: 0;
}

.user-management-page .user-details-card {
    min-height: 520px;
}

.user-detail-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--app-border-color);
}

.user-detail-icon {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--app-surface-100);
    color: var(--rz-primary);
    font-size: 1.4rem;
}

.user-avatar-large {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
    font-size: 1rem;
}

.user-edit-button {
    margin-left: auto;
}

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

.user-information-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--app-border-color);
}

.user-information-row > span {
    color: var(--rz-text-secondary-color);
    font-size: 0.875rem;
}

.user-information-row > strong,
.user-information-row > code {
    min-width: 0;
    max-width: 65%;
    overflow-wrap: anywhere;
    text-align: right;
    color: var(--rz-text-color);
}

.user-information-row > code {
    font-size: 0.75rem;
}

.user-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.user-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.user-form-field-full {
    grid-column: 1 / -1;
}

.user-form-field label {
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-size: 0.8125rem;
    font-weight: 600;
}

.user-form-field label > span:not(.user-label-optional) {
    color: var(--rz-danger);
}

.user-form-field label.user-checkbox-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--rz-text-title-color, var(--rz-text-color));
}

.user-form-field label.user-checkbox-field > span {
    color: inherit;
}

.user-form-field .rz-textbox {
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
}

.user-password-field {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-password-field .rz-textbox {
    flex: 1;
    min-width: 0;
}

.user-field-hint {
    color: var(--rz-text-secondary-color);
    font-size: 0.75rem;
}

.user-label-optional {
    margin-left: 0.25rem;
    color: var(--rz-text-secondary-color);
    font-weight: 400;
}

.user-form-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.625rem;
    padding-top: 1rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--app-border-color);
}

.user-success {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    border: 1px solid var(--app-status-free-border);
    border-radius: var(--app-card-radius);
    background: var(--app-status-free-bg);
}

.user-success-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--app-status-free);
}

.user-success-heading .rz-text {
    margin: 0;
    font-weight: 700;
}

.user-credentials {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--rz-panel-background-color, var(--app-surface-0));
}

.user-credentials > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.user-credentials span {
    color: var(--rz-text-secondary-color);
    font-size: 0.8125rem;
}

.user-credentials strong {
    overflow-wrap: anywhere;
    text-align: right;
}

.user-password-value {
    color: var(--rz-primary);
    font-family: monospace;
}

@media (max-width: 850px) {
    .user-management-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-management-page .user-list-card,
    .user-management-page .user-details-card {
        min-height: auto;
    }

    .user-list-content {
        max-height: 280px;
        overflow-y: auto;
    }
}

@media (max-width: 560px) {
    .user-management-page {
        padding: 0.75rem;
    }

    .user-management-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-management-header > .rz-button {
        width: 100%;
    }

    .user-management-page .user-list-card,
    .user-management-page .user-details-card {
        padding: 1rem !important;
    }

    .user-edit-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .user-form-field-full {
        grid-column: auto;
    }

    .user-form-actions {
        flex-direction: column-reverse;
    }

    .user-form-actions .rz-button {
        width: 100%;
    }

    .user-information-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .user-information-row > strong,
    .user-information-row > code {
        max-width: 100%;
        text-align: left;
    }
}

/* SMTP template settings */
.smtp-settings-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(100%, 1480px);
    min-height: calc(100vh - var(--app-header-height));
    min-height: calc(100dvh - var(--app-header-height));
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem);
    box-sizing: border-box;
}

.smtp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.25rem;
}

.smtp-page-heading {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.smtp-page-icon,
.smtp-detail-icon-badge {
    display: flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--app-surface-100);
    color: var(--rz-primary);
    font-size: 1.4rem;
}

.smtp-page-title.rz-text,
.smtp-section-title.rz-text,
.smtp-template-title.rz-text {
    margin: 0;
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-weight: 700;
}

.smtp-page-subtitle.rz-text,
.smtp-template-subtitle.rz-text {
    display: block;
    margin-top: 0.25rem;
    color: var(--rz-text-secondary-color);
}

.smtp-master-detail-grid {
    display: grid;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    align-items: stretch;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.smtp-settings-container .smtp-sidebar-card,
.smtp-settings-container .smtp-content-card,
.smtp-settings-container .smtp-empty-card {
    min-width: 0;
    background: var(--rz-panel-background-color, var(--app-surface-0)) !important;
    border: 1px solid var(--app-border-color) !important;
    border-radius: var(--app-card-radius) !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05) !important;
}

.smtp-settings-container .smtp-sidebar-card {
    display: flex;
    flex-direction: column;
    min-height: 540px;
    padding: 1.125rem !important;
}

.smtp-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.875rem;
    margin-bottom: 0.875rem;
    border-bottom: 1px solid var(--app-border-color);
}

.smtp-sidebar-icon {
    color: var(--rz-primary);
    font-size: 1.4rem;
}

.smtp-template-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.375rem;
    min-height: 0;
    overflow-y: auto;
    padding-right: 2px;
}

.smtp-template-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--app-card-radius);
    background: transparent;
    color: var(--rz-text-color);
    text-align: left;
    cursor: pointer;
    transition: var(--app-transition-fast);
}

.smtp-template-item:hover {
    background: var(--app-surface-100);
}

.smtp-template-item.active {
    border-color: color-mix(in srgb, var(--rz-primary) 60%, var(--app-border-color));
    background: color-mix(in srgb, var(--rz-primary) 12%, transparent);
}

.smtp-template-item:focus-visible,
.smtp-placeholder-chip:focus-visible {
    outline: 2px solid var(--rz-primary);
    outline-offset: 2px;
}

.smtp-template-item-icon {
    display: flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: var(--app-surface-100);
    color: var(--rz-primary);
}

.smtp-template-item.active .smtp-template-item-icon {
    background: var(--rz-primary);
    color: #fff;
}

.smtp-template-item-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.smtp-template-item-name,
.smtp-template-item-event {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smtp-template-item-name {
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-size: 0.875rem;
    font-weight: 600;
}

.smtp-template-item-event {
    margin-top: 0.125rem;
    color: var(--rz-text-secondary-color);
    font-size: 0.7rem;
}

.smtp-template-active-chevron {
    color: var(--rz-primary);
}

.smtp-settings-container .smtp-content-card {
    display: flex;
    flex-direction: column;
    min-height: 540px;
    padding: 1.25rem !important;
}

.smtp-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-border-color);
}

.smtp-detail-header > .rz-display-flex:first-child {
    min-width: 0;
}

.smtp-tabs {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    border: 0 !important;
}

.smtp-content-card .rz-tabview-panels,
.smtp-content-card .rz-tabview-panel {
    min-height: 0;
}

.smtp-tab-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 0;
    padding-top: 0.75rem;
}

.smtp-placeholders-section {
    padding: 0.875rem;
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    background: var(--app-surface-50);
}

.smtp-placeholders-title.rz-text {
    margin: 0;
    color: var(--rz-text-title-color, var(--rz-text-color));
    font-weight: 700;
}

.smtp-placeholder-select {
    min-width: 180px;
}

.smtp-placeholder-dropdown {
    width: 100%;
    font-size: 0.8125rem;
}

.smtp-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.smtp-placeholder-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.625rem;
    border: 1px solid var(--app-border-color);
    border-radius: 6px;
    background: var(--rz-panel-background-color, var(--app-surface-0));
    color: var(--rz-primary);
    font-family: monospace;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--app-transition-fast);
}

.smtp-placeholder-chip:hover {
    border-color: var(--rz-primary);
    background: var(--app-surface-100);
}

.smtp-placeholder-add {
    font-size: 0.875rem;
}

.smtp-textarea-container {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 280px;
}

.smtp-textarea {
    width: 100% !important;
    min-height: 280px !important;
    flex: 1 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
}

.smtp-preview-wrapper {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--app-border-color);
    border-radius: var(--app-card-radius);
    background: var(--rz-panel-background-color, var(--app-surface-0));
}

.smtp-preview-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--app-border-color);
    background: var(--app-surface-50);
}

.smtp-preview-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.8125rem;
}

.smtp-preview-meta-label {
    flex: 0 0 58px;
    color: var(--rz-text-secondary-color);
    font-weight: 600;
}

.smtp-preview-meta-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--rz-text-color);
}

.smtp-preview-body {
    min-height: 200px;
    max-height: min(48vh, 480px);
    overflow-y: auto;
    padding: 1.25rem;
    color: var(--rz-text-color);
    font-size: 0.9375rem;
    line-height: 1.65;
    white-space: pre-wrap;
}

.smtp-preview-legend {
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    background: var(--app-surface-50);
}

.smtp-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 2.5rem !important;
    text-align: center;
}

.smtp-empty-icon {
    color: var(--rz-text-secondary-color);
    font-size: 2.75rem;
}

.smtp-empty-title.rz-text {
    margin: 1rem 0 0;
    font-weight: 700;
}

.smtp-empty-description.rz-text {
    max-width: 480px;
    margin: 0.5rem 0 0;
    color: var(--rz-text-secondary-color);
}

.smtp-loading-state {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

@media (max-width: 950px) {
    .smtp-master-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .smtp-settings-container .smtp-sidebar-card {
        min-height: 0;
    }

    .smtp-template-list {
        max-height: 260px;
    }

    .smtp-settings-container .smtp-content-card {
        min-height: 540px;
    }
}

@media (max-width: 600px) {
    .smtp-settings-container {
        padding: 0.75rem;
    }

    .smtp-page-header {
        align-items: flex-start;
    }

    .smtp-page-heading {
        align-items: flex-start;
    }

    .smtp-page-icon {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .smtp-settings-container .smtp-sidebar-card,
    .smtp-settings-container .smtp-content-card {
        padding: 1rem !important;
    }

    .smtp-detail-header {
        align-items: flex-start;
    }

    .smtp-detail-header > .rz-display-flex:last-child,
    .smtp-detail-header > .rz-display-flex:last-child .rz-button {
        width: 100%;
    }

    .smtp-detail-header > .rz-display-flex:last-child .rz-button {
        justify-content: center;
    }

    .smtp-detail-header .rz-badge {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .smtp-placeholders-section > .rz-display-flex {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.5rem;
    }

    .smtp-placeholder-select {
        width: 100%;
        min-width: 0;
    }

    .smtp-preview-meta-row {
        flex-direction: column;
        gap: 0.125rem;
    }
}

/* KI-Assistent (ChatClient) */
.chat-client-prompt {
    flex: 0 0 auto;
    min-height: 0;
}

.chat-client-small-textarea {
    min-height: 90px !important;
    flex: 0 0 auto !important;
}

.chat-client-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chat-client-file {
    position: relative;
    font-family: inherit;
}

.chat-client-file input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.chat-client-entity {
    cursor: default;
}

.chat-client-muted,
.chat-client-muted.rz-text {
    margin: 0;
    color: var(--rz-text-secondary-color);
    font-weight: 400;
}

.chat-client-info-icon {
    font-size: 0.875rem;
    vertical-align: middle;
    margin-right: 4px;
}
