/**
 * Insurebloom CRM – Βασικά στυλ site
 * Εφαρμόζονται σε όλες τις σελίδες
 */

/* Βασικό padding για το body (ύψος navbar ib-navbar) */
body {
    padding-top: 56px;
    padding-bottom: 20px;
}

/* Padding στο περιεχόμενο για να μην ακουμπούν τα άκρα */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

/* Πεδία φόρμας: max-width για καλύτερη αναγνωσιμότητα (το responsive.css τα κάνει 100% σε κινητό) */
input,
select,
textarea {
    max-width: 280px;
}

/* Στυλ για validation errors */
.field-validation-error {
    color: #b94a48;
}

.field-validation-valid {
    display: none;
}

input.input-validation-error {
    border: 1px solid #b94a48;
}

input[type="checkbox"].input-validation-error {
    border: 0 none;
}

.validation-summary-errors {
    color: #b94a48;
}

.validation-summary-valid {
    display: none;
}

/* Λευκή navbar + logo InsureBloom */
.navbar.ib-navbar {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    min-height: 56px;
}

.navbar.ib-navbar .navbar-brand.ib-navbar-brand {
    padding: 2px 14px;
    height: 56px;
    min-width: 170px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.navbar.ib-navbar .ib-navbar-logo {
    /* Το source logo έχει αρκετό κενό, οπότε κάνουμε οπτικό zoom μέσα στο brand box. */
    height: 52px;
    width: auto;
    max-height: 52px;
    max-width: min(360px, 62vw);
    display: block;
    object-fit: contain;
    transform: scale(2.1);
    transform-origin: left center;
    margin-left: 4px;
}

.navbar.ib-navbar .ib-sidebar-toggle {
    float: left;
    width: 38px;
    height: 38px;
    margin: 9px 8px 9px 10px;
    border: 1px solid #d7ccc8;
    border-radius: 8px;
    background: #fff;
    color: #5d4037;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.navbar.ib-navbar .ib-sidebar-toggle:hover,
.navbar.ib-navbar .ib-sidebar-toggle:focus,
.navbar.ib-navbar .ib-sidebar-toggle.is-open {
    background: #f1f8e9;
    border-color: #9db487;
    outline: none;
}

.navbar.ib-navbar .ib-sidebar-toggle-bars {
    position: relative;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.navbar.ib-navbar .ib-sidebar-toggle-bars::before,
.navbar.ib-navbar .ib-sidebar-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}

.navbar.ib-navbar .ib-sidebar-toggle-bars::before { top: -5px; }
.navbar.ib-navbar .ib-sidebar-toggle-bars::after { top: 5px; }

@media (max-width: 768px) {
    .navbar.ib-navbar .navbar-brand.ib-navbar-brand {
        min-width: 130px;
        padding: 3px 10px;
    }
    .navbar.ib-navbar .ib-navbar-logo {
        height: 48px;
        max-height: 48px;
        max-width: min(240px, 55vw);
        transform: scale(1.7);
        margin-left: 2px;
    }
}

.navbar.ib-navbar .navbar-nav > li > a {
    color: #2d5016;
    font-weight: 600;
    padding-top: 18px;
    padding-bottom: 18px;
}

.navbar.ib-navbar .navbar-nav > li > a:hover,
.navbar.ib-navbar .navbar-nav > li > a:focus {
    color: #1a3009;
    background-color: #f4faf2;
}

.navbar.ib-navbar .navbar-toggle {
    border-color: #c5d4c0;
}

.navbar.ib-navbar .navbar-toggle .icon-bar {
    background-color: #2d5016;
}

.navbar.ib-navbar .navbar-toggle:hover,
.navbar.ib-navbar .navbar-toggle:focus {
    background-color: #f4faf2;
}

.navbar.ib-navbar .ib-navbar-greet {
    display: block;
    padding: 18px 15px;
    line-height: 20px;
    color: #5a5a5a;
    font-weight: 500;
}

/* Main modules inside top navbar */
.navbar.ib-navbar #main-navbar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.navbar.ib-navbar .ib-navbar-modules {
    display: flex;
    align-items: stretch;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.navbar.ib-navbar .ib-navbar-modules > li {
    flex: 1 1 0;
}

.navbar.ib-navbar .ib-navbar-modules > li > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 56px;
    padding: 6px 8px;
    text-align: center;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    color: #5d4037 !important;
    font-weight: 700;
}

.navbar.ib-navbar .ib-navbar-modules > li:last-child > a {
    border-right: none;
}

.navbar.ib-navbar .ib-navbar-modules > li > a .ib-nav-emoji {
    font-size: 1.12em;
    line-height: 1;
}

.navbar.ib-navbar .ib-navbar-modules > li > a.active {
    background: #fff !important;
    color: #556b2f !important;
    border-top: 4px solid #d4ac0d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 8px 8px 0 0;
}

.navbar.ib-navbar .ib-navbar-user-actions {
    margin-left: auto;
}

.navbar.ib-navbar .ib-navbar-user-actions .navbar-nav {
    display: flex;
    align-items: center;
}

.navbar.ib-navbar .ib-navbar-user-actions .ib-nav-tool > a {
    position: relative;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

.navbar.ib-navbar .ib-navbar-user-actions .ib-tool-icon {
    font-size: 1.22em;
    line-height: 1;
}

.navbar.ib-navbar .ib-notif-wrap {
    position: relative;
}

.navbar.ib-navbar .ib-notif-badge {
    position: absolute;
    top: 9px;
    right: 7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d32f2f;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.navbar.ib-navbar .ib-notif-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(360px, 92vw);
    max-height: 420px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    display: none;
    z-index: 3000;
}

.navbar.ib-navbar .ib-notif-panel.show {
    display: block;
}

.navbar.ib-navbar .ib-notif-head {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    color: #3e2723;
    background: #fafafa;
}

.navbar.ib-navbar .ib-notif-list {
    max-height: 360px;
    overflow: auto;
}

.navbar.ib-navbar .ib-notif-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f1f1;
    color: #3e2723 !important;
    text-decoration: none !important;
}

.navbar.ib-navbar .ib-notif-item:last-child {
    border-bottom: none;
}

.navbar.ib-navbar .ib-notif-item:hover {
    background: #f5faef;
}

.navbar.ib-navbar .ib-notif-title {
    font-size: 0.92em;
    font-weight: 700;
    margin-bottom: 3px;
}

.navbar.ib-navbar .ib-notif-meta {
    font-size: 0.8em;
    color: #8d6e63;
}

.navbar.ib-navbar .ib-notif-empty {
    padding: 12px;
    color: #888;
    font-size: 0.9em;
}

.navbar.ib-navbar .ib-profile-wrap {
    position: relative;
}

.navbar.ib-navbar .ib-profile-trigger {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px !important;
}

.navbar.ib-navbar .ib-profile-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid #d6e3c9;
    background: linear-gradient(135deg, #5f7d39 0%, #7ca255 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.96em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-transform: uppercase;
}

.navbar.ib-navbar .ib-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar.ib-navbar .ib-profile-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: min(220px, 90vw);
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    display: none;
    z-index: 3000;
    overflow: hidden;
}

.navbar.ib-navbar .ib-profile-panel.show {
    display: block;
}

.navbar.ib-navbar .ib-profile-head {
    padding: 10px 12px;
    border-bottom: 1px solid #efefef;
    font-weight: 700;
    color: #3e2723;
    background: #fafafa;
}

.navbar.ib-navbar .ib-profile-link,
.navbar.ib-navbar .ib-profile-logout {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #f3f3f3;
    background: #fff;
    color: #3e2723 !important;
    text-decoration: none !important;
    font-weight: 600;
}

.navbar.ib-navbar .ib-profile-logout {
    border-bottom: none;
    cursor: pointer;
}

.navbar.ib-navbar .ib-profile-link:hover,
.navbar.ib-navbar .ib-profile-logout:hover {
    background: #f5faef;
}

/* Old in-page module toolbar is deprecated (now in top navbar) */
.top-toolbar {
    display: none !important;
}

@media (max-width: 991px) {
    .navbar.ib-navbar #main-navbar {
        display: block !important;
    }
    .navbar.ib-navbar .ib-navbar-modules {
        display: block;
    }
    .navbar.ib-navbar .ib-navbar-modules > li > a {
        min-height: auto;
        align-items: flex-start;
        flex-direction: row;
        gap: 8px;
        border-right: none;
        border-bottom: 1px solid #efefef;
    }
    .navbar.ib-navbar .ib-navbar-modules > li > a.active {
        border-top: none;
        border-left: 4px solid #d4ac0d;
        border-radius: 0;
    }
}

/* Sidebar: άνοιγμα μόνο με toggle button + καρφίτσωμα (JS: layout.html) */
:root {
    --ib-fixed-nav-height: 56px;
    --ib-sidebar-width: 280px;
    --ib-sidebar-rail: 16px;
}

.app-wrapper.ib-sidebar-dock {
    display: block;
    position: relative;
}

.app-wrapper.ib-sidebar-dock > .main-content {
    margin-left: var(--ib-sidebar-rail);
    width: auto !important;
    max-width: none;
    box-sizing: border-box;
    transition: margin-left 0.2s ease;
}

.app-wrapper.ib-sidebar-dock.ib-sidebar-pinned > .main-content {
    margin-left: var(--ib-sidebar-width);
}

.app-wrapper.ib-sidebar-dock.ib-sidebar-open > .main-content {
    margin-left: var(--ib-sidebar-width);
}

.ib-sidebar-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--ib-fixed-nav-height);
    left: 0;
    bottom: 0;
    width: var(--ib-sidebar-rail);
    z-index: 1020;
    box-sizing: border-box;
    overflow: hidden;
    background: #f2f1ef;
    border-right: 1px solid #d7ccc8;
    transition: width 0.22s ease, box-shadow 0.22s ease;
}

.app-wrapper.ib-sidebar-dock.ib-sidebar-open .ib-sidebar-panel,
.ib-sidebar-panel.ib-sidebar-pinned {
    width: var(--ib-sidebar-width);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
}

.app-wrapper.ib-sidebar-dock .ib-sidebar-panel .sidebar {
    width: var(--ib-sidebar-width) !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin: 0 !important;
    border-right: none !important;
    box-sizing: border-box;
}

.ib-sidebar-pin {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #d7ccc8;
    background: #e8e6e1;
    color: #3e2723;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    line-height: 1.2;
}

.ib-sidebar-pin:hover,
.ib-sidebar-pin:focus {
    background: #ddd9d0;
    outline: none;
}

.ib-sidebar-panel.ib-sidebar-pinned .ib-sidebar-pin {
    background: #dcedc8;
    color: #33691e;
}

/* Κλειστή ράγα: μόνο εικονίδιο καρφίτσας */
.app-wrapper.ib-sidebar-dock:not(.ib-sidebar-open):not(.ib-sidebar-pinned) .ib-sidebar-panel .ib-sidebar-pin .ib-pin-label {
    display: none;
}

.app-wrapper.ib-sidebar-dock:not(.ib-sidebar-open):not(.ib-sidebar-pinned) .ib-sidebar-panel .ib-sidebar-pin {
    padding: 12px 0;
    min-height: 72px;
}

@media (prefers-reduced-motion: reduce) {
    .ib-sidebar-panel,
    .app-wrapper.ib-sidebar-dock > .main-content {
        transition: none;
    }
}

/* Floating προσωπικός βοηθός (chat launcher + panel) */
.ib-assistant-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 999px;
    background: #000;
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
    z-index: 3200;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.ib-assistant-fab:hover { transform: translateY(-1px); }

.ib-assistant-fab-icon {
    font-size: 32px;
    line-height: 1;
    filter: grayscale(1) brightness(2.2);
}

.ib-assistant-panel {
    position: fixed;
    right: 18px;
    bottom: 98px;
    width: min(420px, calc(100vw - 24px));
    height: min(640px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    z-index: 3200;
    display: none;
}

.ib-assistant-panel.show { display: block; }

.ib-assistant-panel-head {
    height: 46px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111;
    color: #fff;
}

.ib-assistant-close {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.ib-assistant-iframe {
    width: 100%;
    height: calc(100% - 46px);
    border: 0;
    display: block;
    background: #fff;
}

@media (max-width: 640px) {
    .ib-assistant-fab { width: 64px; height: 64px; right: 12px; bottom: 12px; }
    .ib-assistant-panel {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 86px;
        height: min(72vh, 620px);
    }
}

/* ===== Global Search ===== */
.ib-global-search-wrap {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 10px;
}
.ib-global-search-input {
    width: 220px;
    padding: 6px 14px;
    border: 1px solid #d7ccc8;
    border-radius: 20px;
    font-size: 0.9em;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 220px;
}
.ib-global-search-input:focus {
    border-color: #556b2f;
    box-shadow: 0 0 0 3px rgba(85,107,47,0.15);
    background: #fff;
}
.ib-search-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
    z-index: 3100;
    overflow: hidden;
}
.ib-search-dropdown.show { display: block; }
.ib-search-item {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    text-decoration: none;
    color: #2f2a27;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}
.ib-search-item:last-child { border-bottom: none; }
.ib-search-item:hover { background: #f5f2ee; text-decoration: none; color: #2f2a27; }
.ib-search-name { font-weight: 700; font-size: 0.95em; }
.ib-search-meta { font-size: 0.82em; color: #888; margin-top: 2px; }
.ib-search-empty { padding: 12px 16px; color: #888; font-size: 0.9em; }

/* ===== Help Drawer ===== */
.ib-help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 3300;
}
.ib-help-overlay.show { display: block; }
.ib-help-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 95vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
    z-index: 3400;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}
.ib-help-drawer.show { right: 0; }
.ib-help-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: #556b2f;
    color: #fff;
    font-size: 1.05em;
    flex-shrink: 0;
}
.ib-help-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
}
.ib-help-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 22px;
}
.ib-help-qa {
    background: #fafaf8;
    border: 1px solid #e8e4e0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.ib-help-q {
    font-weight: 700;
    color: #3e2723;
    margin-bottom: 6px;
    font-size: 0.93em;
}
.ib-help-a {
    color: #5d4037;
    font-size: 0.9em;
    line-height: 1.55;
}
.ib-help-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}
.ib-help-footer a { color: #556b2f; font-weight: 600; font-size: 0.9em; }
@media (max-width: 480px) {
    .ib-global-search-input { width: 140px; }
    .ib-search-dropdown { min-width: 260px; }
    .ib-help-drawer { width: 100vw; }
}

