/* =========================================================
   Info Client UI skin (aligned with Logistics style)
   ========================================================= */

:root{
  --ui-font-family: Verdana, "Segoe UI", Arial, sans-serif;
  --ui-font-weight: 400;
  --ui-results-font-weight: 500;
  --ui-results-hover-font-weight: 500;
  --ios-bg: #f5f7fb;
  --ios-bg2: #eef2f8;

  --ios-surface: rgba(255,255,255,.78);
  --ios-surface-2: rgba(255,255,255,.64);

  --ios-text: #0f172a;
  --ios-muted: #64748b;

  --ios-border: rgba(15,23,42,.10);
  --ios-border-2: rgba(15,23,42,.08);

  --ios-primary: #3b82f6;
  --ios-primary-2: #60a5fa;
  --ios-success: #22c55e;
  --ios-warning: #f59e0b;
  --ios-danger: #ef4444;

  --ios-shadow-sm: 0 6px 16px rgba(15,23,42,.08);
  --ios-shadow: 0 14px 34px rgba(15,23,42,.12);
  --ios-shadow-lg: 0 22px 60px rgba(15,23,42,.18);

  --ios-blur: blur(14px);
  --ios-radius-lg: 22px;
  --ios-radius-md: 16px;
  --ios-radius-sm: 12px;
}

html[data-theme="dark"]{
  --ios-bg: #0f172a;
  --ios-bg2: #111c31;

  --ios-surface: rgba(17, 28, 49, .70);
  --ios-surface-2: rgba(17, 28, 49, .54);

  --ios-text: rgba(255,255,255,.92);
  --ios-muted: rgba(255,255,255,.68);

  --ios-border: rgba(255,255,255,.14);
  --ios-border-2: rgba(255,255,255,.10);

  --ios-shadow-sm: 0 14px 34px rgba(0,0,0,.28);
  --ios-shadow: 0 22px 60px rgba(0,0,0,.40);
  --ios-shadow-lg: 0 28px 70px rgba(0,0,0,.46);
  color-scheme: dark;
}

html[data-font="default"]{
  --ui-font-family: Verdana, "Segoe UI", Arial, sans-serif;
  --ui-font-weight: 400;
  --ui-results-font-weight: 500;
  --ui-results-hover-font-weight: 500;
}

html[data-font="readable"]{
  --ui-font-family: Verdana, "Segoe UI", Arial, sans-serif;
  --ui-font-weight: 550;
  --ui-results-font-weight: 620;
  --ui-results-hover-font-weight: 680;
}

html, body{
  overflow-x: hidden;
}

body{
  font-family: var(--ui-font-family);
  font-weight: var(--ui-font-weight);
  background:
    radial-gradient(1100px 640px at 8% -15%, rgba(59,130,246,.10), transparent 60%),
    radial-gradient(980px 560px at 92% 0%, rgba(96,165,250,.08), transparent 55%),
    linear-gradient(180deg, var(--ios-bg) 0%, var(--ios-bg2) 100%);
  color: var(--ios-text);
}

a{
  color: inherit;
}

input,
select,
textarea,
button{
  font-family: inherit;
}

/* Topbar */
.navbar.ios-topbar{
  background: var(--ios-surface);
  border-bottom: 1px solid var(--ios-border);
  box-shadow: var(--ios-shadow-sm);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
  z-index: 3000;
}

.navbar.ios-topbar .navbar-brand{
  margin: 0;
  padding: 0;
}

.navbar.ios-topbar .navbar-brand.ios-brand-pill{
  padding-left: 18px;
  padding-right: 26px;
}

.ios-brand-pill{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--ios-text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.ios-brand-pill:hover{
  transform: none;
  color: var(--ios-text);
  background: rgba(59,130,246,.12);
  border-color: rgba(59,130,246,.24);
}

.ios-brand-pill.active{
  background: rgba(59,130,246,.10);
  border-color: rgba(59,130,246,.22);
}

html[data-theme="dark"] .ios-brand-pill:hover{
  color: #f8fbff;
  background: rgba(37,99,235,.22);
  border-color: rgba(96,165,250,.36);
}

html[data-theme="light"] .ios-brand-pill:hover{
  color: #0f172a;
  background: rgba(59,130,246,.08);
  border-color: rgba(59,130,246,.28);
  box-shadow: 0 0 0 3px rgba(59,130,246,.08);
}

.ios-dot{
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--ios-primary);
  box-shadow: 0 0 0 4px rgba(59,130,246,.14);
}

.top-nav-links{
  gap: 2px;
}

.top-nav-links .nav-link{
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--ios-muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.top-nav-links .nav-link:hover{
  color: var(--ios-text);
  background: rgba(59,130,246,.08);
  border-color: transparent;
}

.top-nav-links .nav-link.active{
  color: var(--ios-text);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: inset 0 -2px 0 rgba(59,130,246,.9);
}

.ios-theme-toggle{
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--ios-border);
  background: rgba(255,255,255,.55);
  box-shadow: var(--ios-shadow-sm);
}

html[data-theme="dark"] .ios-theme-toggle{
  background: rgba(255,255,255,.06);
  box-shadow: none;
}

.ios-usd-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 12px 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--ios-border);
  background: rgba(255,255,255,.55);
  box-shadow: var(--ios-shadow-sm);
  line-height: 1.05;
}

.ios-usd-icon{
  font-size: 19px;
  font-weight: 900;
  color: #76d7c4;
  opacity: .9;
}

.ios-usd-value{
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .01em;
  color: var(--ios-text);
}

html[data-theme="dark"] .ios-usd-pill{
  background: rgba(255,255,255,.06);
  box-shadow: none;
}

.ios-font-btn{
  min-width: 164px;
  font-size: 0.94rem;
  font-weight: 700;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.ios-font-menu{
  min-width: 188px;
  padding: 4px;
}

.ios-font-menu .dropdown-item{
  border-radius: 9px;
  font-size: 0.94rem;
  font-weight: 650;
  padding: 7px 10px;
}

.ios-font-menu .dropdown-item.active,
.ios-font-menu .dropdown-item:active{
  color: #fff;
  background: linear-gradient(180deg, rgba(59,130,246,1), rgba(37,99,235,1));
}

.navbar.ios-topbar .btn.btn-outline-secondary{
  border-radius: 999px;
  border-color: var(--ios-border);
  background: rgba(255,255,255,.55);
  color: var(--ios-text);
}

html[data-theme="dark"] .navbar.ios-topbar .btn.btn-outline-secondary{
  background: rgba(255,255,255,.06);
  color: var(--ios-text);
}

.ios-faq-toggle{
  height:36px;
  min-width:58px;
  border:1px solid var(--ios-border);
  border-radius:999px;
  background:rgba(255,255,255,.55);
  color:var(--ios-text);
  font-weight:900;
  letter-spacing:.01em;
  box-shadow:var(--ios-shadow-sm);
}

.ios-faq-toggle:hover,
.ios-faq-toggle[aria-expanded="true"]{
  background:linear-gradient(135deg,#2563eb,#0ea5e9);
  border-color:rgba(147,197,253,.55);
  color:#fff;
}

html[data-theme="dark"] .ios-faq-toggle{
  background:rgba(255,255,255,.06);
  box-shadow:none;
}

.faq-drawer-backdrop{
  position:fixed;
  inset:0;
  z-index:5600;
  background:rgba(2,6,23,.52);
  backdrop-filter:blur(3px);
}

.faq-drawer-backdrop[hidden]{
  display:none!important;
}

body.faq-drawer-open{
  overflow:hidden;
}

.faq-drawer{
  position:fixed;
  top:0;
  right:0;
  z-index:5610;
  width:min(430px, calc(100vw - 18px));
  height:100vh;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px 16px 14px;
  background:rgba(255,255,255,.96);
  color:#0f172a;
  border-left:1px solid rgba(15,23,42,.12);
  box-shadow:-26px 0 80px rgba(15,23,42,.30);
  transform:translateX(104%);
  transition:transform .22s ease;
}

.faq-drawer[aria-hidden="false"]{
  transform:translateX(0);
}

html[data-theme="dark"] .faq-drawer{
  background:#10213a;
  color:#f8fbff;
  border-left-color:rgba(125,157,209,.20);
}

.faq-drawer-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.faq-drawer-head h2{
  margin:0;
  font-size:30px;
  line-height:1;
  font-weight:950;
  letter-spacing:0;
}

.faq-drawer-head p{
  margin:8px 0 0;
  color:#64748b;
  font-size:14px;
  font-weight:750;
}

html[data-theme="dark"] .faq-drawer-head p{
  color:#9fb0cf;
}

.faq-drawer-close{
  width:40px;
  height:40px;
  border:1px solid var(--ios-border);
  border-radius:999px;
  background:transparent;
  color:inherit;
  font-size:28px;
  line-height:1;
}

.faq-drawer-close:hover{
  background:rgba(59,130,246,.12);
  border-color:rgba(59,130,246,.34);
}

.faq-search{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--ios-border);
  border-radius:14px;
  padding:0 12px;
  height:44px;
  background:rgba(255,255,255,.72);
}

html[data-theme="dark"] .faq-search{
  background:rgba(7,18,35,.72);
}

.faq-search input{
  flex:1;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  color:inherit;
  font-weight:800;
}

.faq-quick-cards{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.faq-quick-card{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid rgba(59,130,246,.22);
  border-radius:14px;
  padding:10px 12px;
  background:rgba(59,130,246,.08);
  font-weight:900;
}

.faq-quick-card strong{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:999px;
  background:linear-gradient(135deg,#2563eb,#0ea5e9);
  color:#fff;
  flex:0 0 auto;
}

.faq-list{
  overflow:auto;
  padding-right:4px;
}

.faq-section{
  margin-bottom:16px;
}

.faq-section h3{
  margin:0 0 8px;
  font-size:13px;
  color:#64748b;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.03em;
}

html[data-theme="dark"] .faq-section h3{
  color:#9fb0cf;
}

.faq-item{
  border:1px solid var(--ios-border);
  border-radius:14px;
  background:rgba(255,255,255,.72);
  margin-bottom:8px;
  overflow:hidden;
}

html[data-theme="dark"] .faq-item{
  background:rgba(7,18,35,.54);
}

.faq-item[hidden],
.faq-section[hidden]{
  display:none!important;
}

.faq-item summary{
  cursor:pointer;
  padding:13px 14px;
  font-weight:950;
  list-style:none;
}

.faq-item summary::-webkit-details-marker{
  display:none;
}

.faq-item summary::after{
  content:"+";
  float:right;
  color:#2563eb;
  font-size:20px;
  line-height:1;
}

.faq-item[open] summary::after{
  content:"-";
}

.faq-item p{
  margin:0;
  padding:0 14px 14px;
  color:#475569;
  font-size:14px;
  line-height:1.45;
  font-weight:700;
}

html[data-theme="dark"] .faq-item p{
  color:#c7d7ef;
}

.faq-empty{
  border:1px dashed rgba(59,130,246,.35);
  border-radius:14px;
  padding:14px;
  color:#64748b;
  font-weight:800;
  text-align:center;
}

.faq-drawer-footer{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding-top:4px;
}

.faq-drawer-footer .btn{
  border-radius:13px;
  font-weight:900;
}

/* Dropdown */
.ios-menu.dropdown-menu{
  z-index: 4000;
  min-width: 240px;
  border-radius: 14px;
  border: 1px solid var(--ios-border);
  background: rgba(255,255,255,.92);
  box-shadow: var(--ios-shadow);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
  overflow: hidden;
}

html[data-theme="dark"] .ios-menu.dropdown-menu{
  background: rgba(12, 18, 32, .94);
}

.dropdown-section-title{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--ios-muted);
  padding: 10px 12px 6px;
}

.ios-menu .dropdown-item{
  padding: 10px 12px;
  color: var(--ios-text);
}

.ios-menu .dropdown-item:hover{
  background: rgba(59,130,246,.10);
}

.menu-icon{
  width: 18px;
  text-align: center;
}

.profile-user-pill{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 8px 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--ios-border);
  background: rgba(255,255,255,.55);
  color: var(--ios-text);
  font-weight: 700;
}

html[data-theme="dark"] .profile-user-pill{
  background: rgba(255,255,255,.06);
}

/* Buttons */
.btn{
  border-radius: 10px;
}

.btn-primary{
  background: linear-gradient(180deg, rgba(59,130,246,1), rgba(37,99,235,1));
  border: none;
  box-shadow: 0 10px 22px rgba(59,130,246,.22);
}

.btn-primary:hover{
  filter: brightness(1.02);
}

.btn-outline-secondary{
  border-color: var(--ios-border);
}

/* Cards and helpers */
.card,
.panel,
.app-card{
  border-radius: var(--ios-radius-md);
  border: 1px solid var(--ios-border);
  background: var(--ios-surface);
  box-shadow: var(--ios-shadow-sm);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
}

.app-subcard{
  border-radius: var(--ios-radius-sm);
  border: 1px dashed var(--ios-border);
  background: var(--ios-surface-2);
}

.section-title{
  margin: 14px 0 10px;
  padding: 8px 2px;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  font-weight: 900;
  letter-spacing: -0.01em;
  position: relative;
}

.section-title::before{
  display: none;
}

.app-input{
  border-radius: var(--ios-radius-sm);
}

.app-btn{
  border-radius: 999px;
  font-weight: 700;
}

.app-badge{
  border-radius: 999px;
  padding: .45rem .6rem;
  font-weight: 700;
}

/* Tables */
.table-responsive{
  border-radius: var(--ios-radius-lg);
  overflow-x: auto;
  overflow-y: visible;
}

.table{
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: transparent;
  --bs-table-color: var(--ios-text);
  color: var(--ios-text);
  border-color: var(--ios-border-2);
}

.table > :not(caption) > * > *{
  border-bottom-color: var(--ios-border-2);
}

.table thead th{
  background: rgba(255,255,255,.78);
  color: var(--ios-text);
  font-weight: 800;
  white-space: nowrap;
}

html[data-theme="dark"] .table thead th{
  background: rgba(17, 28, 49, .66);
}

.table tbody tr:hover td{
  background: rgba(59,130,246,.07);
}

/* В светлой теме делаем текст строк результатов поиска строго чёрным. */
html[data-theme="light"] .pf-results-wrap table.table tbody tr > td:not(.col-order):not(.col-history){
  color: #000;
}

.table-light,
.table-light > th,
.table-light > td{
  --bs-table-bg: rgba(255,255,255,.78);
  color: var(--ios-text);
}

/* Forms */
.form-control,
.form-select{
  border-radius: var(--ios-radius-sm);
  border-color: var(--ios-border);
  color: var(--ios-text);
  background-color: rgba(255,255,255,.88);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select{
  background-color: rgba(17, 28, 49, .68);
  border-color: var(--ios-border);
  color: var(--ios-text);
}

.form-control[type="file"]{
  padding: 0;
}

.form-control[type="file"]::file-selector-button{
  border: 0;
  border-right: 1px solid var(--ios-border);
  padding: 9px 14px;
  margin-right: 12px;
  background: rgba(255,255,255,.84);
  color: var(--ios-text);
}

html[data-theme="dark"] .form-control[type="file"]::file-selector-button{
  background: rgba(255,255,255,.08);
  border-right-color: var(--ios-border);
  color: var(--ios-text);
}

.form-control::placeholder{
  color: var(--ios-muted);
}

.form-label,
.col-form-label{
  color: var(--ios-muted);
  font-weight: 700;
}

.form-check-label{
  color: var(--ios-text);
}

.text-muted{
  color: var(--ios-muted) !important;
}

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

.alert-info{
  background: rgba(56,189,248,.18);
  border: 1px solid rgba(56,189,248,.34);
  color: var(--ios-text);
}

html[data-theme="dark"] .alert-info{
  background: rgba(56,189,248,.14);
  border-color: rgba(56,189,248,.28);
  color: var(--ios-text);
}

.btn-light{
  border-color: var(--ios-border);
  background: rgba(255,255,255,.75);
  color: var(--ios-text);
}

html[data-theme="dark"] .btn-light{
  border-color: var(--ios-border);
  background: rgba(255,255,255,.10);
  color: var(--ios-text);
}

.pagination .page-link{
  color: var(--ios-text);
  background: rgba(255,255,255,.70);
  border-color: var(--ios-border);
  backdrop-filter: var(--ios-blur);
  -webkit-backdrop-filter: var(--ios-blur);
}

.pagination .page-link:hover{
  color: var(--ios-text);
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.35);
}

.pagination .page-item.active .page-link{
  color: #fff;
  background: linear-gradient(180deg, rgba(59,130,246,1), rgba(37,99,235,1));
  border-color: rgba(37,99,235,1);
}

.pagination .page-item.disabled .page-link{
  color: var(--ios-muted);
  background: rgba(148,163,184,.15);
  border-color: var(--ios-border);
}

html[data-theme="dark"] .pagination .page-link{
  background: rgba(17, 28, 49, .78);
  border-color: var(--ios-border);
  color: var(--ios-text);
}

/* Upload compatibility */
.zone{
  border: 1px solid var(--ios-border-2);
  border-radius: 10px;
  padding: 16px;
  background: transparent;
}

.kpi{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--ios-border);
  background: rgba(255,255,255,.75);
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 800;
}

.progress{
  height: 10px;
  border-radius: 999px;
  background: #dbeafe;
}

.progress-bar{
  border-radius: 999px;
}

/* Responsive topbar */
@media (max-width: 991.98px){
  .top-nav-links{
    width: 100%;
    order: 3;
  }
}

@media (max-width: 767.98px){
  .container-fluid{
    padding-left: 10px;
    padding-right: 10px;
  }
  .ios-usd-pill{
    min-height: 36px;
    padding: 5px 10px 5px 8px;
    gap: 6px;
  }
  .ios-usd-value{ font-size: .95rem; }
  .ios-font-btn{ min-width: 136px; font-size: 12px; }
  .ios-brand-pill{
    height: 34px;
    width: auto;
    min-width: 0;
    flex-basis: auto;
    padding: 0 16px;
  }
  .navbar.ios-topbar .navbar-brand.ios-brand-pill{
    padding-left: 14px;
    padding-right: 20px;
  }
  .top-nav-links .nav-link{ padding: 7px 9px; }
}
