html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}


/* =========================
   BOOTSTRAP MODERN OVERRIDES
   ========================= */

:root {
    --app-bg: #f6f8fb;
    --app-surface: #ffffff;
    --app-surface-2: #f9fafb;
    --app-border: #e9eef5;
    --app-border-strong: #d8e0ea;
    --app-text: #1f2937;
    --app-text-soft: #6b7280;
    --app-primary: #0d6efd;
    --app-success: #22c55e;
    --app-shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
    --app-shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
    --app-shadow-lg: 0 18px 50px rgba(15, 23, 42, 0.12);
    --app-radius-sm: 10px;
    --app-radius-md: 16px;
    --app-radius-lg: 22px;
    --app-transition: all 0.2s ease;
}

body {
    background-color: var(--app-bg);
    color: var(--app-text);
}

/* Container visivamente pił arioso */
.container,
.container-fluid {
    position: relative;
}

/* =========================
   CARD
   ========================= */
.card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-sm);
    transition: var(--app-transition);
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: var(--app-shadow-md);
        border-color: var(--app-border-strong);
    }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--app-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: #fff;
    border-top: 1px solid var(--app-border);
    padding: 1rem 1.25rem;
}

/* Variante card moderna */
/*.card.card-modern {*/
.card {
    border: 0;
    box-shadow: var(--app-shadow-md);
    border-radius: var(--app-radius-lg);
}

/*.card.card-modern .card-header {*/
    .card .card-header {
        border-bottom: 0;
        padding-bottom: 0.5rem;
        background-color: #efeae2;
        text-transform: uppercase;
    }

/* =========================
   BUTTONS
   ========================= */
.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: var(--app-transition);
}

.btn-primary {
    box-shadow: 0 8px 18px rgba(13, 110, 253, 0.18);
}

    .btn-primary:hover {
        transform: translateY(-1px);
    }

.btn-light {
    background: #fff;
    border-color: var(--app-border);
    color: var(--app-text);
}

    .btn-light:hover {
        background: #f8fafc;
        border-color: var(--app-border-strong);
    }

/* =========================
   FORM CONTROLS
   ========================= */
.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--app-border-strong);
    padding: 0.75rem 0.95rem;
    box-shadow: none;
    transition: var(--app-transition);
}

    .form-control:focus,
    .form-select:focus {
        border-color: rgba(13, 110, 253, 0.45);
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.12);
    }

.input-group-text {
    border-radius: 12px;
    border-color: var(--app-border-strong);
    background: #fff;
}

/* =========================
   LIST GROUP
   ========================= */
.list-group {
    border-radius: var(--app-radius-md);
    overflow: hidden;
}

.list-group-item {
    border-color: var(--app-border);
    padding: 0.95rem 1rem;
}

/* =========================
   NAVBAR
   ========================= */
.navbar {
    background: rgba(255,255,255,0.9) !important;
    backdrop-filter: blur(10px);
    box-shadow: var(--app-shadow-sm);
    border-bottom: 1px solid rgba(233, 238, 245, 0.8);
}

/* =========================
   MODAL
   ========================= */
.modal-content {
    border: 0;
    border-radius: 20px;
    box-shadow: var(--app-shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border);
}

/* =========================
   TABLE
   ========================= */
.table {
    --bs-table-bg: transparent;
}

    .table > :not(caption) > * > * {
        padding: 1rem 0.9rem;
        border-bottom-color: var(--app-border);
    }

    .table thead th {
        color: var(--app-text-soft);
        font-weight: 600;
        border-bottom-width: 1px;
    }

/* =========================
   CHAT BOX STYLE
   ========================= */

.chat-card {
    /*max-width: 520px;*/
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.chat-header {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    border-bottom: 1px solid #e9eef5;
    padding: 1rem 1.25rem;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #4f9bff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-body {
    background: radial-gradient(circle at top left, rgba(13,110,253,0.04), transparent 30%), #efeae2;
    padding: 1rem;
    height: 420px;
    overflow-y: auto;
}

.chat-footer {
    background: #fff;
    border-top: 1px solid #e9eef5;
    padding: 0.9rem 1rem;
}

.chat-message {
    position: relative;
    max-width: 78%;
    padding: 0.75rem 0.9rem 1.3rem 0.9rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.45;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    word-wrap: break-word;
}

.chat-message-received {
    background: #ffffff;
    color: #1f2937;
    border-top-left-radius: 6px;
}

.chat-message-sent {
    background: #d9fdd3;
    color: #1f2937;
    border-top-right-radius: 6px;
}

/* Codina fumetto opzionale */
.chat-message-received::before {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.chat-message-sent::before {
    content: "";
    position: absolute;
    top: 0;
    right: -8px;
    width: 14px;
    height: 14px;
    background: #d9fdd3;
    clip-path: polygon(0 0, 0 100%, 100% 0);
}

.chat-time {
    position: absolute;
    right: 0.75rem;
    bottom: 0.10rem;
    font-size: 0.72rem;
    color: rgba(31, 41, 55, 0.55);
}

.chat-date-separator {
    text-align: center;
    margin: 0.5rem 0 1rem 0;
}

    .chat-date-separator span {
        display: inline-block;
        background: rgba(255,255,255,0.75);
        color: #6b7280;
        font-size: 0.78rem;
        padding: 0.35rem 0.7rem;
        border-radius: 999px;
        box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    }

.chat-footer .form-control {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

    .chat-footer .form-control:focus {
        background: #fff;
    }

.navbar {
    position: relative;
    z-index: 1050;
}

    .navbar .dropdown-menu {
        z-index: 1060;
    }

/* =========================
   TENANT PROFILE RICH EDITOR
   ========================= */

.smartest-rich-editor {
    border: 1px solid var(--app-border-strong);
    border-radius: var(--app-radius-md);
    overflow: hidden;
    background: #fff;
}

.smartest-rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--app-border);
    background: var(--app-surface-2);
}

.smartest-editor-group {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.smartest-editor-separator {
    width: 1px;
    height: 1.65rem;
    margin: 0 0.15rem;
    background: var(--app-border-strong);
}

.smartest-editor-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--app-text);
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

    .smartest-editor-button i {
        font-size: 1.15rem;
        line-height: 1;
    }

.smartest-editor-button-text {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: 700;
}

.smartest-editor-button-heading {
    width: 2.5rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.smartest-editor-button:focus-visible {
    outline: none;
}

@media (max-width: 575.98px) {
    .smartest-rich-editor-toolbar {
        gap: 0.35rem;
        padding: 0.55rem;
    }

    .smartest-editor-separator {
        display: none;
    }

    .smartest-editor-group {
        padding-right: 0.35rem;
        border-right: 1px solid var(--app-border);
    }

        .smartest-editor-group:last-child {
            padding-right: 0;
            border-right: 0;
        }
}

.smartest-rich-editor-area {
    min-height: 260px;
    max-height: 520px;
    overflow-y: auto;
    padding: 1rem;
    outline: none;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 127, 141, 0.45) transparent;
}

@media (max-width: 767.98px) {
    .smartest-rich-editor-area {
        min-height: 220px;
        max-height: 420px;
    }
}

    .smartest-rich-editor-area::-webkit-scrollbar {
        width: 0.65rem;
    }

    .smartest-rich-editor-area::-webkit-scrollbar-track {
        background: transparent;
    }

    .smartest-rich-editor-area::-webkit-scrollbar-thumb {
        border: 0.15rem solid transparent;
        border-radius: 999px;
        background: rgba(0, 127, 141, 0.38);
        background-clip: padding-box;
    }

        .smartest-rich-editor-area::-webkit-scrollbar-thumb:hover {
            background: rgba(0, 127, 141, 0.58);
            background-clip: padding-box;
        }

    .smartest-rich-editor-area:focus {
        box-shadow: inset 0 0 0 0.15rem rgba(13, 110, 253, 0.18);
    }

    .smartest-rich-editor-area h2,
    .smartest-rich-editor-area h3,
    .smartest-rich-editor-area h4 {
        margin-top: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .smartest-rich-editor-area p,
    .smartest-rich-editor-area ul,
    .smartest-rich-editor-area ol {
        margin-bottom: 1rem;
    }

/* =========================
   PUBLIC TENANT PROFILE CONTENT
   ========================= */

.smartest-tenant-profile-content {
    font-size: 1.15rem;
    line-height: 1.75;
}

    .smartest-tenant-profile-content h2 {
        margin-top: 2rem;
        margin-bottom: 0.9rem;
        font-size: 1.65rem;
        font-weight: 700;
    }

    .smartest-tenant-profile-content h3 {
        margin-top: 1.6rem;
        margin-bottom: 0.75rem;
        font-size: 1.35rem;
        font-weight: 700;
    }

    .smartest-tenant-profile-content h4 {
        margin-top: 1.4rem;
        margin-bottom: 0.6rem;
        font-size: 1.15rem;
        font-weight: 700;
    }

    .smartest-tenant-profile-content p {
        margin-bottom: 1rem;
    }

    .smartest-tenant-profile-content ul,
    .smartest-tenant-profile-content ol {
        margin-bottom: 1rem;
        padding-left: 1.5rem;
    }

    .smartest-tenant-profile-content li {
        margin-bottom: 0.35rem;
    }

    .smartest-tenant-profile-content a {
        font-weight: 600;
    }

