/* Общая тема: палитра и метрики Apple — системные цвета iOS,
   поверхности apple.com, кнопки-пилюли, крупные скругления карточек.
   Подключается лендингом, кабинетом, входом и админкой. */

@font-face {
  font-family: 'Suisse Intl';
  src: url('/fonts/suisseintl-book.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* поверхности */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --fill: #f2f2f7;          /* iOS secondarySystemBackground */
  --dark: #1d1d1f;
  --dark-2: #000000;

  /* текст */
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --separator: #d2d2d7;

  /* системные цвета iOS, светлая тема */
  --blue: #007aff;
  --blue-link: #0071e3;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;

  /* те же цвета в вариантах для тёмных поверхностей */
  --blue-dark: #0a84ff;
  --green-dark: #30d158;
  --red-dark: #ff453a;

  --radius-card: 18px;
  --radius-field: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 15px/1.5 'Suisse Intl', -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 22px; }

h1 { font-size: 26px; margin: 0; letter-spacing: -0.02em; font-weight: 400; line-height: 1.15; }
h2 { font-size: 19px; margin: 0 0 20px; letter-spacing: -0.015em; font-weight: 400; }
h3 { font-size: 15px; margin: 0; font-weight: 400; }
.muted { color: var(--label-2); font-size: 13.5px; }

header.bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--separator); margin-bottom: 30px;
}
/* Знак сделан в эстетике iOS-иконки (скруглённый квадрат, синий градиент),
   но собственный: символы App Store — товарный знак Apple и чужим брендом быть не могут */
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  letter-spacing: -0.02em; font-size: 18px; color: var(--label);
}
.logo-mark { width: 27px; height: 27px; display: block; flex: none; }
.logo span { color: var(--label-3); }

.panel {
  background: var(--surface); border: 1px solid var(--separator);
  border-radius: var(--radius-card); padding: 24px; margin-bottom: 20px;
}

label { display: block; font-size: 12.5px; color: var(--label-2); margin-bottom: 7px; }

input[type=text], input[type=email], input[type=password], select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-field);
  background: var(--surface); border: 1px solid var(--separator);
  color: var(--label); font-size: 15px; font-family: inherit;
}
input:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,122,255,.16);
}

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* кнопки-пилюли, как на apple.com */
button {
  padding: 10px 20px; border-radius: 980px; border: 0; background: var(--blue-link);
  color: #fff; font-size: 14.5px; cursor: pointer; font-family: inherit;
  line-height: 1.3; transition: background .15s ease, opacity .15s ease;
}
button:hover { background: #0077ed; }
button:disabled { opacity: .45; cursor: default; }
button.ghost {
  background: transparent; border: 1px solid var(--separator); color: var(--blue-link);
}
button.ghost:hover { background: var(--fill); }
button.danger { background: transparent; border: 1px solid var(--separator); color: var(--red); }
button.danger:hover { background: #fff1f0; }
button.small { padding: 7px 15px; font-size: 13px; }

.msg { padding: 12px 15px; border-radius: var(--radius-field); margin-bottom: 18px; font-size: 14px; display: none; }
.msg.err { display: block; background: #fff1f0; color: #b3261e; }
.msg.ok { display: block; background: #eefaf1; color: #1c7a3e; }

table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; color: var(--label-3); font-weight: 400;
  padding: 0 10px 12px; letter-spacing: .01em;
}
td { padding: 14px 10px; border-top: 1px solid var(--separator); font-size: 14.5px; vertical-align: top; }
.overflow { overflow-x: auto; }

a.link-url { color: var(--blue-link); text-decoration: none; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
a.link-url:hover { text-decoration: underline; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 980px;
  font-size: 11.5px; background: #eefaf1; color: #1c7a3e;
}
.badge.off { background: var(--fill); color: var(--label-2); }

/* плитки метрик */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--fill); border-radius: 14px; padding: 16px 18px; }
.tile b { display: block; font-size: 28px; font-weight: 400; letter-spacing: -0.02em; }
.tile span { font-size: 12.5px; color: var(--label-2); }

/* график кликов по дням */
.chart-wrap { position: relative; margin-top: 8px; }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-grid line { stroke: var(--separator); stroke-width: 1; }
.chart-tick { fill: var(--label-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-bar { fill: var(--blue); }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-hit:hover + .chart-bar, .chart-hit:focus + .chart-bar { fill: #0062cc; }
.chart-tip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--dark); color: #fff; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; white-space: nowrap; transform: translate(-50%, -100%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.chart-tip.show { opacity: 1; }
.chart-tip b { font-size: 15px; font-weight: 400; }
.chart-tip span { color: rgba(255,255,255,.6); display: block; font-size: 12px; }

.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 22px; }
@media (max-width: 600px) { .breakdown { grid-template-columns: 1fr; } }
.breakdown h3 {
  font-size: 12px; color: var(--label-3); font-weight: 400;
  letter-spacing: .01em; margin-bottom: 12px;
}
.breakdown .line {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--separator); font-size: 14px;
}
.breakdown .line b { font-variant-numeric: tabular-nums; font-weight: 400; }
