/* ==========================================================================
   Sahand — corrections
   --------------------------------------------------------------------------
   Loaded after sahand.css. Everything here fixes a specific defect that was
   reproduced in the panel; nothing here is a style preference, so this sheet
   should stay small. If a rule stops being needed, delete it.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Email preference list rendered as narrow vertical columns

   sahand.css turns every .form-check into a flex row. That is right for a
   single checkbox (remember-me, opt-in) but clientareadetails.tpl puts the
   whole email-preferences list inside one .controls.form-check, so each
   label became a flex item and got squeezed into its own column.

   The list container stacks; the individual rows inside it stay flex.
   -------------------------------------------------------------------------- */

.controls.form-check {
    display: block !important;
    padding: 0 !important;
}

.controls.form-check > label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 .85rem;
    font-weight: 400;
    line-height: 1.9;
    cursor: pointer;
}

.controls.form-check > label > input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin: .45rem 0 0 !important;
    accent-color: var(--blue, #f8f8f8);
}

/* The <br> separators between labels are redundant once the labels are
   block-level, and they double the gap. */
.controls.form-check > br { display: none; }

/* --------------------------------------------------------------------------
   2. Sorted table column turning white

   The DataTables Bootstrap sheet paints the active sort column with a light
   background that was never meant for a dark surface. It arrives after our
   sheet in the cascade, hence !important.
   -------------------------------------------------------------------------- */

table.dataTable thead th,
table.dataTable thead td,
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled,
.listtable table thead th {
    background-color: transparent !important;
    background-image: none !important;
    color: var(--muted, #aaaaaa) !important;
}

table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    color: var(--text, #f8f8f8) !important;
}

/* The sort arrows ship as background images positioned for LTR. */
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
    right: auto;
    left: .6em;
}

/* --------------------------------------------------------------------------
   3. White block in the table search field

   The magnifier is a pseudo-element that falls back to a filled box when the
   icon font does not resolve. A placeholder reads better in Persian anyway.
   -------------------------------------------------------------------------- */

.dataTables_filter label:before,
.listtable .dataTables_filter label:before,
.dataTables_filter label:after {
    content: none !important;
    display: none !important;
}

.dataTables_filter input[type="search"] {
    background-color: var(--raised, #171717) !important;
    background-image: none !important;
    text-align: right;
}

.dataTables_filter input[type="search"]::-webkit-search-decoration,
.dataTables_filter input[type="search"]::-webkit-search-cancel-button,
.dataTables_filter input[type="search"]::-webkit-search-results-button {
    -webkit-appearance: none;
    appearance: none;
}

/* --------------------------------------------------------------------------
   4. Latin runs inside Persian text

   Hostnames, sizes, IPs and prices are logically left-to-right. Without
   isolation the bidi algorithm reorders them against the surrounding
   Persian, which is why "43 KB" was showing up as "KB 43".
   -------------------------------------------------------------------------- */

.ltr,
code, kbd, samp,
.sh-stat .v,
.mono,
td .domain,
input[type="email"],
input[type="url"],
input[type="tel"] {
    unicode-bidi: isolate;
    direction: ltr;
    text-align: right;
}

/* Numbers keep the surrounding direction but must not drag adjacent Latin
   units along with them. */
.num,
.amount,
.price,
.badge {
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   5. Announcement bodies

   Announcement HTML is author-supplied and often carries a light background
   from wherever it was pasted, which turns unreadable on a dark card.
   -------------------------------------------------------------------------- */

.announcement-body,
.card-body .announcement-content,
.card-body .announcement-content * {
    background: transparent !important;
    color: var(--text, #f8f8f8) !important;
}

/* --------------------------------------------------------------------------
   6. Empty-state rows

   The "no records" cell inherits the table's centring but not its padding,
   so it sat flush against the header rule.
   -------------------------------------------------------------------------- */

table.dataTable td.dataTables_empty {
    padding: 2.25rem 1rem !important;
    color: var(--muted, #aaaaaa) !important;
    text-align: center;
}
