/* rdtmaster on the rdtnew theme (load after rdt.css).
   rdtmaster pages were written with Bootstrap's dark buttons and a few own classes;
   these rules give them the rdtnew colours so every page matches without editing each view. */

/* Main action buttons use the theme's sea-green, like rdtnew */
.btn-dark {
    --bs-btn-bg: var(--rdt-sea);
    --bs-btn-border-color: var(--rdt-sea);
    --bs-btn-hover-bg: var(--rdt-sea-dark);
    --bs-btn-hover-border-color: var(--rdt-sea-dark);
    --bs-btn-active-bg: var(--rdt-sea-dark);
    --bs-btn-active-border-color: var(--rdt-sea-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
}
.btn-outline-dark {
    --bs-btn-color: var(--rdt-sea);
    --bs-btn-border-color: var(--rdt-sea);
    --bs-btn-hover-bg: var(--rdt-sea);
    --bs-btn-hover-border-color: var(--rdt-sea);
    --bs-btn-hover-color: #fff;
}

/* Dashboard figures */
.stat { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.stat.text-dark { color: var(--rdt-text) !important; }

/* Licence keys */
code.key { font-size: .9rem; background: rgba(201, 151, 63, .12); color: #8a5f12; border: 1px solid rgba(201, 151, 63, .35); padding: .15rem .45rem; border-radius: 4px; }
[data-bs-theme=dark] code.key { color: #e5c07b; }

/* Cards and tables read like rdtnew's lists */
.card { border: 1px solid var(--rdt-line); }
.card h6 { font-weight: 700; margin-bottom: .85rem; }
.table td, .table th { vertical-align: middle; }
.table > thead th { font-weight: 600; white-space: nowrap; }
.card > .table, .card > .table-responsive { margin-bottom: 0; }

/* Page title actions sit to the right of the heading */
.page-title-right .btn { white-space: nowrap; }

/* Company code in the sidebar brand stays on one line */
.navbar-brand-box .logo-txt { letter-spacing: .04em; }

/* Login / install card */
.auth-content h5 { font-weight: 700; margin-bottom: 1rem; }
.auth-content .list-unstyled li { padding: .2rem 0; }

@media print {
    .vertical-menu, #page-topbar, .footer, .page-title-right, .btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
}

/* =====================================================================
   Shared list components (used by Billing, Licences, Support Tickets …)
   ===================================================================== */

/* Underline tabs inside a card header, with a count bubble per tab.
   <div class="rm-tabs"><a class="rm-tab active" href="…">Unpaid <span class="rm-count">3</span></a> … </div> */
.rm-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rdt-line); margin: -4px -18px 0; padding: 0 12px; }
.rm-tabs::-webkit-scrollbar { display: none; }
.rm-tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 10px 13px; color: var(--rdt-muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; }
.rm-tab:hover { color: var(--rdt-text); border-bottom-color: rgba(var(--rdt-sea-rgb), .35); }
.rm-tab.active { color: var(--rdt-sea); border-bottom-color: var(--rdt-sea); }
.rm-tab .rm-count { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; background: var(--rdt-mist); color: var(--rdt-muted); }
.rm-tab.active .rm-count { background: rgba(var(--rdt-sea-rgb), .12); color: var(--rdt-sea); }
.rm-tab .rm-count.warn { background: rgba(245, 158, 11, .15); color: #b45309; }
.rm-tab .rm-count.bad { background: rgba(239, 68, 68, .13); color: #b91c1c; }
.rm-tab:focus-visible { outline: 2px solid var(--rdt-sea); outline-offset: -2px; border-radius: 6px; }

/* Card header that holds tabs on top and a toolbar (search, filters) below */
.rm-list-head { padding: 4px 18px 0; border-bottom: 0; }
.rm-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--rdt-line); }
.rm-search { position: relative; flex: 1 1 260px; max-width: 360px; }
.rm-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--rdt-muted); font-size: 16px; pointer-events: none; }
.rm-search input { padding-left: 34px; border-radius: 8px; }
.rm-meta { color: var(--rdt-muted); font-size: 12.5px; }

/* Summary cards: icon chip, label, figure, hint */
.rm-kpi { display: flex; gap: 14px; align-items: flex-start; height: 100%; }
.rm-kpi .rm-ico { flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 21px; }
.rm-kpi .rm-ico.sea { background: rgba(var(--rdt-sea-rgb), .1); color: var(--rdt-sea); }
.rm-kpi .rm-ico.warn { background: rgba(245, 158, 11, .14); color: #b45309; }
.rm-kpi .rm-ico.bad { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.rm-kpi .rm-ico.ok { background: rgba(16, 185, 129, .13); color: #047857; }
.rm-kpi .rm-label { color: var(--rdt-muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.rm-kpi .rm-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; color: var(--rdt-text); }
.rm-kpi .rm-value small { font-size: .75rem; font-weight: 700; color: var(--rdt-muted); margin-right: 3px; }
.rm-kpi .rm-hint { color: var(--rdt-muted); font-size: 12px; margin-top: 2px; }
a.card.rm-kpi-link { text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.card.rm-kpi-link:hover { border-color: rgba(var(--rdt-sea-rgb), .45); box-shadow: 0 4px 14px rgba(16, 48, 58, .08); transform: translateY(-1px); }

/* Tables inside list cards */
.rm-table { margin-bottom: 0; }
.rm-table > thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--rdt-muted); background: var(--rdt-mist); border-bottom: 1px solid var(--rdt-line); padding: 10px 14px; }
.rm-table > tbody td { padding: 12px 14px; border-color: var(--rdt-line); }
.rm-table > tbody tr:last-child td { border-bottom: 0; }
.rm-table .rm-sub { display: block; color: var(--rdt-muted); font-size: 12px; margin-top: 1px; }
.rm-table a.rm-strong { font-weight: 700; color: var(--rdt-text); }
.rm-table a.rm-strong:hover { color: var(--rdt-sea); }

/* Soft status pills */
.rm-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.rm-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rm-pill.ok { background: rgba(16, 185, 129, .12); color: #047857; }
.rm-pill.warn { background: rgba(245, 158, 11, .15); color: #b45309; }
.rm-pill.bad { background: rgba(239, 68, 68, .12); color: #b91c1c; }
.rm-pill.muted { background: var(--rdt-mist); color: var(--rdt-muted); }
.rm-pill.info { background: rgba(var(--rdt-sea-rgb), .1); color: var(--rdt-sea); }

/* Empty state */
.rm-empty { text-align: center; padding: 48px 20px; }
.rm-empty .rm-empty-ico { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 30px; background: var(--rdt-mist); color: var(--rdt-muted); }
.rm-empty h6 { font-weight: 700; margin-bottom: 4px; }
.rm-empty p { color: var(--rdt-muted); margin-bottom: 16px; }

[data-bs-theme=dark] .rm-table > thead th { background: rgba(255, 255, 255, .03); }
[data-bs-theme=dark] .rm-tab .rm-count, [data-bs-theme=dark] .rm-pill.muted, [data-bs-theme=dark] .rm-empty .rm-empty-ico { background: rgba(255, 255, 255, .06); }

/* ---- phones: nothing wider than the screen ------------------------------------------------------
   Plain tables scroll sideways inside their card, button rows wrap, long words break. */
@media (max-width: 767.98px) {
    .page-content .card-body > table.table,
    .page-content .card > table.table,
    .page-content .card-body > form > table.table,
    .page-content .card-body.p-0 > table.table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .page-content .d-flex { flex-wrap: wrap; row-gap: .5rem; }
    .page-content .card-body { overflow-wrap: break-word; }
    .page-content .table th { min-width: 90px; }
    .page-content .form-control, .page-content .form-select { font-size: 16px; }
    .page-content .btn { white-space: normal; }
    /* Go-live guide: contents above the steps instead of beside them */
    .gl-layout { grid-template-columns: minmax(0, 1fr) !important; }
    .gl-toc { position: static !important; }
}
@media (max-width: 767.98px) {
    .page-content code, .page-content pre { white-space: pre-wrap; word-break: break-all; }
}

/* login page: below laptop width the picture is hidden; the form stays a comfortable width, centred */
@media (max-width: 991.98px) {
    .auth-full-page-content .w-100 { max-width: 440px; margin-left: auto; margin-right: auto; }
}
