/* Admin modules list styles */
.settings-emails__block{position:relative;margin-bottom:25px}
.settings-emails__block-title{font-size:18px;font-weight:500;padding-bottom:8px}
.settings-emails__block-body{border:1px solid #ddd;border-radius:4px;overflow:auto}
.settings-emails__block-acitons{padding-top:8px}
.settings-emails__block-body table{width:100%;border-collapse:collapse}
.settings-emails__block-body thead{height:0}
.settings-emails__block-body thead th{height:0;padding:0}
.settings-emails__row{border-bottom:1px solid #ddd}
.settings-emails__row:hover{background-color:rgba(221,221,221,.2)}
.settings-emails__row:last-child{border-bottom:none}
.settings-emails__row td{padding:10px 12px;vertical-align:top}
.settings-emails__th-name{width:70%}
.settings-emails__th-email-name{width:400px}
.settings-emails__th-email-count{width:200px}
.settings-emails__th-actions{width:30%}
.settings-emails__td-actions{text-align:right;white-space:nowrap}
.settings-emails__row-description{font-size:12px;color:#777}
.settings-emails__row-emails-count{font-size:14px;color:#777}
.settings-emails__row-name{word-break:break-all}
.settings-emails__row-disable .settings-emails__row-name{color:#777}
.settings-emails__list{position:relative;margin-bottom:15px}
.settings-emails__list-title{font-weight:700;margin-bottom:5px}
.settings-emails__list-body{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:1px solid #ddd}
.settings-emails__list-row{border-bottom:1px solid #ddd;position:relative;padding:8px 12px}
.settings-emails__list-row:last-child{border-bottom:none}
.settings-emails__list-row-action{position:absolute;right:12px;top:6px}
.settings-emails__notification-disabled{color:#ccc}

/* Dark mode */
body.dark-mode .settings-emails__row-disable .settings-emails__row-name{color:#878ea0}
body.dark-mode .settings-emails__block-body{border:1px solid #3f4149}
body.dark-mode .settings-emails__row{border-bottom:1px solid #3f4149}
body.dark-mode .settings-emails__row-emails-count{color:#878ea0}
body.dark-mode .settings-emails__row-description{color:#878ea0}
body.dark-mode .settings-emails__row:hover{background-color:#222327}
body.dark-mode .settings-emails__list-row{border-bottom:1px solid rgba(103,107,118,.5)}
body.dark-mode .settings-emails__list-body{border:1px solid rgba(103,107,118,.5)}

/* Custom Rates & Discount Modal responsive */
@media (max-width: 768px) {
  .modal-dialog.modal-lg { width: 96% !important; margin: 10px auto; }
  .modal-dialog.modal-sm { width: 96% !important; margin: 10px auto; }
  .modal-body { max-height: 80vh !important; overflow-y: auto; }
  .modal .table-responsive { border: none; margin-bottom: 0; }
  .modal .table-responsive .table { font-size: 11px; }
  .modal .table-responsive .table th,
  .modal .table-responsive .table td { padding: 3px 2px !important; }
  .modal .table input[type="checkbox"] { margin: 0; }
  .modal .dropdown-menu { min-width: 260px !important; max-width: 90vw !important; left: 0 !important; right: auto !important; }
}
@media (max-width: 480px) {
  .modal .dropdown-menu { min-width: 220px !important; left: 0 !important; right: auto !important; }
  .modal .row .col-xs-12 { margin-bottom: 6px; }
}
body.dark-mode .modal-content { background-color: #2d2f36; color: #e0e0e0; }
body.dark-mode .modal-header { border-bottom-color: #3f4149; }
body.dark-mode .modal-footer { border-top-color: #3f4149; }
body.dark-mode .modal .table { background-color: #2d2f36; color: #e0e0e0; }
body.dark-mode .modal .table-bordered { border-color: #3f4149; }
body.dark-mode .modal .table-bordered > thead > tr > th,
body.dark-mode .modal .table-bordered > tbody > tr > td { border-color: #3f4149; }
body.dark-mode .modal .table > thead > tr > th { background-color: #222327; color: #ccc; }
body.dark-mode .modal .table > tbody > tr.active > td { background-color: #33353d; }
body.dark-mode .modal .table .text-muted { color: #878ea0; }
body.dark-mode .modal .dropdown-menu { background-color: #2d2f36; border-color: #3f4149; }
body.dark-mode .modal .dropdown-menu li { border-bottom-color: #3f4149; }
body.dark-mode .modal .dropdown-menu label { color: #e0e0e0; }
body.dark-mode .modal .dropdown-menu .text-muted { color: #878ea0; }
body.dark-mode .modal .form-control { background-color: #222327; border-color: #3f4149; color: #e0e0e0; }
body.dark-mode .modal .input-group-addon { background-color: #222327; border-color: #3f4149; color: #878ea0; }
body.dark-mode .modal .help-block { color: #878ea0; }
body.dark-mode .modal .close { color: #fff; opacity: .7; }

/* ===== Orders Page Shared Styles ===== */

/* --- Flex utilities --- */
.p-ui__flex { display: flex; }
.p-ui__flex--wrap-wrap { flex-wrap: wrap; }
.p-ui__flex--wrap-nowrap { flex-wrap: nowrap; }
.p-ui__flex--direction-column { flex-direction: column; }
.p-ui__flex--align-center { align-items: center; }
.p-ui__flex--align-baseline { align-items: baseline; }
.p-ui__flex--justify-center { justify-content: center; }
.p-ui__flex--gap-4 { gap: 4px; }
.p-ui__flex--gap-8 { gap: 8px; }
.p-ui__flex--gap-16 { gap: 16px; }
.p-ui__flex--gap-none { gap: 0; }
.p-ui__flex--grow-1 { flex-grow: 1; }
.p-ui__ml-auto { margin-left: auto; }
.p-ui__width-100pct { width: 100%; }

@media (min-width: 576px) {
  .p-ui__flex--direction-xs-row { flex-direction: row; }
  .p-ui__flex--justify-xs-between { justify-content: space-between; }
  .p-ui__flex--wrap-xs-nowrap { flex-wrap: nowrap; }
}

@media (min-width: 992px) {
  .p-ui__flex--direction-lg-row { flex-direction: row; }
  .p-ui__flex--wrap-lg-wrap { flex-wrap: wrap; }
  .p-ui__flex--grow-lg-1 { flex-grow: 1; }
  .p-ui__flex--basis-lg-0 { flex-basis: 0; }
  .p-ui__flex--gap-lg-8 { gap: 8px; }
  .p-ui__mb-lg-16 { margin-bottom: 16px; }
  .p-ui__mb-lg-0 { margin-bottom: 0; }
  .p-ui__ml-lg-auto { margin-left: auto; }
  .p-ui__order-lg-1 { order: 1; }
  .p-ui__order-lg-2 { order: 2; }
  .p-ui__order-lg-3 { order: 3; }
}

.p-ui__order-1 { order: 1; }
.p-ui__order-2 { order: 2; }
.p-ui__order-3 { order: 3; }

.dd-container { display: block !important; }

/* --- Tab pills --- */
.p-ui-tabs-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.p-ui-tabs-pills__item {
  padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500;
  background: #f5f5f5; color: #555; cursor: pointer; transition: all .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.p-ui-tabs-pills__item:hover { background: #e8e8e8; color: #333; }
.p-ui-tabs-pills__item--active { background: #eef2f5; border-color: #cdd4dc; color: #222; font-weight: 600; }
.p-ui-tabs-pills__item--size-md { padding: 6px 16px; font-size: 13px; }

/* --- Button filter --- */
.button-filter {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px;
  background: #fff; border: 1px solid #ddd; color: #555;
  cursor: pointer; transition: all .15s;
}
.button-filter:hover { background: #f8f9fa; border-color: #bbb; }
.button-filter.active { background: #eef2f5; border-color: #cdd4dc; font-weight: 500; }
.button-filter__icon { width: 18px; height: 18px; }
.button-filter__name { font-weight: 500; }
.button-filter__value { color: #888; }
.button-filter .fa-times { font-size: 11px; margin-left: 2px; color: #999; cursor: pointer; }
.button-filter .fa-times:hover { color: #333; }

/* --- Search input --- */
.search-input { display: flex; align-items: center; position: relative; }
.search-input__with-select .search-input__input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.search-input__select select { border-radius: 0; border-left: none; border-right: none; height: 34px; min-width: 110px; }
.search-input__icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #999; z-index: 2; }
.search-input__icon + .search-input__input { padding-left: 30px; }
.custom__search-button { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* --- Clear button --- */
.p-ui__button-clear {
  background: none; border: none; color: #337ab7; cursor: pointer; font-size: 12px; padding: 5px 8px;
}
.p-ui__button-clear:hover { text-decoration: underline; }
.p-ui__button-clear:disabled { color: #aaa; cursor: default; text-decoration: none; }

/* --- Table --- */
.table__orders th { font-weight: 500; color: #333; white-space: nowrap; }
.table__orders td { vertical-align: middle !important; }
.table__orders-checker { width: 30px; text-align: center; vertical-align: middle; }
.table__orders-id { min-width: 60px; }
.table__orders-id span { font-weight: 600; }
.table__orders-user { min-width: 100px; }
.table__orders-charge { min-width: 70px; }
.table__orders-link { max-width: 280px; word-break: break-all; }
.table__orders-start_count { min-width: 80px; }
.table__orders-quantity { min-width: 70px; }
.table__orders-service { min-width: 180px; max-width: 300px; }
.table__orders-status { min-width: 90px; }
.table__orders-remains { min-width: 70px; }
.table__orders-date { min-width: 130px; white-space: nowrap; }
.table__orders-mode { min-width: 60px; }
.table__orders-actions { width: 80px; text-align: right; }

/* --- Secondary row --- */
.order-row-secondary { background-color: transparent !important; }
.order-row-secondary td { border-top: none !important; padding-top: 0 !important; color: #8CA1A5; font-size: 12px; }
.border-t-none { border-top: none !important; }
.p-t-0 { padding-top: 0 !important; }

/* --- Service row --- */
.service__id { color: #8CA1A5; font-size: 11px; margin-right: 4px; font-weight: 600; }
.grey { color: #8CA1A5; font-size: 11px; }

/* --- Link cell --- */
.link-to-refill { margin-left: 5px; color: #888; font-size: 11px; }
.link-to-refill:hover { color: #333; }

/* --- Labels --- */
.label-api, .label-hold, .label-dripfeed, .label-subscription, .label-mass {
  font-size: 9px; padding: 2px 5px; border-radius: 3px; margin-left: 3px; font-weight: 400; vertical-align: middle;
}
.label-api { background: #666; color: #fff; }
.label-hold { background: #f0ad4e; color: #fff; }
.label-dripfeed { background: #5bc0de; color: #fff; }
.label-subscription { background: #d9534f; color: #fff; }
.label-mass { background: #337ab7; color: #fff; }

/* --- Dropdown submenu --- */
.dropdown-submenu { position: relative; }
.dropdown-submenu > .dropdown-menu { top: 0; left: 100%; margin-top: -1px; display: none; }
.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu.open > .dropdown-menu { display: block; }
.dropdown-submenu-left > .dropdown-menu { left: auto; right: 100%; }

/* --- Misc --- */
.nowrap { white-space: nowrap; }
.td-caret { text-align: right; padding-right: 15px !important; }
.text-nowrap { white-space: nowrap; }
.refill-link { display: flex; align-items: flex-start; gap: 5px; }
.font__weight-med, .fontWieghtMed { font-weight: 500; }
.dropdown-right .dropdown-menu { left: auto; right: 0; }
.orders-pay-hash { }

/* --- Bulk action bar --- */
.bulk-action-bar { flex-wrap: wrap; }

/* --- Filter Dropdown (multi-select) --- */
.p-ui-dropdown__container {
    background: #fff; border: 1px solid #ddd; border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12); overflow: hidden;
}
.p-ui-dropdown__header { border-bottom: 1px solid #eee; }
.p-ui-dropdown__footer { border-top: 1px solid #eee; }
.p-ui-dropdown__row { padding-top: 12px; }
.p-ui-filter-title { font-size: 14px; font-weight: 600; color: #333; }
.p-ui__p-16 { padding: 16px; }
.p-ui__pl-16 { padding-left: 16px; }
.p-ui__pr-16 { padding-right: 16px; }
.p-ui__mb-16 { margin-bottom: 16px; }
.p-ui-input-search { position: relative; flex: 1; }
.p-ui-input-search input { padding-right: 28px; }
.p-ui-button__sort {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border: 1px solid #ddd; border-radius: 6px;
    background: #fff; cursor: pointer; color: #666; font-size: 14px;
}
.p-ui-button__sort:hover { background: #f5f5f5; }
.p-ui-button__sort--asc { background: #eef2f5; border-color: #cdd4dc; }
.p-ui-list { background: #fff; }
.p-ui-filter-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 16px; cursor: pointer; font-size: 13px; color: #333;
    min-height: 34px;
}
.p-ui-filter-row:hover { background: #f8f9fa; }
.p-ui-filter-row__checkbox input { margin: 0; cursor: pointer; }
.p-ui-filter-row__content { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow: hidden; }
.p-ui-filter-row__content > span:not(.badge-service-id) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-ui-filter-row__content > span:last-child { white-space: nowrap; flex-shrink: 0; }
.badge-service-id {
    background: #8ca1a5; color: #fff; font-size: 10px; padding: 1px 5px;
    border-radius: 3px; font-weight: 600; margin-right: 2px; white-space: nowrap;
}

/* --- Dark mode overrides --- */
body.dark-mode .table-grey { background-color: #222327; }
body.dark-mode .table__orders th { color: #ccc; }
body.dark-mode .order-row-secondary td { color: #878ea0; }
body.dark-mode .button-filter { background: #2d2f36; border-color: #3f4149; color: #ccc; }
body.dark-mode .button-filter:hover { background: #33353d; border-color: #555; }
body.dark-mode .button-filter.active { background: #3d4048; border-color: #555; }
body.dark-mode .p-ui-tabs-pills__item { background: #2d2f36; color: #ccc; }
body.dark-mode .p-ui-tabs-pills__item:hover { background: #33353d; }
body.dark-mode .p-ui-tabs-pills__item--active { background: #3d4048; border-color: #555; color: #fff; }
body.dark-mode .custom__search-button { background: #2d2f36; border-color: #3f4149; color: #ccc; }
body.dark-mode .search-input__input { background: #1e1f23; border-color: #3f4149; color: #ccc; }
body.dark-mode .search-input__select select { background: #1e1f23; border-color: #3f4149; color: #ccc; }
body.dark-mode .search-input__icon { color: #888; }
body.dark-mode .dd-container { background: #2d2f36; border-color: #3f4149; }
body.dark-mode .dd-container > li > a { color: #ccc; }
body.dark-mode .dd-container > li > a:hover { background: #33353d; }
body.dark-mode .p-ui-dropdown__container { background: #2d2f36; border-color: #3f4149; }
body.dark-mode .p-ui-dropdown__header { border-color: #3f4149; }
body.dark-mode .p-ui-dropdown__footer { border-color: #3f4149; }
body.dark-mode .p-ui-filter-title { color: #eee; }
body.dark-mode .p-ui-list { background: #2d2f36; }
body.dark-mode .p-ui-filter-row { color: #ccc; }
body.dark-mode .p-ui-filter-row:hover { background: #33353d; }
body.dark-mode .p-ui-button__sort { background: #2d2f36; border-color: #3f4149; color: #ccc; }
body.dark-mode .p-ui-button__sort--asc { background: #3d4048; }
body.dark-mode .p-ui-input-search input { background: #1e1f23; border-color: #3f4149; color: #ccc; }



@media screen and (max-width: 768px) {
  .navbar-popover {
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0px;
    box-shadow: none;
    width: 100%;
    height: calc(100vh - 56px);

    &__header {
      flex-shrink: 0;

      &.handle {
        cursor: default;
      }
    }

    &__body {
      flex-grow: 1;
      overflow-y: auto;

      .body-list {
        max-height: 100%;
      }
    }

    &__body-empty {
      flex-grow: 1;
      height: auto;
    }

    &__footer {
      flex-shrink: 0;
    }

    &__guides {
      top: 56px;
      right: 0;
      left: 0;
      width: 100%;
    }
  }
}

/* Service icon tooltips */
.service-table__type-options-icon {
    position: relative;
    cursor: help;
    margin: 0 3px;
    font-size: 13px;
}
.service-table__type-options-icon:hover::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    line-height: 1.3;
    font-weight: 400;
}
.service-table__type-options-icon:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    z-index: 9999;
    pointer-events: none;
}

body.dark-mode .service-table__type-options-icon:hover::after {
    background: #555;
}
body.dark-mode .service-table__type-options-icon:hover::before {
    border-top-color: #555;
}

/* Modal backdrop fix - Bootstrap CSS not fully loaded */
.modal-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    background: rgba(0,0,0,0.5);
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1050;
    overflow: hidden;
    outline: 0;
}
.modal-dialog {
    position: relative;
    width: auto;
    margin: 30px auto;
    max-width: 600px;
}
.modal-content {
    position: relative;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    box-shadow: 0 3px 9px rgba(0,0,0,0.5);
    outline: 0;
}
.modal-header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5;
}
.modal-header .close {
    margin-top: -2px;
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .2;
    background: none;
    border: none;
    cursor: pointer;
}
.modal-title {
    margin: 0;
    line-height: 1.42857143;
}
.modal-body {
    position: relative;
    padding: 15px;
}
.modal-footer {
    padding: 15px;
    text-align: right;
    border-top: 1px solid #e5e5e5;
}
.modal-footer .btn + .btn {
    margin-left: 5px;
}


/* ---- Rich text content from the support desk (GoDesk) ---- */

/* Staff/dev messages (Tiptap HTML) rendered safely after sanitization.
   Plain-text messages keep the escaped renderer, so content in here is HTML. */
.godesk-rich,
.ticket-message__body-message .godesk-rich {
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.godesk-rich > :first-child { margin-top: 0; }
.godesk-rich > :last-child { margin-bottom: 0; }
.godesk-rich p { margin: 0 0 0.5em; }
.godesk-rich ul,
.godesk-rich ol { margin: 0 0 0.5em; padding-left: 1.5em; }
.godesk-rich ul { list-style: disc; }
.godesk-rich ol { list-style: decimal; }
.godesk-rich li { margin-bottom: 0.15em; }
.godesk-rich h1,
.godesk-rich h2,
.godesk-rich h3,
.godesk-rich h4,
.godesk-rich h5,
.godesk-rich h6 { margin: 0.6em 0 0.3em; font-weight: 600; line-height: 1.3; }
.godesk-rich h1 { font-size: 1.5em; }
.godesk-rich h2 { font-size: 1.3em; }
.godesk-rich h3 { font-size: 1.15em; }
.godesk-rich h4,
.godesk-rich h5,
.godesk-rich h6 { font-size: 1em; }
.godesk-rich a { color: #337ab7; text-decoration: underline; }
.godesk-rich blockquote {
  margin: 0 0 0.5em; padding: 0.3em 0.8em;
  border-left: 3px solid #337ab7; color: #555; background: rgba(0,0,0,0.03);
}
.godesk-rich pre,
.godesk-rich code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.godesk-rich code {
  background: rgba(0,0,0,0.06); border-radius: 3px;
  padding: 0.15em 0.35em; font-size: 0.9em;
}
.godesk-rich pre {
  background: #f4f4f4; border: 1px solid #e2e2e2; border-radius: 4px;
  padding: 0.6em 0.8em; overflow-x: auto; margin: 0 0 0.5em;
}
.godesk-rich pre code { background: none; padding: 0; }
.godesk-rich img { max-width: 100%; height: auto; }
.godesk-rich hr { border: 0; border-top: 1px solid #ddd; margin: 0.6em 0; }
.godesk-rich table { border-collapse: collapse; margin: 0 0 0.5em; }
.godesk-rich table td,
.godesk-rich table th { border: 1px solid #ddd; padding: 4px 8px; }

/* Notifications dropdown body (compact spacing). */
.godesk-notification-message {
  margin-bottom: 5px;
  font-size: 13px;
  color: #444;
}
.godesk-notification-message .godesk-rich {
  font-size: 13px;
  color: #444;
}

/* Dark-mode overrides for the sanitized rich content. */
body.dark-mode .godesk-notification-message { color: #c9cdd4; }
body.dark-mode .godesk-rich,
body.dark-mode .ticket-message__body-message .godesk-rich { color: #dfe0e1; }
body.dark-mode .godesk-rich a { color: #5aa2e9; }
body.dark-mode .godesk-rich blockquote { color: #b8bec9; border-left-color: #5aa2e9; background: rgba(255,255,255,0.04); }
body.dark-mode .godesk-rich code { background: rgba(255,255,255,0.08); }
body.dark-mode .godesk-rich pre { background: #2a2c31; border-color: #3f4149; }
body.dark-mode .godesk-rich hr { border-top-color: #3f4149; }
body.dark-mode .godesk-rich table td,
body.dark-mode .godesk-rich table th { border-color: #3f4149; }

