/* Broker panel (www.bamsara.com/broker/), 2026-10-15 - everything scoped to .bp */
.bp { font-size: 13px; line-height: 1.8; color: #333; padding: 0 0 30px 0; }
.bp a { color: #005881; }
.bp .bp-title { font-size: 17px; margin: 4px 0 14px; color: #005881; border-bottom: 1px solid #e3e8ee; padding-bottom: 8px; }
.bp h4, .bp .bp-sub { font-size: 14px; margin: 18px 0 8px; color: #444; }
.bp .bp-muted { color: #888; font-size: 12px; }
.bp .bp-err { color: #c0392b; }
.bp .bp-danger { color: #c0392b; }
.bp .bp-note { background: #f7f9fb; border: 1px solid #e3e8ee; border-radius: 4px; padding: 12px 14px; margin: 10px 0; }
.bp .bp-help { color: #666; font-size: 12px; margin: 8px 0 12px; }

.bp .bp-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.bp .bp-card { flex: 1 1 140px; min-width: 140px; display: block; text-decoration: none; color: #333;
    border: 1px solid #e3e8ee; border-radius: 6px; padding: 10px 12px; background: #fff; }
.bp a.bp-card:hover { border-color: #005881; }
.bp .bp-card-label { color: #777; font-size: 12px; }
.bp .bp-card-value { font-size: 20px; font-weight: bold; color: #005881; margin: 2px 0; }
.bp .bp-card-sub { color: #888; font-size: 11px; min-height: 16px; }

.bp .bp-row { display: flex; flex-wrap: wrap; gap: 10px; }
.bp .bp-box { flex: 1 1 220px; border: 1px solid #e3e8ee; border-radius: 6px; padding: 10px 14px; margin: 0 0 10px; background: #fff; }
.bp .bp-box h4 { margin-top: 0; }
.bp .bp-wide { flex-basis: 100%; }
.bp .bp-list { margin: 0; padding: 0 18px 0 0; }
.bp .bp-notice { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; padding: 8px; border: 1px solid #ccd5df; border-radius: 4px; }
.bp .bp-msgtext { background: #f7f9fb; padding: 10px; border-radius: 4px; margin: 8px 0; white-space: normal; }

.bp .bp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; }
.bp .bp-filter { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bp .bp-filter input, .bp .bp-filter select { padding: 4px 6px; border: 1px solid #ccd5df; border-radius: 4px; font-family: inherit; }
.bp .bp-btn, .bp button { display: inline-block; background: #005881; color: #fff !important; border: 0; border-radius: 4px;
    padding: 6px 14px; text-decoration: none; cursor: pointer; font-family: inherit; font-size: 13px; }
.bp .bp-btn:hover, .bp button:hover { background: #00466a; }
.bp button[disabled] { opacity: .6; cursor: default; }
.bp .bp-tab { padding: 4px 10px; border: 1px solid #ccd5df; border-radius: 4px; text-decoration: none; }
.bp .bp-tab.bp-cur { background: #005881; color: #fff; border-color: #005881; }

.bp .bp-table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 12px; }
.bp .bp-table th { background: #f1f5f9; color: #555; font-weight: bold; text-align: right; padding: 6px; border-bottom: 1px solid #dde4ec; }
.bp .bp-table td { padding: 6px; border-bottom: 1px solid #eef2f6; vertical-align: top; }
.bp .bp-table tr:hover td { background: #fafcfe; }
.bp .bp-narrow { max-width: 520px; }
.bp .bp-unread td { font-weight: bold; }
.bp .bp-in { color: #1e7e34; }
.bp .bp-out { color: #c0392b; }
.bp .bp-actions a { margin-left: 8px; white-space: nowrap; }
.bp .bp-scope { max-width: 170px; font-family: inherit; font-size: 12px; }
.bp .bp-saved { color: #1e7e34; }

.bp .bp-pager { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px; }
.bp .bp-pager a { padding: 2px 9px; border: 1px solid #ccd5df; border-radius: 4px; text-decoration: none; }
.bp .bp-pager a.bp-cur { background: #005881; color: #fff; border-color: #005881; }

.bp .bp-form { border: 1px solid #e3e8ee; border-radius: 6px; padding: 12px 14px; margin: 0 0 14px; background: #fcfdfe; }
.bp .bp-grid { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 10px; }
.bp .bp-grid label { flex: 1 1 200px; display: flex; flex-direction: column; font-size: 12px; color: #555; }
.bp .bp-grid label.bp-span2 { flex-basis: 100%; }
.bp .bp-grid input[type=text], .bp .bp-grid input[type=email], .bp .bp-grid select, .bp .bp-grid textarea {
    margin-top: 3px; padding: 5px 7px; border: 1px solid #ccd5df; border-radius: 4px; font-family: inherit; font-size: 13px; box-sizing: border-box; width: 100%; }
.bp .bp-link { display: flex; align-items: center; gap: 2px; margin-top: 3px; direction: ltr; }
.bp .bp-link input { width: 140px !important; margin: 0 !important; }
.bp .bp-logo img { max-width: 160px; max-height: 100px; border: 1px solid #e3e8ee; border-radius: 4px; }
.bp .bp-msg { font-size: 12px; margin-right: 8px; }

.bp .bp-monthnav { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; max-width: 520px; }

.bp .bp-chart { display: flex; align-items: flex-end; gap: 2px; height: 140px; border-bottom: 1px solid #ccd5df; margin: 10px 0 6px; direction: ltr; }
.bp .bp-bar { flex: 1 1 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 2px; }
.bp .bp-bar span { display: block; width: 100%; }
.bp .bp-bar-ads, .bp .bp-dot-ads { background: #2a7ab0; }
.bp .bp-bar-page, .bp .bp-dot-page { background: #f0a04b; }
.bp .bp-legend { font-size: 12px; }
.bp .bp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 2px; vertical-align: middle; }

/* private notes under every ad */
.bp .bp-table tr.bp-notes td { padding: 0 6px 8px; border-bottom: 1px solid #e3e8ee; background: #fff !important; }
.bp .bp-note-toggle { display: block; font-size: 12px; color: #6b7c8f !important; text-decoration: none; padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp .bp-has-note .bp-note-toggle { color: #8a5a00 !important; }
.bp .bp-note-edit { margin-top: 4px; }
.bp .bp-note-text { width: 100%; box-sizing: border-box; min-height: 60px; height: 60px; padding: 8px; border: 1px solid #e8d9b8; border-radius: 4px;
    background: #fffdf5; font-family: inherit; font-size: 13px; line-height: 1.8; transition: height .2s ease; resize: vertical; }
.bp .bp-note-text.bp-note-open, .bp .bp-note-text:focus { height: 150px; outline: none; border-color: #d4a72c; }
.bp .bp-note-state { font-size: 11px; }
.bp .bp-btn.bp-small { padding: 2px 8px; font-size: 11px; margin-top: 4px; }

/* conversations with visitors (section msg) */
.bp .bp-thread { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.bp .bp-bubble { max-width: 80%; padding: 8px 12px; border-radius: 6px; white-space: normal; }
.bp .bp-bubble-them { align-self: flex-start; background: #f1f5f9; border: 1px solid #e3e8ee; }
.bp .bp-bubble-me { align-self: flex-end; background: #e8f4ec; border: 1px solid #cfe6d6; }
.bp .bp-reply { width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13px; padding: 8px; border: 1px solid #ccd5df; border-radius: 4px; margin: 0 0 6px; }

/* red badge with unread messages at "پیام‌ها" in the menu (broker/index.php, js/broker-panel.js) */
#left .bp-badge, #admenu .bp-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-right: 6px;
    border-radius: 9px; background: #d93025; color: #fff; font-size: 11px; font-weight: bold; text-align: center; vertical-align: middle; box-sizing: border-box; }

/* jalali date picker (input.bp-date, js/broker-panel.js) */
.bp .bp-dp { position: absolute; top: 100%; right: 0; z-index: 50; width: 238px; margin-top: 4px; padding: 8px; background: #fff;
    border: 1px solid #ccd5df; border-radius: 6px; box-shadow: 0 6px 18px rgba(0, 0, 0, .15); color: #333; font-size: 13px; }
.bp .bp-dp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-weight: bold; }
.bp .bp-dp-nav { padding: 0 8px; text-decoration: none; font-size: 16px; }
.bp .bp-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.bp .bp-dp-grid b { color: #888; font-weight: normal; font-size: 11px; padding: 2px 0; }
.bp .bp-dp-day { display: block; padding: 4px 0; border-radius: 4px; text-decoration: none; color: #333 !important; }
.bp .bp-dp-day:hover { background: #e8f1f8; }
.bp .bp-dp-today { border: 1px solid #005881; }
.bp .bp-dp-sel { background: #005881; color: #fff !important; }
.bp .bp-dp-foot { margin-top: 6px; text-align: center; }

/* ---- phones (2026-10-16): broker panel /broker/ ---------------------------------------------- */
@media (max-width: 768px) {
    .ad_big { width: 100% !important; margin-top: 64px !important; }
    .title-men { display: none !important; }
    h2.title-menu { width: 100% !important; box-sizing: border-box; left: 0; right: 0; margin: 0 !important; padding: 10px 12px !important;
                    top: 64px; z-index: 50 !important; }
    #admenu { width: auto !important; font-size: 16px; }
    #admenu #bp-menu-badge { margin: 0 6px 0 0; }
    #left { position: fixed !important; top: 112px !important; right: 0; width: 220px !important; max-height: calc(100vh - 120px); overflow-y: auto;
            margin: 0 !important; z-index: 60 !important; box-shadow: -4px 4px 12px rgba(0, 0, 0, .2); }
    #left > div { cursor: pointer; }
    /* below the fixed header (64 px), menu bar and avatar (to 112 px); padding: margins would collapse */
    #brk-content { margin: 0 8px 10px !important; width: auto !important; max-width: calc(100vw - 16px); min-width: 0; float: none !important; }
    .ad_big { box-sizing: border-box; padding: 54px 0 0 !important; }
    .user-panel { top: 70px !important; left: 6px !important; margin: 0 !important; z-index: 55 !important; }
    .user-panel img#avatar { width: 36px !important; margin: 0 !important; }
    .user-panel .user-name { margin: 8px 6px 0 0 !important; font-size: 12px; }

    .bp { font-size: 13px; }
    .bp .bp-card { flex: 1 1 calc(50% - 10px); min-width: 0; padding: 8px 10px; }
    .bp .bp-card-value { font-size: 17px; }
    .bp .bp-box { flex-basis: 100%; }
    .bp .bp-toolbar, .bp .bp-filter { flex-direction: column; align-items: stretch; }
    .bp .bp-filter input, .bp .bp-filter select { width: 100%; box-sizing: border-box; }
    /* wide tables scroll inside themselves instead of widening the page */
    .bp .bp-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
    .bp .bp-grid label { flex-basis: 100%; }
    .bp .bp-bubble { max-width: 92%; }
    .bp .bp-monthnav { flex-wrap: wrap; gap: 6px; }
    .bp .bp-chart { height: 110px; }
}

/* the menu badge only on phones (on the desktop the menu is always open) */
@media (min-width: 769px) { #admenu #bp-menu-badge { display: none !important; } }
