/*
 * Riseax ADMIN design system — tokens + theme overrides.
 * Loaded only by the admin layouts (default_layout_dashboard, default_layout, sign_in, forgot_password),
 * after the theme bundle. The customer site has its own assets and never loads this file.
 * The theme root stays at 13px (1rem), so rem-based spacing is unchanged; sizes below are set in px.
 */
:root {
	--admin-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

	--admin-text-primary: #1F2937;
	--admin-text-secondary: #4B5563;
	--admin-text-muted: #6B7280;
	--admin-text-disabled: #9CA3AF;

	--admin-font-xs: 13px;   /* badges, column headers, small labels */
	--admin-font-sm: 14px;   /* labels, secondary text, table text */
	--admin-font-base: 15px; /* content text: body, inputs, buttons */
	--admin-font-md: 16px;   /* card headings */
	--admin-font-lg: 18px;   /* section headings */
	--admin-font-xl: 22px;   /* page title */

	--admin-weight-regular: 400;
	--admin-weight-medium: 500;
	--admin-weight-semibold: 600;
	--admin-weight-bold: 700;

	--admin-radius-sm: 6px;
	--admin-radius-md: 8px;
	--admin-radius-lg: 12px;

	--admin-space-1: 4px;
	--admin-space-2: 8px;
	--admin-space-3: 12px;
	--admin-space-4: 16px;
	--admin-space-5: 20px;
	--admin-space-6: 24px;
	--admin-space-8: 32px;

	--admin-border: #E5E7EB;
	--admin-border-subtle: #EEF0F4;
	--admin-shadow-card: 0 1px 2px rgba(16, 24, 40, .04);

	/* Theme (Bootstrap) variables point at the admin tokens */
	--bs-font-sans-serif: var(--admin-font-family);
	--bs-body-font-family: var(--admin-font-family);
	--bs-body-font-size: var(--admin-font-base);
	--bs-body-color: var(--admin-text-primary);
}

/* ---------- Font: Inter everywhere ---------- */
html, body, button, input, select, textarea, optgroup, .swal2-popup, .swal2-title, .swal2-html-container,
.tooltip, .popover, .dropdown-menu, .menu, .apexcharts-canvas, .apexcharts-text, .apexcharts-legend-text, .apexcharts-tooltip {
	font-family: var(--admin-font-family) !important;
}
body { font-size: var(--admin-font-base); color: var(--admin-text-primary); font-weight: var(--admin-weight-regular); }

/* ---------- Type scale (theme utility classes) ---------- */
h1, .h1 { font-size: var(--admin-font-xl); font-weight: var(--admin-weight-semibold); }
h2, .h2 { font-size: 20px; font-weight: var(--admin-weight-semibold); }
h3, .h3 { font-size: var(--admin-font-lg); font-weight: var(--admin-weight-semibold); }
h4, .h4 { font-size: var(--admin-font-md); font-weight: var(--admin-weight-semibold); }
h5, .h5, h6, .h6 { font-size: var(--admin-font-base); font-weight: var(--admin-weight-semibold); }
.fs-1 { font-size: var(--admin-font-xl) !important; }
.fs-2 { font-size: 20px !important; }
.fs-3 { font-size: var(--admin-font-lg) !important; }
.fs-4 { font-size: var(--admin-font-md) !important; }
.fs-5 { font-size: 15px !important; }
.fs-6 { font-size: var(--admin-font-base) !important; }
.fs-7 { font-size: var(--admin-font-base) !important; }
.fs-8, .fs-9, small, .small { font-size: var(--admin-font-xs) !important; }
.fw-boldest { font-weight: var(--admin-weight-bold) !important; }
.fw-bolder  { font-weight: var(--admin-weight-semibold) !important; }
.fw-bold    { font-weight: var(--admin-weight-medium) !important; }

/* ---------- Text colours: no harsh black ---------- */
.text-dark, .text-gray-900, .text-gray-800, .text-black { color: var(--admin-text-primary) !important; }
.text-gray-700 { color: var(--admin-text-secondary) !important; }
.text-gray-600, .text-muted { color: var(--admin-text-muted) !important; }
.text-gray-500, .text-gray-400 { color: var(--admin-text-disabled) !important; }

/* ---------- Page title in the header ---------- */
.page-title h1 { font-size: var(--admin-font-xl) !important; font-weight: var(--admin-weight-semibold) !important; color: var(--admin-text-primary) !important; }
.breadcrumb, .breadcrumb .breadcrumb-item { font-size: var(--admin-font-sm) !important; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--admin-border-subtle); border-radius: var(--admin-radius-lg); box-shadow: var(--admin-shadow-card) !important; }
.card .card-header { min-height: 56px; }
.card .card-header .card-title, .card .card-header .card-title h3, .card .card-header .card-label { font-size: var(--admin-font-md) !important; font-weight: var(--admin-weight-semibold) !important; color: var(--admin-text-primary); }

/* ---------- Buttons ---------- */
.btn { font-size: var(--admin-font-base); font-weight: var(--admin-weight-medium); border-radius: var(--admin-radius-md); }
.btn:not(.btn-icon):not(.btn-sm):not(.btn-lg):not(.btn-link) { min-height: 38px; padding: 8px 16px; }
.btn.btn-sm:not(.btn-icon) { min-height: 32px; padding: 6px 12px; font-size: var(--admin-font-sm); }
.btn.btn-lg { min-height: 40px; padding: 8px 20px; font-size: var(--admin-font-base); }

/* ---------- Forms ---------- */
.form-control, .form-select { font-size: var(--admin-font-base); font-weight: var(--admin-weight-regular); color: var(--admin-text-primary); border-radius: var(--admin-radius-md); }
input.form-control, select.form-select, select.form-control { min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.input-group-text { font-size: var(--admin-font-base); }
.input-group-sm > .input-group-text { font-size: var(--admin-font-sm); }
.form-control-sm, .form-select-sm { min-height: 32px !important; font-size: var(--admin-font-sm); }
.form-control::placeholder { color: var(--admin-text-disabled); }
.form-label, label.col-form-label, .required { font-size: var(--admin-font-sm); font-weight: var(--admin-weight-medium); color: var(--admin-text-secondary); }
.form-text, .invalid-feedback, .fv-help-block { font-size: var(--admin-font-xs); }

/* ---------- Tables ---------- */
.table { color: var(--admin-text-primary); }
.table > tbody > tr > td { font-size: var(--admin-font-sm) !important; }
#kt_content_container table td { font-size: var(--admin-font-sm); }
.table > thead > tr > th, .table thead th { font-size: var(--admin-font-xs) !important; font-weight: var(--admin-weight-semibold) !important; color: var(--admin-text-muted) !important; letter-spacing: .03em; }
.table > tbody > tr { min-height: 48px; }
/* DataTables wraps controls in Bootstrap .row (negative margins) — this caused a 10px sideways scroll on every list */
.dataTables_wrapper > .row { margin-left: 0; margin-right: 0; }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_paginate .page-link { font-size: var(--admin-font-sm) !important; color: var(--admin-text-secondary); }

/* ---------- Badges ---------- */
.badge { font-size: var(--admin-font-xs); font-weight: var(--admin-weight-semibold); border-radius: var(--admin-radius-sm); }
.status-badge { font-size: var(--admin-font-xs) !important; font-weight: var(--admin-weight-semibold) !important; }

/* ---------- Dropdowns, menus, modals, tooltips, alerts ---------- */
.menu-sub-dropdown .menu-link, .dropdown-menu .dropdown-item { font-size: var(--admin-font-sm); font-weight: var(--admin-weight-medium); }
.modal-content { border-radius: var(--admin-radius-lg); }
.modal-title { font-size: var(--admin-font-lg) !important; font-weight: var(--admin-weight-semibold) !important; }
.tooltip-inner { font-size: var(--admin-font-xs); }
.swal2-popup .swal2-title { font-size: var(--admin-font-lg) !important; font-weight: var(--admin-weight-semibold) !important; color: var(--admin-text-primary) !important; }
.swal2-popup .swal2-html-container { font-size: var(--admin-font-base) !important; color: var(--admin-text-secondary) !important; }
.alert { font-size: var(--admin-font-base); border-radius: var(--admin-radius-md); }

/* ---------- Charts / analytics ---------- */
.apexcharts-xaxis-label, .apexcharts-yaxis-label, .apexcharts-xaxis text, .apexcharts-yaxis text { font-size: var(--admin-font-xs) !important; }
.apexcharts-legend-text { font-size: var(--admin-font-sm) !important; }

/* ---------- Status badges: one look everywhere (29 Oct 2026, option D) ----------
   White pill, light grey border, dark text; the colour lives only in the dot. */
.badge[class*="badge-light"], .status-badge {
	display: inline-flex; align-items: center; gap: 6px;
	background: #fff !important; border: 1px solid #E5E7EB; color: var(--admin-text-primary) !important;
	font-weight: var(--admin-weight-semibold);
}
.badge[class*="badge-light"]::before, .status-badge::before {
	content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--rx-dot, #D0D5DD);
}
.badge.badge-light-danger, .status-refund   { --rx-dot: #D92D20; }
.badge.badge-light-warning, .status-review  { --rx-dot: #F79009; }
.badge.badge-light-success, .status-completed { --rx-dot: #12B76A; }
.badge.badge-light-info, .status-process    { --rx-dot: #7A5AF8; }
.badge.badge-light-primary                  { --rx-dot: #2E90FA; }
.badge.badge-light-dark, .status-draft      { --rx-dot: #98A2B3; }
.status-paused  { --rx-dot: #AD6A71; }
.status-limited { --rx-dot: #F97316; }

/* ---------- Light buttons: readable text (theme had yellow text on yellow, pale text on pale) ---------- */
.btn.btn-light-warning, .btn.btn-light-warning i { color: #93370D; }
.btn.btn-light-warning:hover, .btn.btn-light-warning:focus, .btn.btn-light-warning:active { color: #7A2E0E !important; background-color: #FEF0C7 !important; border-color: #FEF0C7 !important; }
.btn.btn-light-warning:hover i { color: #7A2E0E !important; }
.btn.btn-light-primary:not(:hover):not(:focus):not(:active), .btn.btn-light-primary:not(:hover) i { color: #175CD3; }
.btn.btn-light-success:not(:hover):not(:focus):not(:active), .btn.btn-light-success:not(:hover) i { color: #067647; }
.btn.btn-light-danger:not(:hover):not(:focus):not(:active), .btn.btn-light-danger:not(:hover) i { color: #B42318; }

/* ---------- Readable colours (29 Oct 2026) ----------
   Metronic's blue #009EF7 (2.9:1 on white) and green #50CD89 (2.0:1) are too pale for text and for white button labels.
   Same hues, darker: blue #175CD3 (5.9:1), hover #1849A9; green text #067647 (5.9:1); grey button text #475467. */
:root { --admin-link: #175CD3; --admin-link-hover: #1849A9; --admin-success-text: #067647; }
a { color: var(--admin-link); }
a:hover { color: var(--admin-link-hover); }
.text-primary, .link-primary { color: var(--admin-link) !important; }
.text-hover-primary:hover, .link-primary:hover { color: var(--admin-link-hover) !important; }
.text-success { color: var(--admin-success-text) !important; }
.btn.btn-primary { background-color: var(--admin-link) !important; border-color: var(--admin-link) !important; color: #fff !important; }
.btn.btn-primary:hover, .btn.btn-primary:focus, .btn.btn-primary:active, .btn.btn-primary.active { background-color: var(--admin-link-hover) !important; border-color: var(--admin-link-hover) !important; color: #fff !important; }
.btn.btn-primary i, .btn.btn-primary .svg-icon svg [fill]:not(.permanent):not(g) { color: #fff !important; }
.btn.btn-light:not(:hover):not(:focus):not(:active), .btn.btn-light:not(:hover) i { color: #475467; }
.btn.btn-light:hover, .btn.btn-light:focus { color: #1F2937 !important; background-color: #EAECF0 !important; }
.form-check-input:checked { background-color: var(--admin-link); border-color: var(--admin-link); }
.page-link { color: var(--admin-link); }
.page-item.active .page-link { background-color: var(--admin-link); border-color: var(--admin-link); }
/* One weight for every button label (was a mix of 500, 600 and 700). */
.btn, input.btn { font-weight: 600 !important; }
/* Muted and red text stay readable on tinted rows too (Metronic red #F1416C was 3.7:1). */
.text-muted { color: #596273 !important; }
.text-danger { color: #B42318 !important; }

/* Buttons stay on one line; the current page number stays readable. */
.btn { white-space: nowrap; }
.page-item.active .page-link { color: #fff !important; }
@media (max-width: 640px) { .dataTables_wrapper { overflow-x: auto; } }

/* One line spacing across the admin (30 Oct 2026): small lines 18px, main lines 20px, box numbers 24px, nothing added between. */
.dash-card-label, .dash-card-sub, .rr-tile span, .rr-tile small, .cv-tile > span, .cv-tile > small, .br-tile .br-label, .br-tile small, .br-tile .br-delta,
.cl-date, .cl-user span, .cl-sub, .cl-kw, .cl-est, .cl-lbl, .cl-pay > span, .cl-likes, .cl-notes,
.ch-line, .ch-resent, .ch-none, .dc-sub, .dc-why, .dc-fix, .dc-codes, .dc-none, .sd-muted, .sd-request, .sd-preview, .sd-title { line-height: 18px !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.dash-card-value, .rr-tile b, .cv-tile > b, .br-tile b { font-size: 18px !important; line-height: 24px !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.cl-id, .cl-user a, .cl-title, .cl-pay b, .ch-name, .ch-cust, .dc-id, .dc-title, .sd-id, .sd-cust, .sd-subject, .sd-wait { line-height: 20px !important; margin-top: 0 !important; margin-bottom: 0 !important; }
.cl-del-top, .cl-bar-row { line-height: 18px !important; }
/* Everything else follows the same scale: 13px text = 18px, 14px = 20px, 15px = 22px. Headings, buttons, tags and form fields keep their own. */
#kt_content_container *:not(h1, h2, h3, h4, h5, h6, .btn, button, .badge, .status-badge, input, select, textarea, option, svg, svg *) { line-height: round(1.4em, 2px); }
