/*
 * Modern theme layer for the AdminLTE 2 / Bootstrap 3 markup.
 * Loaded after AdminLTE and its skins (templates/partials/theme.php), so it only
 * restyles: markup, ids and classes the page scripts rely on are unchanged.
 * Never set `display` on elements that page scripts show and hide
 * (toasts, the cashier form groups), except the initial `none` of toasts.
 */

:root {
  --app-bg: #f4f6fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e5e7eb;
  --border-soft: #eef0f4;
  --text: #0f172a;
  --text-muted: #64748b;

  --sidebar-bg: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #94a3b8;

  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --accent-ring: rgba(79, 70, 229, 0.18);

  --success: #16a34a;
  --success-hover: #15803d;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warning: #d97706;
  --warning-hover: #b45309;
  --info: #0284c7;
  --info-hover: #0369a1;

  --radius-sm: 8px;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.07);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.18);

  --topbar-height: 56px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */

body,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.main-header .logo,
.btn,
.form-control {
  font-family: var(--font);
}

body {
  color: var(--text);
  background: var(--app-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover, a:focus { color: var(--accent-hover); }

.skin-blue .wrapper,
.wrapper {
  background: var(--app-bg);
}

/* ---------- Top bar ---------- */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  max-height: none;
}

.skin-blue .main-header .logo,
.skin-blue .main-header .logo:hover {
  background: var(--sidebar-bg);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 0;
}

.main-header .logo {
  height: var(--topbar-height);
  line-height: var(--topbar-height);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.main-header .logo .logo-lg b { font-weight: 700; }

.skin-blue .main-header .navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: var(--topbar-height);
}

.skin-blue .main-header .navbar .sidebar-toggle {
  color: var(--text-muted);
  height: var(--topbar-height);
  line-height: calc(var(--topbar-height) - 30px);
  padding: 15px 18px;
}

.skin-blue .main-header .navbar .sidebar-toggle:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.main-header .navbar-custom-menu {
  float: right;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding-right: 16px;
}

.app-license-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

/* ---------- Sidebar ---------- */

.skin-blue .main-sidebar,
.skin-blue .left-side {
  background: var(--sidebar-bg);
}

.main-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  padding-top: var(--topbar-height);
  overflow-y: auto;
  overflow-x: hidden;
}

.main-sidebar .sidebar { padding: 12px 0 24px; }

.main-sidebar .user-panel { display: none; }

.skin-blue .sidebar a { color: var(--sidebar-text); }

.skin-blue .sidebar-menu > li > a {
  border-left: 0;
  color: var(--sidebar-text);
  font-weight: 500;
  font-size: 14px;
  padding: 10px 14px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body:not(.sidebar-collapse) .sidebar-menu > li > a {
  display: flex;
  align-items: center;
  margin: 2px 10px;
  padding-right: 32px;
  border-radius: var(--radius-sm);
  white-space: normal;
  line-height: 1.35;
}

body:not(.sidebar-collapse) .sidebar-menu > li > a > .fa { flex: 0 0 22px; }

.sidebar-menu > li > a > .fa {
  width: 22px;
  color: var(--sidebar-text-muted);
}

.skin-blue .sidebar-menu > li:hover > a,
.skin-blue .sidebar-menu > li.menu-open > a {
  background: var(--sidebar-hover);
  color: #fff;
}

.skin-blue .sidebar-menu > li.active > a {
  background: var(--sidebar-hover);
  color: #fff;
  border-left: 0;
}

.skin-blue .sidebar-menu > li.active > a > .fa,
.skin-blue .sidebar-menu > li:hover > a > .fa {
  color: #a5b4fc;
}

.skin-blue .sidebar-menu > li > .treeview-menu {
  background: transparent;
  margin: 0 10px;
  padding: 2px 0 6px;
}

.skin-blue .sidebar-menu .treeview-menu > li > a {
  color: var(--sidebar-text-muted);
  font-size: 13.5px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px 7px 18px;
  border-radius: var(--radius-sm);
  white-space: normal;
  line-height: 1.35;
}

.sidebar-menu .treeview-menu > li > a > .fa-circle-o {
  flex: 0 0 auto;
  width: auto;
  font-size: 7px;
  position: relative;
  top: -2px;
}

.skin-blue .sidebar-menu .treeview-menu > li > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.skin-blue .sidebar-menu .treeview-menu > li.active > a {
  color: #fff;
  background: var(--accent);
}

.skin-blue .sidebar-menu .treeview-menu > li.active > a .fa { color: #fff; }

/* ---------- Content area ---------- */

.content-wrapper,
.right-side {
  background: var(--app-bg);
  padding-top: var(--topbar-height);
}

.content { padding: 20px 24px; }

/* Many pages put .row straight into .content-wrapper; inset it to match .content. */
.content-wrapper > .row { margin: 12px 9px 0; }

/* <br> spacers that pages used to clear the old fixed header; the top bar now reserves its space. */
.content-wrapper > br { display: none; }

.content-header { padding: 8px 24px 0; }

/* Pages keep AdminLTE's right-panel background div, but no page has that panel;
   parked off-screen, it only widened the page on phones. */
.control-sidebar-bg { display: none; }

.content-header > h1,
.content-header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.content-header > h1 > small { color: var(--text-muted); }

/* ---------- Cards (AdminLTE boxes) ---------- */

.box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-top: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

.box.box-primary,
.box.box-info,
.box.box-danger,
.box.box-warning,
.box.box-success,
.box.box-default {
  border-top-color: var(--border-soft);
}

.box-header { padding: 16px 20px; }

.box-header.with-border { border-bottom: 1px solid var(--border-soft); }

.box-header .box-title,
.box-header > .fa + .box-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.box-body { padding: 16px 20px; }

.box-footer {
  background: var(--surface-muted);
  border-top: 1px solid var(--border-soft);
  padding: 14px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.small-box,
.info-box {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.panel {
  border-radius: var(--radius);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-card);
}

.panel-default > .panel-heading {
  background: var(--surface);
  border-color: var(--border-soft);
  border-radius: var(--radius) var(--radius) 0 0;
  font-weight: 600;
}

/* ---------- Buttons ---------- */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-width: 1px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus,
.btn:active:focus,
.btn.active:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn-sm, .btn-group-sm > .btn { padding: 5px 10px; font-size: 13px; }
.btn-lg, .btn-group-lg > .btn { padding: 11px 18px; font-size: 16px; }
.btn-xs, .btn-group-xs > .btn { padding: 2px 8px; font-size: 12px; }

.btn-default {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
  background: var(--surface-muted);
  border-color: #d1d5db;
  color: var(--text);
}

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .open > .dropdown-toggle.btn-primary {
  background: var(--accent-hover); border-color: var(--accent-hover); color: #fff;
}

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active {
  background: var(--success-hover); border-color: var(--success-hover); color: #fff;
}

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active {
  background: var(--danger-hover); border-color: var(--danger-hover); color: #fff;
}

.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active {
  background: var(--warning-hover); border-color: var(--warning-hover); color: #fff;
}

.btn-info { background: var(--info); border-color: var(--info); color: #fff; }
.btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active {
  background: var(--info-hover); border-color: var(--info-hover); color: #fff;
}

.btn-flat { box-shadow: none; }

/* ---------- Forms ---------- */

.form-control {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: none;
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.form-control,
select[multiple].form-control { height: auto; }

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.form-control[disabled],
.form-control[readonly],
fieldset[disabled] .form-control {
  background: var(--surface-muted);
  color: var(--text-muted);
}

.form-control::placeholder { color: #9ca3af; }

label,
.control-label {
  font-weight: 500;
  color: #334155;
  font-size: 13.5px;
}

.input-group .form-control:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .form-control:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-group-addon {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text-muted);
}
.input-group-addon:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-addon:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* Inputs written without .form-control (date fields, older forms) get the same look. */
.content-wrapper input[type="text"]:not(.form-control):not(.select2-search__field),
.content-wrapper input[type="number"]:not(.form-control),
.content-wrapper input[type="password"]:not(.form-control),
.content-wrapper input[type="date"]:not(.form-control),
.content-wrapper input:not([type]):not(.form-control) {
  height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  box-shadow: none;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.content-wrapper input:not(.form-control):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.content-wrapper .input-group > input:not(.form-control) {
  display: table-cell;
  float: left;
  width: 100%;
  position: relative;
  z-index: 2;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Select2 */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.select2-container--default .select2-selection--single { height: 38px; padding: 0 10px; }

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  color: var(--text);
  padding-left: 2px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; right: 6px; }

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.select2-dropdown {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: var(--accent);
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--border);
  border-radius: 6px;
}

/* Date pickers. Only the popups: the inputs also carry the `datepicker` class. */
.datepicker.dropdown-menu,
.datepicker-dropdown,
.daterangepicker {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  border-color: var(--border);
}

.datepicker table tr td.active,
.datepicker table tr td.active:hover,
.datepicker table tr td.active.active,
.daterangepicker td.active,
.daterangepicker td.active:hover {
  background: var(--accent);
  background-image: none;
  border-color: var(--accent);
}

/* ---------- Tables ---------- */

.table {
  color: var(--text);
  font-size: 14px;
  margin-bottom: 12px;
}

.table > thead > tr > th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table > thead > tr > th,
.table > tbody > tr > td,
.table > tfoot > tr > td {
  padding: 10px 12px;
}

.table > tbody > tr > td { vertical-align: middle; }

.table-bordered,
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
  border-color: var(--border-soft);
}

.table-bordered { border-radius: var(--radius-sm); }

.table-striped > tbody > tr:nth-of-type(odd) { background: #fafbfd; }

.table-hover > tbody > tr:hover { background: var(--accent-soft); }

/* DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
  color: var(--text-muted);
  font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 4px 10px;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  outline: none;
}

.dataTables_wrapper .dataTables_paginate { padding-top: 6px; }

/* Pagination */
.pagination > li > a,
.pagination > li > span {
  border-color: var(--border);
  color: var(--text);
  margin-left: 4px;
  border-radius: var(--radius-sm) !important;
  min-width: 34px;
  text-align: center;
}

.pagination > li > a:hover,
.pagination > li > span:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.pagination > .active > a,
.pagination > .active > a:hover,
.pagination > .active > a:focus,
.pagination > .active > span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination > .disabled > a,
.pagination > .disabled > span { color: #cbd5e1; }

/* ---------- Feedback ---------- */

.alert {
  border-radius: var(--radius-sm);
  border: 0;
}

.label,
.badge {
  border-radius: 999px;
  font-weight: 600;
  padding: 3px 8px;
}

.label-primary, .bg-light-blue { background-color: var(--accent) !important; }

/* ---------- Modals ---------- */

.modal-content {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.modal-header { border-bottom: 1px solid var(--border-soft); padding: 16px 20px; }
.modal-header .modal-title { font-weight: 600; }
.modal-body { padding: 18px 20px; }
.modal-footer { border-top: 1px solid var(--border-soft); padding: 14px 20px; }

.modal-backdrop.in { opacity: 0.45; }

/*
 * AJAX toasts. Pages load style/style.css after this file, so these selectors
 * carry one extra element to win. Visibility is left to jQuery fadeIn/fadeOut.
 */
body .ajax_Message,
body .ajax_Message1,
body .delete_Message,
body .note_Message {
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  opacity: 1;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  min-width: 280px;
  max-width: 92vw;
  min-height: 72px;
  z-index: 2000;
}

body .ajax_Message { background: rgba(22, 101, 52, 0.95); }
body .delete_Message { background: rgba(153, 27, 27, 0.95); }

body .ajax_Message h4,
body .ajax_Message1 h4,
body .delete_Message h4,
body .note_Message h4 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin: 6px 0;
}

/* ---------- Footer ---------- */

.main-footer {
  background: transparent;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 14px 24px;
}

/* ---------- Older page markup ----------
 * About 80 pages share these layouts but write them loosely: field rows
 * without .form-horizontal, tables straight inside cards, <br> spacers.
 * These rules give them the look of the well-formed pages.
 */

/* Field rows outside .form-horizontal: label | field, like the horizontal forms. */
.box form:not(.form-horizontal) .form-group,
.box .form-inline:not(.dataTables_wrapper) {
  margin-bottom: 15px;
}

@media (min-width: 768px) {
  .box form:not(.form-horizontal) .form-group,
  .box .form-inline:not(.dataTables_wrapper) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 10px;
  }

  .box form:not(.form-horizontal) .form-group > label,
  .box .form-inline:not(.dataTables_wrapper) > label {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
    width: auto;
    float: none;
    margin: 0;
    padding: 0 15px 0 0;
    text-align: right;
  }

  .box form:not(.form-horizontal) .form-group > [class*="col-"]:not(label),
  .box .form-inline:not(.dataTables_wrapper) > [class*="col-"]:not(label) {
    flex: 0 1 50%;
    max-width: 50%;
    width: auto;
    float: none;
    padding: 0 15px;
  }

  .box form:not(.form-horizontal) .form-group > .input-group,
  .box .form-inline:not(.dataTables_wrapper) > .input-group {
    flex: 0 1 calc(50% - 30px);
    max-width: calc(50% - 30px);
    margin: 0 15px;
  }

  .box form:not(.form-horizontal) .form-group > .form-control,
  .box form:not(.form-horizontal) .form-group > .select2-container {
    flex: 0 1 calc(50% - 30px);
    max-width: calc(50% - 30px);
    margin: 0 15px;
  }

  .box form:not(.form-horizontal) .form-group > .btn { margin-left: 15px; }

  /* Inside .form-horizontal, match its rows (which have -15px gutters). */
  .box .form-horizontal .form-inline:not(.dataTables_wrapper) { margin-left: -15px; margin-right: -15px; }
  .box .form-horizontal .form-inline:not(.dataTables_wrapper) > label { padding-left: 15px; }

  /* Bootstrap widens the icon cell in .form-inline input groups; keep it compact. */
  .box .form-inline:not(.dataTables_wrapper) .input-group-addon { width: 1%; }
}

/* Phones: label above a full-width field, aligned with the card padding. */
@media (max-width: 767px) {
  .box form:not(.form-horizontal) .form-group > [class*="col-"],
  .box .form-inline:not(.dataTables_wrapper) > [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
  }

  .box .form-inline:not(.dataTables_wrapper) .input-group { display: table; width: 100%; }

  .box .form-group > .btn,
  .box .form-group > [class*="col-"] > .btn { margin-top: 4px; }
}

/* <br> spacers once used to clear floated columns; the rows above space themselves. */
.box > br,
.box form > br,
.box form .box-body > br { display: none; }

/* Wide tables scroll inside their card instead of overflowing the page.
   DataTables puts each table in .row > .col-sm-12; js/modern-theme.js wraps the rest. */
.dataTables_wrapper > .row > .col-sm-12,
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll { margin-bottom: 12px; }
.table-scroll > .table { margin-bottom: 0; }

.dataTables_wrapper .table > tbody > tr > td,
.table-scroll > .table > tbody > tr > td { white-space: nowrap; }

.dataTables_wrapper .table > thead > tr > th,
.table-scroll > .table > thead > tr > th { min-width: 64px; }

/* Select-all checkbox column: narrow, without DataTables' sort arrow. */
.dataTables_wrapper .table > thead > tr > th:has(> input[type="checkbox"]),
.table-scroll > .table > thead > tr > th:has(> input[type="checkbox"]) {
  width: 44px !important;
  min-width: 0;
  padding-right: 12px;
}

.dataTables_wrapper .table > thead > tr > th:has(> input[type="checkbox"])::after { display: none; }

/* Cards whose content sits straight in a <form>, without .box-body padding. */
.box > form:not(:has(> .box-body)) { padding: 16px 20px 0; }

.box > form:not(:has(> .box-body)) > .panel-footer,
.box > form:not(:has(> .box-body)) > .box-footer { margin: 16px -20px 0; }

.box .panel-footer {
  background: var(--surface-muted);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 14px 20px;
  border-radius: 0;
}

.box > :last-child > .panel-footer:last-child,
.box > .panel-footer:last-child {
  border-bottom: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Totals printed as headings under a table (cashier pages): show them as tiles. */
.box > form > h3 {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 12px 8px 0 0;
  padding: 10px 14px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* Card titles written as a bare heading (home page statistics). */
.box > h4:first-child {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

/* ---------- Auth and licence pages ---------- */

.auth-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 110%, #dbeafe 0%, transparent 55%),
    var(--app-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06);
  padding: 32px;
}

.auth-card-wide { max-width: 560px; }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.auth-card .form-group { margin-bottom: 16px; }

.auth-card .box-body { padding: 0; }

.auth-card .btn-block { padding: 10px 14px; font-size: 15px; }

.auth-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  font-size: 13.5px;
}

.auth-alert {
  background: #fef2f2;
  color: #991b1b;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-contact {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: #334155;
  margin-bottom: 20px;
}

.auth-contact p { margin: 2px 0; }

/* Two fields side by side (registration), stacked on phones. */
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

@media (max-width: 480px) {
  .auth-row { grid-template-columns: 1fr; }
}

.auth-steps { padding-left: 20px; margin: 0 0 20px; color: #334155; font-size: 14px; }
.auth-steps li { margin-bottom: 6px; }

.auth-links span { color: var(--text-muted); }

/* Honeypot: invisible to people, filled in by bots. */
.auth-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.auth-success {
  background: #f0fdf4;
  color: #166534;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 0 20px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}

/* ---------- Licence payment (muddat.php) ---------- */

.pay-form { margin-bottom: 20px; }

.pay-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.pay-plan {
  position: relative;
  display: block;
  margin: 0;
  font-weight: 400;
  cursor: pointer;
}

.pay-plan input {
  position: absolute;
  opacity: 0;
}

.pay-plan-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.pay-plan:hover .pay-plan-body { border-color: #c7d2fe; }

.pay-plan input:checked + .pay-plan-body {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.pay-plan input:focus-visible + .pay-plan-body { outline: 2px solid var(--accent); outline-offset: 2px; }

.pay-plan-months { font-weight: 600; color: var(--text); }

.pay-plan-price { font-size: 13px; color: var(--text-muted); }

.pay-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pay-btn {
  flex: 1 1 180px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  border: 0;
  border-radius: var(--radius-sm);
}

.pay-btn:hover,
.pay-btn:focus { color: #fff; }

.pay-btn-click { background: #0a5cff; }
.pay-btn-click:hover { background: #084bd1; }

.pay-btn-payme { background: #0f8f8f; }
.pay-btn-payme:hover { background: #0c7474; }

.pay-btn-card { background: var(--accent); }
.pay-btn-card:hover { background: var(--accent-hover); }

/* ---------- Card transfer (payment/card.php) ---------- */

.card-pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.card-pay-label {
  width: 56px;
  flex: none;
  font-size: 13px;
  color: var(--text-muted);
}

.card-pay-value {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.card-pay-amount { font-size: 22px; color: var(--accent); }

.card-pay-muted { font-size: 14px; font-weight: 500; color: #334155; letter-spacing: 0; }

.card-pay-row + .auth-alert { margin-top: 16px; }

.card-pay-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 20px;
}

.card-pay-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: card-pay-spin 0.9s linear infinite;
}

@keyframes card-pay-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .card-pay-spinner { animation: none; }
}

/* ---------- Payments admin (payment/admin.php) ---------- */

.pay-admin {
  background: var(--app-bg);
  padding: 24px 16px;
}

.pay-admin > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

.pay-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.pay-admin-head .auth-title { margin: 0; }

.pay-admin-head a { margin-left: auto; }

.pay-admin-box {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.pay-admin-box h2 { font-size: 17px; font-weight: 600; margin: 0 0 12px; }

.pay-admin-box .table { margin-bottom: 0; font-size: 13.5px; }

.pay-admin-box small { display: block; }

.pay-admin-confirm { display: flex; gap: 6px; }

.pay-admin-confirm select { width: auto; max-width: 180px; }

.pay-sms-body { max-width: 420px; white-space: pre-wrap; word-break: break-word; }

.pay-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.pay-status-paid,
.pay-status-matched { background: #dcfce7; color: #166534; }

.pay-status-pending,
.pay-status-unmatched { background: #fef3c7; color: #92400e; }

.pay-status-cancelled { background: #fee2e2; color: #991b1b; }

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
  .main-header .logo { display: none; }

  .main-header .navbar { margin: 0; }

  .main-sidebar { padding-top: var(--topbar-height); }

  /* 15px matches the -15px gutters of Bootstrap rows, so nothing pokes past the screen edge. */
  .content,
  .content-header { padding-left: 15px; padding-right: 15px; }

  .content-wrapper > .row { margin: 8px 0 0; }

  .app-license-badge { font-size: 12px; padding: 5px 10px; }

  /* "Foydalanish muddati:" is dropped on phones; the icon and date remain. */
  .app-license-label { display: none; }

  /* The menu slides over the page with a dimmed backdrop instead of pushing it
     aside. AdminLTE closes the menu when the page (the backdrop) is tapped. */
  .sidebar-open .content-wrapper,
  .sidebar-open .main-footer { transform: none; }

  .main-sidebar { width: 264px; transform: translate(-264px, 0); }
  .sidebar-open .main-sidebar { box-shadow: var(--shadow-pop); }

  .content-wrapper::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 805;
  }

  .sidebar-open .content-wrapper::before { opacity: 1; pointer-events: auto; }

  .auth-card { padding: 24px 20px; }

  .box-header,
  .box-body,
  .box-footer,
  .box .panel-footer { padding-left: 16px; padding-right: 16px; }

  .box > form:not(:has(> .box-body)) { padding-left: 16px; padding-right: 16px; }

  .box > form:not(:has(> .box-body)) > .panel-footer,
  .box > form:not(:has(> .box-body)) > .box-footer { margin-left: -16px; margin-right: -16px; }

  .box > h4:first-child { padding-left: 16px; padding-right: 16px; }

  /* DataTables controls: left-aligned, search field full width. */
  div.dataTables_wrapper div.dataTables_length,
  div.dataTables_wrapper div.dataTables_filter { text-align: left; }

  div.dataTables_wrapper div.dataTables_filter { margin-top: 8px; }

  div.dataTables_wrapper div.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  div.dataTables_wrapper div.dataTables_filter input { flex: 1; width: auto; margin-left: 0; }

  .dataTables_wrapper .dataTables_info { padding-top: 10px; }

  .pagination > li > a,
  .pagination > li > span { min-width: 32px; padding: 5px 9px; margin-left: 3px; }

  .box > form > h3 { display: flex; margin-right: 0; }
}

/* Auth pages do not load style/style.css; give their toasts the same initial state. */
.auth-page .ajax_Message,
.auth-page .delete_Message,
.auth-page .note_Message {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 400px;
  height: 110px;
  margin: auto;
  padding: 1.5em;
}

/* ---------- Assistant chat (templates/partials/assistant.php, static/js/assistant.js) ---------- */

.assistant-panel[hidden],
.assistant-chips[hidden] { display: none !important; }

.assistant-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1035;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35), 0 2px 6px rgba(15, 23, 42, 0.12);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.assistant-fab .fa { font-size: 18px; }
.assistant-fab:hover { background: var(--accent-hover); }
.assistant-fab:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.assistant.is-open .assistant-fab { transform: scale(0.92); }

.assistant-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 1040;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: min(620px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}

.assistant-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
}

.assistant-title { flex: 1; min-width: 0; line-height: 1.25; }
.assistant-title strong { display: block; font-size: 15px; color: var(--text); }
.assistant-title small { color: var(--text-muted); font-size: 12px; }

.assistant-icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
}

.assistant-icon-btn:hover { background: var(--surface-muted); color: var(--text); }

.assistant-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--app-bg);
  -webkit-overflow-scrolling: touch;
}

.assistant-msg { display: flex; margin-bottom: 10px; }
.assistant-msg-me { justify-content: flex-end; }

.assistant-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.assistant-msg-me .assistant-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.assistant-msg-bot .assistant-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 4px;
  min-width: 0;
}

.assistant-text { margin: 0 0 8px; white-space: pre-line; }
.assistant-bubble > :last-child { margin-bottom: 0; }

.assistant-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.assistant-stat {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
}

.assistant-stat-label { display: block; font-size: 11.5px; color: var(--text-muted); }
.assistant-stat-value { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }

.assistant-table {
  overflow-x: auto;
  margin-bottom: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.assistant-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

.assistant-table th {
  background: var(--surface-muted);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  padding: 6px 8px;
}

.assistant-table td {
  padding: 6px 8px;
  border-top: 1px solid var(--border-soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.assistant-links { display: flex; flex-wrap: wrap; gap: 6px; }

.assistant-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.assistant-confirm {
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.assistant-confirm-title { display: block; margin-bottom: 6px; }

.assistant-confirm dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  margin: 0 0 10px;
  font-size: 13.5px;
}

.assistant-confirm dt { color: var(--text-muted); font-weight: 500; }
.assistant-confirm dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.assistant-confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.assistant-confirm-state { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.assistant-typing .assistant-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }

.assistant-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: assistant-dot 1s infinite ease-in-out;
}

.assistant-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes assistant-dot {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.assistant-chips {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
  scrollbar-width: thin;
}

.assistant-chip {
  flex: none;
  padding: 6px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.assistant-chip:hover { background: var(--accent-soft); }

.assistant-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}

.assistant-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 15px;
  color: var(--text);
}

.assistant-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.assistant-send {
  flex: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.assistant-send:hover { background: var(--accent-hover); }

@media (max-width: 767px) {
  /* Keep the last content row clear of the floating button. */
  .content-wrapper { padding-bottom: 64px; }

  .assistant-fab { right: 14px; bottom: 14px; height: 52px; padding: 0 16px; }
  .assistant-fab-label { display: none; }

  /* Full screen on phones; dvh follows the on-screen keyboard. */
  .assistant-panel {
    inset: 0;
    width: auto;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .assistant.is-open .assistant-fab { display: none; }

  .assistant-input { font-size: 16px; } /* no zoom-in on iOS */
}

@media (prefers-reduced-motion: reduce) {
  .assistant-typing span { animation: none; }
}

/* ---------- Public landing page (landing.php) ---------- */

.lp { background: var(--surface); color: var(--text); }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.lp-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.lp-nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}

.lp-brand:hover, .lp-brand:focus { color: var(--text); text-decoration: none; }
.lp-brand .auth-brand-mark { width: 32px; height: 32px; font-size: 15px; }

.lp-nav-links { display: flex; gap: 20px; margin-right: auto; }
.lp-nav-links a { color: var(--text-muted); font-weight: 500; }
.lp-nav-links a:hover { color: var(--text); text-decoration: none; }
.lp-nav-actions { display: flex; gap: 8px; }

.lp-hero {
  padding: 72px 0 64px;
  background:
    radial-gradient(900px 500px at 85% -10%, #e0e7ff 0%, transparent 60%),
    radial-gradient(700px 400px at -10% 110%, #dbeafe 0%, transparent 55%),
    var(--surface);
}

.lp-hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }

.lp-eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.lp h1 {
  margin: 0 0 16px;
  font-size: 46px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.lp-lead { font-size: 18px; line-height: 1.6; color: #334155; margin: 0 0 28px; max-width: 560px; }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.lp-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-muted); font-size: 14px; }
.lp-checks .fa { color: var(--success); margin-right: 4px; }

.lp-hero-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  padding: 20px;
}

/* Demo video in place of the card (index.php, static/video). */
.lp-hero-video { min-width: 0; }
.lp-hero-video video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0f172a;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}
.lp-hero-video p { margin: 12px 0 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.lp-hero-video .fa { color: var(--accent); margin-right: 4px; }

.lp-mock-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.lp-mock-head span { color: var(--text-muted); font-size: 13px; }
.lp-mock-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }

.lp-mock-stats div {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
}

.lp-mock-stats span { display: block; font-size: 12px; color: var(--text-muted); }
.lp-mock-stats strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.lp-mock-rows div { display: flex; justify-content: space-between; padding: 9px 2px; border-top: 1px solid var(--border-soft); font-size: 14px; }
.lp-mock-rows b { font-variant-numeric: tabular-nums; }

.lp-section { padding: 72px 0; }
.lp-muted { background: var(--app-bg); }
.lp h2 { margin: 0 0 10px; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.lp-section-lead { color: var(--text-muted); font-size: 17px; margin: 0 0 32px; max-width: 640px; }

.lp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.lp-features article {
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.lp-features .fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 12px;
}

.lp-features h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; }
.lp-features p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }

.lp-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 36px; }

.lp-tags span {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
}

.lp-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-steps li { counter-increment: step; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-soft); }

.lp-steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}

.lp-steps strong { display: block; margin-bottom: 4px; }
.lp-steps span { color: var(--text-muted); font-size: 14px; }

.lp-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }

.lp-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.lp-plan-featured {
  border: 2px solid var(--accent);
  box-shadow: 0 20px 50px rgba(79, 70, 229, 0.16);
}

.lp-plan-badge {
  position: absolute;
  top: -13px;
  left: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.lp-plan-name { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
.lp-plan-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lp-price-sum { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lp-price-unit { color: var(--text-muted); }
.lp-plan-desc { color: #334155; margin: 0; }

.lp-plan-bonus {
  align-self: flex-start;
  margin: 0;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: #ecfdf5;
  color: var(--success-hover);
  font-weight: 600;
  font-size: 14px;
}
.lp-plan-bonus .fa { margin-right: 4px; }

/* The button sits at the bottom so the three cards line up. */
.lp-plan .lp-checks { flex-direction: column; margin: 18px 0 24px; flex: 1; }
.lp-plan .btn { margin-top: auto; }

.lp-faq details { max-width: 760px; }
.lp-faq h2 { margin-bottom: 20px; }

.lp-faq details {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  padding: 14px 18px;
}

.lp-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.lp-faq details p { margin: 10px 0 0; color: #334155; line-height: 1.6; }

.lp-footer { padding: 28px 0; border-top: 1px solid var(--border-soft); color: var(--text-muted); font-size: 14px; }
.lp-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.lp-contacts { display: flex; gap: 18px; }
.lp-contacts a { color: var(--text); font-weight: 500; }

@media (max-width: 991px) {
  .lp-hero-inner { grid-template-columns: 1fr; }
  .lp-features { grid-template-columns: repeat(2, 1fr); }
  .lp-plans { grid-template-columns: 1fr; max-width: 480px; gap: 28px; }
}

@media (max-width: 767px) {
  .lp-nav-links { display: none; }
  .lp-nav-actions { margin-left: auto; }
  .lp-nav-actions .btn-default { display: none; }
  .lp-hero { padding: 40px 0 44px; }
  .lp h1 { font-size: 32px; }
  .lp-lead { font-size: 16px; }
  .lp h2 { font-size: 26px; }
  .lp-section { padding: 48px 0; }
  .lp-features, .lp-steps { grid-template-columns: 1fr; }
  .lp-cta .btn { flex: 1 1 100%; }
}

/* ---------- Telegram (telegram.php, js/telegram-share.js, Yordamchi) ---------- */
.assistant-tg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: #229ed9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.assistant-tg:hover:not(:disabled) { background: #e8f6fd; border-color: #229ed9; }
.assistant-tg:disabled { color: var(--text-muted); cursor: default; }

.tg-share-btn { margin-top: 8px; color: #229ed9; font-weight: 600; }
.tg-share-btn .fa { font-size: 15px; }

.tg-page .box-title .fa { color: #229ed9; }
.tg-examples { padding-left: 18px; margin-bottom: 12px; }
.tg-examples li { margin-bottom: 4px; }
.tg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tg-link-steps { margin-top: 14px; }
.tg-link-steps .btn { margin-bottom: 10px; }
.tg-code {
  display: inline-block;
  margin: 2px 0 8px;
  padding: 6px 10px;
  font-size: 16px;
  letter-spacing: 1px;
  user-select: all;
}
.tg-recipients { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.tg-recipient { font-weight: 500; margin: 0; }
.tg-recipient small { display: inline; }
.tg-result { margin-left: 10px; font-weight: 500; }
.tg-hint { margin: 12px 0 0; font-size: 12.5px; }

/* ---------- Superadmin (superadmin/index.php) ---------- */
.pay-admin-head a + a { margin-left: 16px; }
.sa-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.sa-facts dt { font-weight: 600; color: var(--text-muted); }
.sa-facts dd { margin: 0; word-break: break-all; }
.sa-facts dd small { display: inline; }
.sa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.sa-actions form { margin: 0; }
.sa-sub { font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.sa-steps { padding-left: 20px; }
.sa-steps li { margin-bottom: 4px; }
.sa-token-form { display: flex; gap: 8px; max-width: 620px; }
.sa-token-form .form-control { flex: 1; }
.sa-note { margin: 10px 0 0; font-size: 12.5px; }
.sa-broadcast { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }
.sa-broadcast select { max-width: 360px; }
.sa-broadcast .btn { align-self: flex-start; }
.sa-log td { font-size: 12.5px; }
@media (max-width: 767px) {
  .sa-facts { grid-template-columns: 1fr; gap: 2px; }
  .sa-facts dd { margin-bottom: 8px; }
  .sa-token-form { flex-direction: column; }
}
/* The message form: label above a full-width box (not the label-beside-field layout of data forms). */
@media (min-width: 768px) {
  .tg-page .box form .form-group { display: block; }
  .tg-page .box form .form-group > label { display: block; max-width: none; text-align: left; padding: 0; margin: 0 0 6px; }
  .tg-page .box form .form-group > .form-control { max-width: none; margin: 0; }
}

/* =====================================================================
   UI v2: brand, page title, user menu, dashboard, tables, chips
   ===================================================================== */

/* ---------- Brand (sidebar top) ---------- */
.main-header .logo .logo-lg {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 0 4px;
  text-align: left;
}
.app-brand-mark {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  font-size: 16px;
}
.app-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.app-brand-text b { font-size: 15px; font-weight: 700; color: #fff; }
.app-brand-text small {
  font-size: 12px;
  font-weight: 500;
  color: var(--sidebar-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Page title in the top bar ---------- */
.app-page-title {
  float: left;
  height: var(--topbar-height);
  line-height: var(--topbar-height);
  margin-left: 4px;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- Licence badge and user menu ---------- */
.main-header .navbar-custom-menu { gap: 10px; }
.app-license-badge.is-soon { background: #fff7ed; color: var(--warning); }
.app-user { position: relative; }
.app-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  line-height: 1.15;
}
.app-user-btn:hover, .app-user.open .app-user-btn { border-color: #c7d2fe; background: var(--accent-soft); }
.app-user-btn .fa-angle-down { color: var(--text-muted); }
.app-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.app-user-text { display: flex; flex-direction: column; text-align: left; }
.app-user-text b { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user-text small { font-size: 11.5px; color: var(--text-muted); }
.app-user .dropdown-menu {
  margin-top: 8px;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.app-user .dropdown-menu > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
}
.app-user .dropdown-menu > li > a .fa { width: 16px; color: var(--text-muted); text-align: center; }
.app-user .dropdown-menu > li > a:hover { background: var(--accent-soft); color: var(--accent); }
.app-user .dropdown-menu > li > a:hover .fa { color: var(--accent); }
.app-user .dropdown-menu .divider { margin: 6px 0; background: var(--border-soft); }
.app-user-head { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.app-user-head small { color: var(--text-muted); }

/* ---------- Dashboard (templates/partials/dashboard.php) ---------- */
.app-dash { margin-bottom: 4px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.dash-hello { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.dash-sub { margin: 4px 0 0; color: var(--text-muted); font-size: 14px; }

.dash-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.dash-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  color: var(--text);
}
.dash-kpi.is-link:hover { border-color: #c7d2fe; color: var(--text); transform: translateY(-1px); }
.dash-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 6px;
}
.dash-kpi-icon.is-blue { background: #e0f2fe; color: #0284c7; }
.dash-kpi-icon.is-green { background: #dcfce7; color: #16a34a; }
.dash-kpi-icon.is-violet { background: #ede9fe; color: #7c3aed; }
.dash-kpi-icon.is-amber { background: #fef3c7; color: #d97706; }
.dash-kpi-icon.is-rose { background: #ffe4e6; color: #e11d48; }
.dash-kpi-icon.is-slate { background: #e2e8f0; color: #334155; }
.dash-kpi-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.dash-kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.dash-kpi-value small { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.dash-kpi-note { font-size: 12.5px; color: var(--text-muted); }
.dash-warn { color: var(--warning); font-weight: 600; }
.dash-bad { color: var(--danger); font-weight: 600; }

.dash-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.dash-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}
.dash-action .fa {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
}
.dash-action:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.dash-grid > .box { margin-bottom: 0; }
.dash-bars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 4px; }
.dash-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.dash-bar-value { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dash-bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--surface-muted); border-radius: 8px; overflow: hidden; }
.dash-bar-fill { display: block; width: 100%; background: linear-gradient(180deg, #a5b4fc, #6366f1); border-radius: 8px 8px 0 0; }
.dash-bar.is-today .dash-bar-fill { background: linear-gradient(180deg, #818cf8, #4338ca); }
.dash-bar.is-today .dash-bar-day { color: var(--accent); font-weight: 700; }
.dash-bar-day { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.2; }
.dash-bar-day small { display: block; font-size: 10.5px; }

.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list-main { display: flex; flex-direction: column; min-width: 0; }
.dash-list-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list-main small, .dash-list-sum small { color: var(--text-muted); font-size: 12px; }
.dash-list-sum { display: flex; flex-direction: column; align-items: flex-end; font-weight: 700; white-space: nowrap; }
.dash-empty { margin: 30px 0; text-align: center; color: var(--text-muted); }
.dash-empty .fa { display: block; font-size: 28px; margin-bottom: 8px; opacity: 0.6; }
.dash-section { margin: 26px 0 12px; font-size: 17px; font-weight: 700; color: var(--text); }
.app-dash .box h4 { margin: 16px 18px 4px; font-size: 15px; font-weight: 600; text-align: left !important; }
.app-empty-row td { text-align: center; color: var(--text-muted); padding: 18px !important; }

/* ---------- Table controls (Uzbek labels set in templates/partials/scripts.php) ---------- */
.dataTables_wrapper .dataTables_filter label { position: relative; }
.dataTables_wrapper .dataTables_filter input { min-width: 220px; padding-left: 34px; margin-left: 0; }
.dataTables_wrapper .dataTables_filter label::before {
  content: "\f002";
  font-family: FontAwesome;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}
.dataTables_wrapper .dataTables_info { color: var(--text-muted); font-size: 13px; }
.dataTables_empty { padding: 26px !important; color: var(--text-muted); }

/* ---------- Stock categories (Ombor): chips instead of red buttons ---------- */
.content-wrapper a.btn.btn-danger[href*="ovqatturi="] {
  margin: 0 8px 10px 0 !important;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
}
.content-wrapper a.btn.btn-danger[href*="ovqatturi="]:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 1199px) {
  .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Phones ---------- */
@media (max-width: 767px) {
  .app-page-title { max-width: 38vw; font-size: 15px; }
  .app-user-text, .app-user-btn .fa-angle-down { display: none; }
  .app-user-btn { padding: 3px; }
  .main-header .navbar-custom-menu { gap: 6px; padding-right: 10px; }
  .dash-hello { font-size: 20px; }
  .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dash-kpi { padding: 12px; }
  .dash-kpi-value { font-size: 18px; }
  .dash-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-bars { height: 180px; gap: 6px; }
  .dash-bar-value { display: none; }
  .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; }
}

/* ---------- Totals ("Jami ...: n" lines, laid out by static/js/modern-theme.js) ---------- */
.app-totals {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.app-totals > .app-total {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 14px 16px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
}
.app-total-label { color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.app-total-value { color: var(--text); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.app-total.is-positive .app-total-value { color: var(--success); }
.app-total.is-negative .app-total-value { color: var(--danger); }
.app-total.is-debt .app-total-value { color: var(--warning); }
.app-totals + hr, hr:has(+ .app-totals) { display: none; }
@media (max-width: 767px) {
  .app-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .app-total-value { font-size: 16px; }
}

/* Telegram share button in the top bar (static/js/telegram-share.js). */
.tg-share-btn.in-topbar { margin: 0; border-radius: 999px; padding: 6px 12px; }
@media (max-width: 767px) { .tg-share-btn.in-topbar span { display: none; } .tg-share-btn.in-topbar { padding: 6px 10px; } }

/* Top bar as one row: the title shrinks (with ...) instead of pushing the right side onto a second line. */
.main-header .navbar { display: flex; align-items: center; }
.main-header .navbar > .sidebar-toggle, .main-header .navbar > .app-page-title { float: none; flex: 0 0 auto; }
.main-header .navbar > .app-page-title { flex: 1 1 auto; min-width: 0; max-width: none; }
.main-header .navbar > .navbar-custom-menu { float: none; flex: 0 0 auto; margin-left: auto; }
.app-user-head .app-user-license { margin-top: 4px; font-size: 12px; color: var(--accent); }
@media (max-width: 480px) { .app-license-badge { display: none; } }
