/* core/static/core/ios.css
   Полная “iOS glass” полировка: фон, navbar, cards, hero, list, tables, buttons (tinted),
   формы, тулбар, grouped sections.
   Можно заменить файл целиком.
*/

:root {
  --text: #0b0b0f;
  --muted: rgba(60, 60, 67, 0.72);

  --blue: #0a84ff;
  --blue-weak: rgba(10, 132, 255, 0.14);
  --blue-ring: rgba(10, 132, 255, 0.22);

  --red: #ff3b30;

  --glass: rgba(255, 255, 255, 0.42);
  --glass-strong: rgba(255, 255, 255, 0.56);
  --glass-weak: rgba(255, 255, 255, 0.26);

  --glass-border: rgba(255, 255, 255, 0.38);
  --hairline: rgba(60, 60, 67, 0.14);

  /* softer, more iOS-like shadows */
  --shadow-xs: 0 6px 18px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.10);

  --radius: 20px;
  --radius-sm: 14px;
}

.ios-body {
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(10, 132, 255, 0.22), transparent 60%),
    radial-gradient(900px 600px at 85% 0%, rgba(94, 92, 230, 0.18), transparent 60%),
    radial-gradient(900px 700px at 40% 110%, rgba(48, 209, 88, 0.12), transparent 55%),
    linear-gradient(180deg, #f6f7fb 0%, #eef1f8 100%);
}

.container-xxl { max-width: 1200px; }

/* Fallback if blur unsupported */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root {
    --glass: rgba(255, 255, 255, 0.92);
    --glass-strong: rgba(255, 255, 255, 0.96);
    --glass-weak: rgba(255, 255, 255, 0.86);
  }
}

/* -------------------------------------------
   NAVBAR (glass)
------------------------------------------- */
.ios-navbar {
  background: rgba(255, 255, 255, 0.32) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.07);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
}

.ios-brand {
  font-weight: 900;
  letter-spacing: -0.35px;
  color: rgba(10, 10, 12, 0.92) !important;
}

.ios-navlink {
  color: rgba(10, 10, 12, 0.78) !important;
  padding: 0.45rem 0.7rem !important;
  border-radius: 999px;
}

.ios-navlink:hover {
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ios-navlink.active {
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: var(--shadow-xs);
  color: rgba(10, 132, 255, 0.95) !important;
}

/* -------------------------------------------
   TYPO
------------------------------------------- */
h1.h3 {
  letter-spacing: -0.35px;
}

/* -------------------------------------------
   GLASS SURFACES (cards, panels)
------------------------------------------- */
.card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--glass-border) !important;
  background: transparent !important;
  box-shadow: var(--shadow-soft) !important;
}

.card .card-body,
.card .card-header {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
}

.card .card-body {
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.card .card-body::before,
.card .card-header::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 38%);
  pointer-events: none;
}

.card .card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  font-weight: 900;
  letter-spacing: -0.2px;
}

/* -------------------------------------------
   HERO (на главной): если у тебя есть .ios-hero
   (можно добавить класс на блок “Панель управления”)
------------------------------------------- */
.ios-hero {
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(20, 22, 28, 0.32);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  position: relative;
  overflow: hidden;
}

.ios-hero::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 40%);
  pointer-events: none;
}

.ios-hero .text-muted {
  color: rgba(235, 235, 245, 0.78) !important;
}

/* -------------------------------------------
   BUTTONS: iOS tinted by default
------------------------------------------- */
.btn {
  border-radius: 999px !important;
  font-weight: 800;
  letter-spacing: -0.12px;
}

.btn-dark {
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.98), rgba(10, 132, 255, 0.86)) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 12px 26px rgba(10, 132, 255, 0.20);
}

.btn-dark:hover { filter: brightness(0.97); }

/* Outline-secondary превращаем в iOS “tinted” */
.btn-outline-secondary {
  background: var(--blue-weak) !important;
  border: 1px solid rgba(10, 132, 255, 0.20) !important;
  color: rgba(10, 132, 255, 0.98) !important;
  backdrop-filter: blur(14px) saturate(170%);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
}

.btn-outline-secondary:hover {
  background: rgba(10, 132, 255, 0.18) !important;
  border-color: rgba(10, 132, 255, 0.26) !important;
}

.btn-outline-danger {
  background: rgba(255, 59, 48, 0.10) !important;
  border: 1px solid rgba(255, 59, 48, 0.22) !important;
  color: rgba(255, 59, 48, 0.95) !important;
}

.btn-outline-danger:hover {
  background: rgba(255, 59, 48, 0.14) !important;
}

/* small buttons keep height consistent */
.btn-sm { padding: 0.38rem 0.75rem !important; }

/* -------------------------------------------
   FORMS
------------------------------------------- */
.form-label {
  font-weight: 900;
  color: rgba(10, 10, 12, 0.66);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.34) !important;
  background: var(--glass-weak) !important;
  box-shadow: none !important;
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(10, 132, 255, 0.55) !important;
  box-shadow: 0 0 0 0.25rem var(--blue-ring) !important;
}

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

/* -------------------------------------------
   ALERTS
------------------------------------------- */
.ios-alert {
  border-radius: var(--radius) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  background: rgba(255, 255, 255, 0.44) !important;
  backdrop-filter: blur(20px) saturate(185%);
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  box-shadow: var(--shadow-xs);
}

/* -------------------------------------------
   LIST (ios-list / ios-row)
------------------------------------------- */
.ios-list {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  overflow: hidden;
  position: relative;
}

.ios-list::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 38%);
  pointer-events: none;
}

.ios-row {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  align-items: flex-start;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.20);
}

.ios-row:first-child { border-top: 0; }

.ios-row.voided { background: rgba(240, 242, 248, 0.24); }

.ios-left { min-width: 160px; }
.ios-date { font-weight: 900; letter-spacing: -0.2px; }
.ios-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.ios-main { flex: 1; min-width: 240px; }
.ios-title { font-weight: 900; letter-spacing: -0.2px; }

.ios-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 6px;
  font-size: 13px;
  color: rgba(10, 10, 12, 0.76);
}

.ios-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 900;
  color: rgba(10, 10, 12, 0.72);
}

.ios-amount { min-width: 180px; text-align: right; }
.ios-amount .rub { font-weight: 950; letter-spacing: -0.2px; }
.ios-amount .fx { margin-top: 3px; font-size: 12px; color: var(--muted); }

.ios-actions {
  min-width: 170px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ios-btn-sm {
  padding: 0.35rem 0.75rem !important;
  font-weight: 900 !important;
  background: rgba(255, 255, 255, 0.22) !important;
  border: 1px solid rgba(255, 255, 255, 0.30) !important;
  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

/* Responsive list */
@media (max-width: 992px) {
  .ios-row { flex-direction: column; }
  .ios-left,
  .ios-amount,
  .ios-actions {
    min-width: 0;
    text-align: left;
    justify-content: flex-start;
  }
}

/* -------------------------------------------
   TABLES (если где-то ещё таблицы остались)
   Делаем стеклянный заголовок и мягкие строки
------------------------------------------- */
.table {
  color: rgba(10, 10, 12, 0.86);
}

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

.table thead.table-dark th {
  background: rgba(255, 255, 255, 0.30) !important;
  color: rgba(10, 10, 12, 0.82) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.20) !important;
  backdrop-filter: blur(18px) saturate(170%);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.18) !important;
}

.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

.table > :not(caption) > * > * {
  border-bottom-color: rgba(255, 255, 255, 0.20) !important;
}

/* -------------------------------------------
   BADGES (мягче и стекляннее)
------------------------------------------- */
.badge {
  border-radius: 999px !important;
  font-weight: 900;
  letter-spacing: -0.1px;
}

.text-bg-success { background: rgba(48, 209, 88, 0.18) !important; color: rgba(0, 0, 0, 0.78) !important; }
.text-bg-danger  { background: rgba(255, 59, 48, 0.18) !important; color: rgba(0, 0, 0, 0.78) !important; }
.text-bg-warning { background: rgba(255, 149, 0, 0.20) !important; color: rgba(0, 0, 0, 0.78) !important; }
.text-bg-secondary { background: rgba(142, 142, 147, 0.20) !important; color: rgba(0, 0, 0, 0.74) !important; }

/* -------------------------------------------
   iOS form sections helpers
------------------------------------------- */
.ios-hr {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.20);
  margin: 16px 0;
}

.ios-section-title {
  font-weight: 950;
  letter-spacing: -0.2px;
  color: rgba(10, 10, 12, 0.78);
  margin: 2px 0 10px;
}

/* -------------------------------------------
   iOS grouped section (cells like Settings)
------------------------------------------- */
.ios-section {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px) saturate(185%);
  -webkit-backdrop-filter: blur(22px) saturate(185%);
  overflow: hidden;
  position: relative;
}

.ios-section::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.36), transparent 38%);
  pointer-events: none;
}

.ios-cell {
  position: relative;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.20);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.ios-cell:first-child { border-top: 0; }

.ios-cell-title {
  font-weight: 950;
  letter-spacing: -0.2px;
}

.ios-cell-sub {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.ios-kv {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  margin-top: 8px;
}

.ios-kv .k { color: rgba(10, 10, 12, 0.70); }

.ios-kv .v {
  font-weight: 950;
  letter-spacing: -0.15px;
  text-align: right;
}

.ios-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.ios-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 950;
  color: rgba(10, 10, 12, 0.72);
}

/* -------------------------------------------
   iOS glass toolbar (used on order detail)
------------------------------------------- */
.ios-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ios-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-weight: 950;
  letter-spacing: -0.15px;
  text-decoration: none;

  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: rgba(10, 10, 12, 0.82) !important;

  backdrop-filter: blur(16px) saturate(170%);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
}

.ios-tool:hover { background: rgba(255, 255, 255, 0.34); }

.ios-tool svg { width: 16px; height: 16px; opacity: 0.9; }

.ios-tool-primary {
  background: linear-gradient(180deg, rgba(10, 132, 255, 0.98), rgba(10, 132, 255, 0.86));
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 12px 26px rgba(10, 132, 255, 0.20);
}

.ios-tool-primary:hover { filter: brightness(0.97); }

@media (max-width: 992px) {
  .ios-toolbar { justify-content: flex-start; }
  .ios-tool { width: 100%; justify-content: center; }
}

:root{
  /* iOS-like materials */
  --ios-bg: #f2f2f7;
  --ios-card: rgba(255,255,255,0.78);
  --ios-card-strong: rgba(255,255,255,0.92);
  --ios-sep: rgba(60,60,67,0.18);
  --ios-shadow: 0 10px 30px rgba(0,0,0,0.08);
  --ios-radius: 16px;
  --ios-radius-lg: 20px;
}

/* Background closer to iOS */
.ios-body{
  background:
    radial-gradient(900px 500px at 20% -10%, rgba(10,132,255,0.10), transparent 55%),
    radial-gradient(900px 600px at 85% 0%, rgba(94,92,230,0.08), transparent 55%),
    linear-gradient(180deg, var(--ios-bg) 0%, #eef0f7 100%);
}

/* Reduce "heavy glass" feeling */
.card{
  box-shadow: var(--ios-shadow) !important;
}
.card .card-body,
.card .card-header{
  background: var(--ios-card) !important;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.card .card-body::before,
.card .card-header::before{
  opacity: .45; /* less glitter */
}

/* iOS grouped form container (like Settings) */
.ios-group{
  border-radius: var(--ios-radius-lg);
  border: 1px solid rgba(255,255,255,0.55);
  background: var(--ios-card);
  box-shadow: var(--ios-shadow);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  overflow: hidden;
}

.ios-group + .ios-group{ margin-top: 14px; }

.ios-group-title{
  font-weight: 950;
  letter-spacing: -0.2px;
  color: rgba(60,60,67,0.72);
  margin: 10px 4px 8px;
  font-size: 13px;
  text-transform: none;
}

.ios-field-row{
  padding: 12px 14px;
  border-top: 1px solid var(--ios-sep);
  background: rgba(255,255,255,0.56);
}
.ios-field-row:first-child{ border-top: 0; }

.ios-field-row .form-label{
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(60,60,67,0.78);
  font-weight: 800;
}

/* Inputs more like iOS: less glass inside, more solid */
.form-control,
.form-select{
  background: rgba(255,255,255,0.85) !important;
  border: 1px solid rgba(60,60,67,0.18) !important;
  border-radius: 12px !important;
}
.form-control:focus,
.form-select:focus{
  border-color: rgba(10,132,255,0.55) !important;
}

/* Navbar: more iOS */
.ios-navbar{
  background: rgba(255,255,255,0.70) !important;
  border-bottom: 1px solid rgba(60,60,67,0.12) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Sticky action bar (native iOS feeling) */
.ios-sticky-actions{
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--ios-radius-lg);
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 14px 40px rgba(0,0,0,0.10);
}

.ios-sticky-actions .btn{
  width: 100%;
  padding: 0.72rem 1rem !important;
  font-size: 16px;
}

/* On desktop keep buttons normal width */
@media (min-width: 992px){
  .ios-sticky-actions .btn{ width: auto; }
}
