/* =========================================================
   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;
}

.ios-brand-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 220px;
  min-height: 44px;
  padding: 0 28px;
  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;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.navbar.ios-topbar .ios-brand-pill:hover,
.navbar.ios-topbar .navbar-brand.ios-brand-pill:hover,
.navbar.ios-topbar .navbar-brand.ios-brand-pill:focus{
  transform: none;
  color: var(--ios-text) !important;
  background: rgba(59,130,246,.09);
  border-color: rgba(59,130,246,.22);
  box-shadow: 0 8px 18px rgba(59,130,246,.10);
  text-decoration: none;
}

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

html[data-theme="dark"] .navbar.ios-topbar .ios-brand-pill:hover,
html[data-theme="dark"] .navbar.ios-topbar .navbar-brand.ios-brand-pill:hover,
html[data-theme="dark"] .navbar.ios-topbar .navbar-brand.ios-brand-pill:focus{
  color: rgba(255,255,255,.96) !important;
  background: rgba(59,130,246,.18);
  border-color: rgba(96,165,250,.36);
  box-shadow: 0 10px 24px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.05);
}

html[data-theme="dark"] .ios-brand-pill.active{
  background: rgba(59,130,246,.10);
  border-color: rgba(96,165,250,.24);
}

.ios-dot{
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ios-primary);
  box-shadow: 0 0 0 4px rgba(59,130,246,.14);
  transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.navbar.ios-topbar .ios-brand-pill:hover .ios-dot,
.navbar.ios-topbar .navbar-brand.ios-brand-pill:focus .ios-dot{
  background: var(--ios-primary-2);
  box-shadow: 0 0 0 5px rgba(59,130,246,.22), 0 0 18px rgba(59,130,246,.38);
  transform: scale(1.08);
}

html[data-theme="dark"] .navbar.ios-topbar .ios-brand-pill:hover .ios-dot,
html[data-theme="dark"] .navbar.ios-topbar .navbar-brand.ios-brand-pill:focus .ios-dot{
  box-shadow: 0 0 0 5px rgba(96,165,250,.26), 0 0 20px rgba(96,165,250,.48);
}

.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-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);
}

/* 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);
}

.pf-home-capsule{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,.28);
  background: rgba(59,130,246,.08);
  color: var(--ios-text);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 8px 18px rgba(15,23,42,.06);
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease, color .16s ease;
}

.pf-home-capsule:hover,
.pf-home-capsule:focus-visible{
  color: #0f172a;
  background: rgba(59,130,246,.16);
  border-color: rgba(37,99,235,.52);
  box-shadow: 0 12px 24px rgba(37,99,235,.14);
  transform: translateY(-1px);
  text-decoration: none;
}

html[data-theme="dark"] .pf-home-capsule{
  color: rgba(255,255,255,.96);
  background: rgba(59,130,246,.18);
  border-color: rgba(96,165,250,.46);
  box-shadow: 0 12px 28px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
}

html[data-theme="dark"] .pf-home-capsule:hover,
html[data-theme="dark"] .pf-home-capsule:focus-visible{
  color: #fff;
  background: rgba(59,130,246,.30);
  border-color: rgba(147,197,253,.72);
  box-shadow: 0 16px 34px rgba(37,99,235,.24), inset 0 1px 0 rgba(255,255,255,.10);
}

/* 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-font-btn{ min-width: 136px; font-size: 12px; }
  .ios-brand-pill{
    min-width: 176px;
    min-height: 40px;
    padding: 0 18px;
  }
  .top-nav-links .nav-link{ padding: 7px 9px; }
}
