/* =========================================================================
   ITMM CRM — warstwa brandingu nakładana na theme Triton
   ========================================================================= */

/* Ikony FontAwesome wstawiane jako <i class="x-fa ...">: element <i> jest domyślnie
   pochyły, a ExtJS prostuje tylko swoje ikony przyciskowe — więc glify w naszym
   custom-HTML (KPI, odznaki, nagłówki, wyniki wyszukiwarki) wychodziły skośne. */
.x-fa { font-style: normal !important; }

.est-content { background: #eef1f5; }

/* ----------------------------- HEADER ----------------------------------- */
.est-header {
    background: linear-gradient(90deg, #1f2a44 0%, #2a3a5e 100%);
    padding: 0 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.est-brand { color: #fff; display: flex; align-items: center; white-space: nowrap; }
.est-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px;
    background: #2f6fb3; color: #fff; font-weight: 700; font-size: 15px;
    letter-spacing: .5px; margin-right: 10px;
}
.est-brand-text { font-size: 17px; font-weight: 600; }
.est-brand-tag {
    font-size: 11px; color: #9fb3d6; margin-left: 10px; padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, .18);
    text-transform: uppercase; letter-spacing: 1px;
}
.est-section-title { color: #cfe0f5; font-size: 13px; text-align: center; }
.est-user { color: #fff; font-size: 13px; display: flex; align-items: center; }
.est-user .x-fa { font-size: 22px; margin-right: 8px; color: #9fb3d6; }
.est-user-name { font-weight: 600; }
.est-user-role {
    font-size: 11px; color: #cfe0f5; margin-left: 8px;
    background: rgba(255, 255, 255, .1); padding: 2px 8px; border-radius: 10px;
}

/* ------------------------------- NAV ------------------------------------ */
.est-nav { background: #243044; }
.est-nav-label { color: #6f819e; font-size: 11px; letter-spacing: 1.5px; padding: 18px 18px 6px; }
.est-nav-btn, .est-nav-btn.x-btn-default-large {
    background: transparent !important; background-image: none !important;
    border: 0 !important; border-radius: 0 !important; margin: 0 !important;
}
.est-nav-btn .x-btn-button { padding: 13px 18px !important; }
.est-nav-btn .x-btn-inner { color: #c4cfe0 !important; font-size: 14px !important; font-weight: 500; }
.est-nav-btn .x-btn-icon-el { color: #7e93b5 !important; font-size: 16px !important; width: 24px; }
.est-nav-btn:hover { background: rgba(255, 255, 255, .05) !important; }
.est-nav-btn.x-btn-pressed {
    background: rgba(47, 111, 179, .2) !important;
    box-shadow: inset 3px 0 0 #4f93dd;
}
.est-nav-btn.x-btn-pressed .x-btn-inner { color: #fff !important; }
.est-nav-btn.x-btn-pressed .x-btn-icon-el { color: #4f93dd !important; }
.est-nav-foot { color: #5d6f8d; font-size: 11px; padding: 14px 18px; }
.est-nav-foot .est-stack { font-weight: 600; color: #8aa0c2; }
.est-nav-foot .est-stack-sub { margin-top: 2px; }

/* --------------------------- DASHBOARD ---------------------------------- */
.est-dash, .est-dash-body { background: #eef1f5; }
.est-dash-body { padding: 16px; }
.est-kpi-row { margin-bottom: 16px; }
.est-kpi-card {
    height: 100%; background: #fff; border-radius: 10px; margin: 0 8px;
    box-shadow: 0 1px 4px rgba(20, 40, 80, .1);
    display: flex; align-items: center; padding: 0 18px;
    border-left: 4px solid #2f6fb3;
}
.est-kpi:first-child .est-kpi-card { margin-left: 0; }
.est-kpi:last-child .est-kpi-card { margin-right: 0; }
.est-kpi-ic {
    width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff; margin-right: 16px; background: #2f6fb3;
}
.est-kpi-main { overflow: hidden; }
.est-kpi-val { font-size: 23px; font-weight: 700; color: #1f2a44; line-height: 1.1; white-space: nowrap; }
.est-kpi-lab { font-size: 12px; color: #5b6b85; margin-top: 3px; }
.est-kpi-sub { font-size: 11px; color: #9aa7bd; margin-top: 4px; }
.est-kpi-blue { border-left-color: #2f6fb3; } .est-kpi-blue .est-kpi-ic { background: #2f6fb3; }
.est-kpi-green { border-left-color: #43a047; } .est-kpi-green .est-kpi-ic { background: #43a047; }
.est-kpi-amber { border-left-color: #fb8c00; } .est-kpi-amber .est-kpi-ic { background: #fb8c00; }
.est-kpi-purple { border-left-color: #8e24aa; } .est-kpi-purple .est-kpi-ic { background: #8e24aa; }

/* karty wykresów */
.est-card.x-panel { border: 0; border-radius: 10px; box-shadow: 0 1px 4px rgba(20, 40, 80, .1); overflow: hidden; }
.est-card > .x-panel-header, .est-card .x-header { background: #fff !important; border-bottom: 1px solid #eef1f5; }
.est-card .x-title-text { color: #1f2a44 !important; font-weight: 600; font-size: 14px; }
.est-card .x-panel-header .x-fa, .est-card .x-title-glyph { color: #2f6fb3 !important; }
.est-card .x-panel-body { background: #fff; }

/* ------------------------------- GRID ----------------------------------- */
.est-grid { background: #fff; }
.est-grid .x-toolbar { background: #fff; border-color: #e6eaf0; padding: 8px; }
.est-toolbar-title { font-size: 15px; font-weight: 600; color: #1f2a44; padding-left: 4px; }
.est-toolbar-title .x-fa { color: #2f6fb3; margin-right: 6px; }
.est-ref { font-family: Consolas, 'Courier New', monospace; font-size: 14px; color: #2f6fb3; font-weight: 600; }
.est-ref-link { cursor: pointer; }
.est-ref-link:hover { text-decoration: underline; }
.est-type-ic { color: #7e93b5; margin-right: 5px; }
.est-dim { color: #b8c0cc; }
.est-sub { color: #8a96a8; font-size: 11px; }
.est-badge { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 11px; font-weight: 600; line-height: 1.6; }
.est-badge-ok { background: #e3f5e8; color: #2e7d32; }
.est-badge-warn { background: #fff3e0; color: #e07b00; }
.est-badge-muted { background: #eceff2; color: #78858f; }
.est-badge-info { background: #e6f1fb; color: #1f6fb3; }
.est-count { color: #5b6b85; font-size: 12px; padding-left: 6px; }
.est-foot-note { color: #9aa7bd; font-size: 11px; padding-right: 6px; }
.est-empty { padding: 40px; text-align: center; color: #9aa7bd; font-size: 14px; }
/* Kolumna akcji: czytelne, wycentrowane ikony z PRECYZYJNYM, kolistym hoverem.
   Domyślne Tritona dawały glif wystający poza mały box klikalny (18×18 + padding),
   stąd „przesunięty duch" i nietrafne kliknięcia. */
.est-grid .x-grid-cell-inner-action-col { padding-top: 2px !important; padding-bottom: 2px !important; text-align: center; }
.est-grid .x-action-col-icon {
    box-sizing: border-box !important;
    width: 28px !important; height: 28px !important; line-height: 28px !important;
    margin: 0 3px !important; padding: 0 !important;
    font-size: 16px !important; text-align: center; vertical-align: middle;
    border-radius: 50%; opacity: 1 !important; outline: none !important;
    transition: background-color .12s ease;
}
.est-grid .x-action-col-icon:hover, .est-grid .x-action-col-icon:focus { background-color: rgba(31, 42, 68, .08); }
.est-ic-edit { color: #2f6fb3 !important; }
.est-ic-edit:hover, .est-ic-edit:focus { background-color: rgba(47, 111, 179, .15) !important; }
.est-ic-del { color: #e53935 !important; }
.est-ic-del:hover, .est-ic-del:focus { background-color: rgba(229, 57, 53, .13) !important; }

/* ---------------------- przycisk akcentowy ------------------------------ */
.est-btn-primary { background: #2f6fb3 !important; background-image: none !important; border-color: #27598f !important; }
.est-btn-primary .x-btn-inner, .est-btn-primary .x-btn-icon-el { color: #fff !important; }
.est-btn-primary:hover { background: #27598f !important; }

/* ------------------------------ EDYTOR ---------------------------------- */
.est-editor-banner {
    background: #eef4fb; border: 1px solid #d6e4f5; border-radius: 6px;
    padding: 8px 12px; margin-bottom: 14px; color: #2f6fb3; font-size: 12px;
}
.est-editor-banner .x-fa { margin-right: 4px; }

/* drobne porządki fokus-celki gridu (z oryginału) */
.x-grid-item-focused .x-grid-cell-inner:before { display: none; }

/* ======================= MIKRO-INTERAKCJE / ANIMACJE ==================== */
@keyframes estFadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* wejście aktywnej karty przy przełączaniu widoku */
.est-anim-in { animation: estFadeUp .3s cubic-bezier(.21, .6, .35, 1) both; }

/* KPI: wejście (lekki stagger) + hover-lift */
.est-kpi-card { animation: estFadeUp .42s cubic-bezier(.21, .6, .35, 1) both; transition: transform .18s ease, box-shadow .18s ease; }
.est-kpi:nth-child(2) .est-kpi-card { animation-delay: .06s; }
.est-kpi:nth-child(3) .est-kpi-card { animation-delay: .12s; }
.est-kpi:nth-child(4) .est-kpi-card { animation-delay: .18s; }
.est-kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(20, 40, 80, .16); }
.est-kpi-ic { transition: transform .18s ease; }
.est-kpi-card:hover .est-kpi-ic { transform: scale(1.06); }

/* karty wykresów: hover-lift */
.est-card.x-panel { transition: box-shadow .2s ease, transform .2s ease; }
.est-card.x-panel:hover { box-shadow: 0 8px 24px rgba(20, 40, 80, .14); transform: translateY(-2px); }

/* odznaka statusu: kropka wiodąca */
.est-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }

/* ikony akcji: kółko pod kursorem */
.est-grid .x-action-col-icon { border-radius: 50%; padding: 5px; transition: background .15s ease; }
.est-ic-edit:hover { background: rgba(47, 111, 179, .14); }
.est-ic-del:hover { background: rgba(229, 57, 53, .14); }

/* nawigacja + przycisk akcentowy: płynniej */
.est-nav-btn { transition: background .16s ease, box-shadow .16s ease !important; }
.est-btn-primary { transition: background .15s ease, box-shadow .15s ease, transform .12s ease; }
.est-btn-primary:hover { box-shadow: 0 4px 12px rgba(47, 111, 179, .32); }
.est-btn-primary:active { transform: translateY(1px); }

/* =============================== LOGOWANIE ============================== */
.est-login-bg { background: linear-gradient(135deg, #1f2a44 0%, #2a3a5e 55%, #34507e 100%); }
.est-login-card { background: #fff; border-radius: 14px; padding: 32px 30px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.est-login-brand { text-align: center; margin-bottom: 2px; }
.est-login-mark {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 10px; background: #2f6fb3; color: #fff; font-weight: 700; font-size: 17px;
    letter-spacing: .5px; vertical-align: middle; margin-right: 10px;
}
.est-login-name { font-size: 24px; font-weight: 600; color: #1f2a44; vertical-align: middle; }
.est-login-sub { text-align: center; color: #8a96a8; font-size: 11px; text-transform: uppercase; letter-spacing: 2px; margin: 6px 0 22px; }
.est-login-error { background: #fdecea; border: 1px solid #f5c2bd; color: #c0392b; border-radius: 6px; padding: 8px 10px; font-size: 12px; margin-top: 4px; }
.est-login-error .x-fa { margin-right: 5px; }
.est-login-btn { margin-top: 16px; }
.est-login-hint { text-align: center; color: #9aa7bd; font-size: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef1f5; }

/* header: przycisk użytkownika */
.est-user-btn, .est-user-btn.x-btn-default-small { background: transparent !important; background-image: none !important; border: 0 !important; }
.est-user-btn .x-btn-inner { color: #fff !important; font-weight: 500; }
.est-user-btn .x-btn-icon-el { color: #9fb3d6 !important; }
.est-user-btn:hover { background: rgba(255, 255, 255, .08) !important; }

/* ============================ MASTER-DETAIL ============================= */
.est-detail-body { background: #eef1f5; padding: 16px; }
.est-detail-inner { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(20, 40, 80, .1); padding: 24px 28px; }
.est-detail-head { display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #eef1f5; padding-bottom: 16px; margin-bottom: 18px; }
.est-detail-ref { font-family: Consolas, 'Courier New', monospace; font-size: 22px; font-weight: 700; color: #2f6fb3; }
.est-detail-addr { color: #5b6b85; font-size: 14px; margin-top: 6px; }
.est-detail-head-r { text-align: right; white-space: nowrap; }
.est-detail-price { font-size: 26px; font-weight: 700; color: #1f2a44; margin-top: 8px; }
.est-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.est-detail-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f2f4f7; }
.est-detail-k { color: #8a96a8; font-size: 13px; }
.est-detail-v { color: #1f2a44; font-size: 14px; font-weight: 500; text-align: right; }
.est-detail-desc { margin-top: 20px; }
.est-detail-desc-txt { color: #3a4658; font-size: 14px; line-height: 1.6; margin-top: 6px; white-space: pre-wrap; }

/* ======================= GLOBALNA WYSZUKIWARKA ========================= */
.est-gsearch { margin: 0 10px; }
.est-gsearch .x-form-trigger-wrap {
    background-color: rgba(255, 255, 255, .12) !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: 8px !important;
}
.est-gsearch .x-form-trigger-wrap-focus {
    border-color: #7fb0e6 !important;
    background-color: rgba(255, 255, 255, .18) !important;
}
.est-gsearch .x-form-text { background: transparent !important; color: #fff !important; }
.est-gsearch .x-form-empty-field { color: #c2d2ec !important; font-style: normal; }
.est-gsearch-trigger { width: 22px !important; }
.est-gsearch-trigger:before { font-family: 'FontAwesome' !important; content: '\f002' !important; color: #cfe0f5; font-size: 13px; }

.est-gs-panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 14px 34px rgba(20, 40, 80, .20); overflow: hidden; }
.est-gs-panel .x-panel-body { border: 0; border-radius: 10px; }
.est-gs-item { display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #f1f4f8; }
.est-gs-item:last-child { border-bottom: 0; }
.est-gs-item:hover { background: #f4f8fd; }
.est-gs-badge { flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 11px; white-space: nowrap; }
.est-gs-badge .x-fa { margin-right: 5px; }
.est-gs-estates { background: #e6f1fb; color: #1f6fb3; }
.est-gs-clients { background: #eaf6ec; color: #2e7d32; }
.est-gs-deals { background: #f3ecfb; color: #7a3fb3; }
.est-gs-text { display: flex; flex-direction: column; min-width: 0; }
.est-gs-primary { color: #1f2a44; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-gs-secondary { color: #8a96a8; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-gs-empty { padding: 22px; text-align: center; color: #9aa7bd; font-size: 13px; }

/* ===================== RBAC: rola Agent (bez usuwania) ===================== */
.est-role-agent .est-ic-del { display: none !important; }   /* ikona kosza w kolumnie akcji */
.est-role-agent .est-act-del { display: none !important; }  /* przycisk „Usuń" w widoku szczegółów */

/* ============================== USTAWIENIA ============================== */

.est-settings { background: #eef1f5; }
.est-settings-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(20, 40, 80, .08); }
.est-settings-card .x-panel-header { background: #fff; border-bottom: 1px solid #eef1f5; padding: 14px 18px; }
.est-settings-card .x-panel-header-title-default { color: #1f2a44; font-weight: 600; font-size: 15px; }
.est-settings-about { color: #5b6b85; font-size: 13px; line-height: 1.8; }
.est-settings-note { color: #8a96a8; font-size: 12px; margin-top: 14px; }

/* ===================== PRZEDSTAWICIELE W TERENIE (mapa) ===================== */
.est-reps-map { width: 100%; height: 100%; background: #dfe6ee; }
.est-reps-legend { color: #cfe0f5; font-size: 11px; }
.est-leg { margin-left: 12px; white-space: nowrap; }
.est-leg-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* markery (divIcon) */
.est-rep-divicon { background: transparent; border: 0; }
.est-rep-pin { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 15px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(20, 40, 80, .4); }
.est-rep-pin.stale { opacity: .5; }
.est-rep-pin.sel { box-shadow: 0 0 0 3px rgba(47, 111, 179, .55), 0 2px 6px rgba(20, 40, 80, .4); }

/* panel boczny */
.est-reps-side { background: #fff; border-left: 1px solid #e2e8f0; }
.est-reps-side-h { color: #6f819e; font-size: 11px; letter-spacing: 1.2px; padding: 14px 16px 8px; font-weight: 600; }
.est-reps-list { background: #fff; }
.est-rep-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #f1f4f8; cursor: pointer; }
.est-rep-row:hover { background: #f4f8fd; }
.est-rep-row-sel, .est-rep-row-sel:hover { background: #e9f2fb; box-shadow: inset 3px 0 0 #2f6fb3; }
.est-rep-bullet { flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%; }
.est-rep-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.est-rep-name { color: #1f2a44; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-rep-sim { font-size: 10px; color: #8a96a8; background: #eef1f5; border-radius: 8px; padding: 0 5px; font-weight: 600; }
.est-rep-meta { color: #8a96a8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.est-rep-unread { flex: 0 0 auto; background: #e53935; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
    border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
.est-reps-empty { padding: 22px; text-align: center; color: #9aa7bd; font-size: 13px; }

/* detal wybranego + czat */
.est-reps-detail { border-top: 1px solid #e2e8f0; background: #fafbfc; }
.est-reps-detail-h { padding: 12px 16px; border-bottom: 1px solid #eef1f5; background: #fff; }
.est-reps-dh-name { color: #1f2a44; font-size: 15px; font-weight: 700; }
.est-reps-dh-status { color: #5b6b85; font-size: 12.5px; margin-top: 4px; }
.est-reps-dh-status .est-rep-bullet { display: inline-block; vertical-align: middle; margin-right: 6px; }
.est-reps-dh-seen { color: #8a96a8; }
.est-reps-dh-note { color: #3a4658; font-size: 12.5px; margin-top: 6px; }
.est-reps-chat { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.est-cmsg { max-width: 82%; padding: 7px 10px; border-radius: 11px; font-size: 13px; line-height: 1.35; position: relative; }
.est-cmsg.central { align-self: flex-end; background: #2f6fb3; color: #fff; border-bottom-right-radius: 3px; }
.est-cmsg.rep { align-self: flex-start; background: #eef1f5; color: #1f2a44; border-bottom-left-radius: 3px; }
.est-cmsg-t { display: block; font-size: 9.5px; opacity: .7; margin-top: 2px; text-align: right; }
.est-reps-chatbar { padding: 10px 12px; border-top: 1px solid #eef1f5; background: #fff; gap: 8px; }
.est-reps-chatbar .x-field { margin-right: 8px; }

/* zaproszenie (QR) */
.est-invite { text-align: center; }
.est-invite-qr { margin-bottom: 14px; }
.est-invite-qr img { width: 196px; height: 196px; image-rendering: pixelated; border: 1px solid #eef1f5; border-radius: 8px; }
.est-invite-hint { color: #5b6b85; font-size: 13px; }
.est-invite-url { color: #2f6fb3; font-size: 12px; font-family: Consolas, monospace; word-break: break-all; margin: 6px 0 12px; }
.est-invite-note { color: #8a96a8; font-size: 12px; line-height: 1.6; }
