/* ─────────────────────────────────────────────────────────────
   Theme — Primary color override (Teal)
───────────────────────────────────────────────────────────── */
:root {
    --tblr-primary:         #0ca678;
    --tblr-primary-rgb:     12, 166, 120;
    --tblr-primary-fg:      #ffffff;
    --tblr-primary-lt:      rgb(230.7, 246.1, 241.5);
    --tblr-primary-lt-rgb:  230.7, 246.1, 241.5;
    --tblr-link-color:      #0ca678;
    --tblr-link-hover-color:#0a8f67;
}

/* ─────────────────────────────────────────────────────────────
   Collapse toggle text (разгъни / свий)
───────────────────────────────────────────────────────────── */
[data-bs-toggle="collapse"] .when-expanded  { display: none; }
[data-bs-toggle="collapse"] .when-collapsed { display: inline; }
[data-bs-toggle="collapse"]:not(.collapsed) .when-expanded  { display: inline; }
[data-bs-toggle="collapse"]:not(.collapsed) .when-collapsed { display: none; }
.collapse-toggle { width: 95px; }

/* ─────────────────────────────────────────────────────────────
   Bootstrap tbody collapse fix
───────────────────────────────────────────────────────────── */
tbody.collapse.show { display: table-row-group !important; }
tbody.collapsing    { display: table-row-group !important; height: auto !important; transition: none !important; }

/* ─────────────────────────────────────────────────────────────
   Table utilities
───────────────────────────────────────────────────────────── */
.table-fixed { table-layout: fixed; width: 100%; }

/* ─────────────────────────────────────────────────────────────
   Form containers (max-width)
───────────────────────────────────────────────────────────── */
.form-container-xs { max-width: 300px; }
.form-container-sm { max-width: 500px; }
.form-container    { max-width: 600px; }

/* ─────────────────────────────────────────────────────────────
   Guest layout (login / register / pending / set-password)
───────────────────────────────────────────────────────────── */
.guest-box    { max-width: 440px; }
.guest-box-lg { max-width: 540px; }

/* ─────────────────────────────────────────────────────────────
   Sortable table headers
───────────────────────────────────────────────────────────── */
th.sortable { cursor: pointer; }

/* ─────────────────────────────────────────────────────────────
   Table column width helpers
───────────────────────────────────────────────────────────── */
.col-checkbox     { width: 36px; }
.col-amount-input { width: 130px; }

/* ─────────────────────────────────────────────────────────────
   Payment charges table — colgroup column widths
   (Период / Статус / Бр. / Такса / Дължимо / Платено / Остатък / Плащане / Действия)
───────────────────────────────────────────────────────────── */
.payment-charges-table col:nth-child(1) { width: 22%; }
.payment-charges-table col:nth-child(2) { width: 10%; }
.payment-charges-table col:nth-child(3) { width:  6%; }
.payment-charges-table col:nth-child(4) { width: 10%; }
.payment-charges-table col:nth-child(5) { width: 11%; }
.payment-charges-table col:nth-child(6) { width: 11%; }
.payment-charges-table col:nth-child(7) { width: 11%; }
.payment-charges-table col:nth-child(8) { width: 10%; }
.payment-charges-table col:nth-child(9) { width:  7%; }

/* ─────────────────────────────────────────────────────────────
   Portal cards
───────────────────────────────────────────────────────────── */
.card-orange        { background-color: #f0a500; }
.card-orange.card-narrow { max-width: 360px; }
.card-status-danger  { background-color: #e05050; }
.card-status-success { background-color: #3a9e5f; }

/* ─────────────────────────────────────────────────────────────
   Filter inputs — fixed widths
───────────────────────────────────────────────────────────── */
.filter-input-date   { width: 140px; }
.filter-input-method { width: 120px; }
.filter-input-status { width: 130px; }

/* ─────────────────────────────────────────────────────────────
   Payment home table — th column widths
───────────────────────────────────────────────────────────── */
.th-num        { width: 44px; }
.th-date       { width: 130px; }
.th-qty        { width: 50px; }
.th-amount     { width: 90px; }
.th-pay-btn    { width: 110px; }
.th-pay-date   { width: 100px; }
.th-pay-num    { width: 110px; }
.th-actions    { width: 90px; }

/* ─────────────────────────────────────────────────────────────
   Search inputs — fixed widths
───────────────────────────────────────────────────────────── */
.search-input-narrow { width: 100px; }

/* ─────────────────────────────────────────────────────────────
   Public pages — logo sizes
───────────────────────────────────────────────────────────── */
.logo-navbar     { height: 31px; width: auto; }
.logo-hero       { height: 56px; width: auto; }
.logo-footer     { height: 31px; width: auto; }
.logo-developer  { height: 28px; width: auto; }

/* ─────────────────────────────────────────────────────────────
   Developer credit logo
───────────────────────────────────────────────────────────── */
.madji-img-footer {
    height: 30px !important;
    width: auto !important;
    max-height: 30px !important;
    max-width: 100px !important;
    vertical-align: middle;
    transition: opacity 0.2s;
    object-fit: contain;
}
.madji-img-footer:hover { opacity: 0.7; }

/* ─────────────────────────────────────────────────────────────
   Report page
───────────────────────────────────────────────────────────── */
.home-check-col { width: 110px; }

/* ─────────────────────────────────────────────────────────────
   Sidebar
───────────────────────────────────────────────────────────── */
.sidebar-mint {
    background-color: #0ca678 !important;
}
.sidebar-mint .nav-link {
    color: rgba(255, 255, 255, .75);
}
.sidebar-mint .nav-link:hover,
.sidebar-mint .nav-link.active {
    background-color: rgba(0, 0, 0, .2);
    color: #ffffff;
}
.sidebar-mint .navbar-brand {
    color: #ffffff;
}

/* ─────────────────────────────────────────────────────────────
   Footer
───────────────────────────────────────────────────────────── */
.footer-teal { background-color: #0ca678; }
.footer-link { transition: color 0.2s; }
.footer-link:hover { color: #fff !important; }

/* ─────────────────────────────────────────────────────────────
   Demo page
───────────────────────────────────────────────────────────── */
.demo-screenshot {
    min-height: 280px;
    border: 2px dashed #dee2e6;
}
.demo-screenshot-img {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .10);
}

/* ─────────────────────────────────────────────────────────────
   Back to top button
───────────────────────────────────────────────────────────── */
#back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--tblr-primary);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    cursor: pointer;
    transition: opacity .2s, transform .2s;
}
#back-to-top:hover { opacity: .85; transform: translateY(-2px); }

/* ─────────────────────────────────────────────────────────────
   Flash toast container
───────────────────────────────────────────────────────────── */
.toast-container-fixed { position: fixed; top: 1rem; right: 1rem; z-index: 1090; }

/* ─────────────────────────────────────────────────────────────
   No-copy protection
───────────────────────────────────────────────────────────── */
.no-copy {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
.no-copy img { pointer-events: none; }


/* ─────────────────────────────────────────────────────────────
   Dashboard module cards
───────────────────────────────────────────────────────────── */
.dashboard-icon-badge { font-size: .55rem; }


/* ─────────────────────────────────────────────────────────────
   Hamburger menu notification badge
───────────────────────────────────────────────────────────── */
.hamburger-badge { font-size: .6rem; min-width: 1.2rem; padding: .2em .4em; }

/* ─────────────────────────────────────────────────────────────
   Sidebar notification badges — vertical alignment
───────────────────────────────────────────────────────────── */
.notification-badge { vertical-align: middle; }

/* ─────────────────────────────────────────────────────────────
   Print logo
───────────────────────────────────────────────────────────── */
.print-logo-img  { height: 36px; width: auto; }
.print-logo-text { font-size: 1.1rem; font-weight: 600; margin-left: .5rem; }

/* ─────────────────────────────────────────────────────────────
   Messages — recipient list scroll
───────────────────────────────────────────────────────────── */
.recipient-list-scroll { max-height: 180px; overflow-y: auto; }

/* ─────────────────────────────────────────────────────────────
   Document image preview
───────────────────────────────────────────────────────────── */
.doc-image-preview { max-height: 500px; width: auto; cursor: zoom-in; }
.doc-image-preview.expanded { max-height: none; cursor: zoom-out; }
.doc-preview-iframe { width: 100%; height: 80vh; border: none; }

/* ─────────────────────────────────────────────────────────────
   Assembly module
───────────────────────────────────────────────────────────── */
.assembly-status-badge { font-size: 0.85rem; }
.agenda-item-num       { min-width: 1.5rem; text-align: right; }
.agenda-decision-col   { min-width: 220px; }
.ideal-parts-input     { width: 100px; }
.rep-type-select       { width: auto; }
.vote-mode-select      { width: auto; }

/* ─────────────────────────────────────────────────────────────
   Help module
───────────────────────────────────────────────────────────── */
.help-module-link               { color: var(--tblr-body-color); text-decoration: none; }
.help-module-link:hover         { background: var(--tblr-primary-lt); color: var(--tblr-primary); }
.help-module-link.active        { background: var(--tblr-primary); color: #fff; }
.help-module-link.active:hover  { background: var(--tblr-primary); }
mark.help-highlight             { background: #fff3cd; padding: 0 2px; border-radius: 2px; }

/* ─────────────────────────────────────────────────────────────
   Sidebar sub-menu
───────────────────────────────────────────────────────────── */
.sidebar-subnav {
    flex-direction: column !important;
    padding-left: 2.25rem;
    margin-bottom: 0.25rem;
    border-left: 2px solid var(--tblr-border-color);
    margin-left: 1.25rem;
}
.sidebar-subnav .nav-link {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, .7);
}
.sidebar-subnav .nav-link:hover {
    color: #ffffff;
    background-color: rgba(0, 0, 0, .2);
}
