/* ===== ТМ Відкриття — основні стилі ===== */
:root {
  --np-red: #E8112D;
  --np-red-dark: #B30E24;
  --np-red-light: #FF3D5A;
  --np-yellow: #FFD500;
  --np-grey: #4a4a4a;
  --np-grey-light: #f5f5f7;
  --green: #16a34a;
  --green-light: #22c55e;
  --red-soft: #fee2e2;
  --green-soft: #dcfce7;
  --yellow-soft: #fef3c7;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f7;
  color: #1a1a1a;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ===== ВЕЛИКА КНОПКА ВІДКРИТТЯ ===== */
.open-btn {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, var(--np-red-light), var(--np-red-dark));
  color: white;
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(232,17,45,.4), inset 0 -10px 30px rgba(0,0,0,.2);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.open-btn:hover { transform: scale(1.03); }
.open-btn:active { transform: scale(0.97); }
.open-btn.opened {
  background: linear-gradient(145deg, var(--green-light), var(--green));
  box-shadow: 0 20px 50px rgba(22,163,74,.4), inset 0 -10px 30px rgba(0,0,0,.2);
  animation: pulse-green 2s infinite;
}
.open-btn:disabled { cursor: not-allowed; opacity: 0.85; }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 20px 50px rgba(22,163,74,.4), inset 0 -10px 30px rgba(0,0,0,.2); }
  50% { box-shadow: 0 20px 60px rgba(22,163,74,.7), inset 0 -10px 30px rgba(0,0,0,.2); }
}

/* ===== ТАЙМЕР ===== */
.timer {
  font-size: clamp(48px, 10vw, 84px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: #1a1a1a;
  letter-spacing: -2px;
  line-height: 1;
}
.timer.warn { color: #d97706; animation: shake 0.5s infinite; }
.timer.danger { color: var(--np-red); animation: shake 0.3s infinite; }
.timer.ok { color: var(--green); }

@keyframes shake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  75%{transform:translateX(3px)}
}

/* ===== КАРТКИ ВІДДІЛЕНЬ ===== */
.branch-card {
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  text-align: center;
  transition: transform 0.15s;
  cursor: default;
  border: 2px solid transparent;
}
.branch-card:hover { transform: translateY(-2px); }
.branch-card.opened { background: var(--green-soft); color: var(--green); border-color: var(--green-light); }
.branch-card.closed { background: var(--red-soft); color: var(--np-red); border-color: var(--np-red-light); }
.branch-card.early { background: var(--green-soft); color: var(--green); border-color: var(--green-light); }
.branch-card.late { background: #fff7ed; color: #c2410c; border-color: #fb923c; }
.branch-card.dayoff { background: #f3f4f6; color: #9ca3af; border-color: #d1d5db; }

/* ===== БЕЙДЖ СТАТУСУ ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-on-time { background: var(--green-soft); color: var(--green); }
.badge-early { background: #dbeafe; color: #1d4ed8; }
.badge-late { background: #fee2e2; color: var(--np-red); }
.badge-pending { background: #f3f4f6; color: #6b7280; }

/* ===== ПІДКАЗКИ (TOOLTIPS) ===== */
.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--np-red);
  color: white;
  font-size: 13px;
  cursor: pointer;
  margin-left: 6px;
  font-weight: 700;
  border: none;
  flex-shrink: 0;
}
.hint:hover { background: var(--np-red-dark); }

/* Власні tooltip-и через data-атрибут */
.tip { position: relative; }
.tip:hover::after, .tip:focus::after, .tip.show::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 130%; left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: normal;
  width: max-content;
  max-width: 240px;
  z-index: 100;
  pointer-events: none;
  line-height: 1.4;
}
.tip:hover::before, .tip:focus::before, .tip.show::before {
  content: "";
  position: absolute;
  bottom: 120%; left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1a1a1a;
  z-index: 100;
}

/* Install кнопка */
.install-btn {
  background: var(--np-red);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: none;
}
.install-btn.show { display: inline-flex; align-items: center; gap: 4px; }

/* Великий годинник */
.clock {
  font-size: clamp(56px, 14vw, 96px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  letter-spacing: -3px;
  line-height: 1;
  color: #1a1a1a;
}
.clock.late { color: var(--np-red); animation: shake 0.4s infinite; }
.clock.warn { color: #d97706; }
.clock-sub {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
}

/* ===== ШАПКА ===== */
.app-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.logo {
  font-weight: 900;
  font-size: 20px;
  color: var(--np-red);
  display: flex; align-items: center; gap: 8px;
}
.logo-mark {
  background: var(--np-red);
  color: white;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}

/* ===== АКОРДЕОН ===== */
.accordion-item { border-bottom: 1px solid #e5e7eb; }
.accordion-header {
  padding: 16px;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
}
.accordion-body { padding: 0 16px 16px; display: none; }
.accordion-item.open .accordion-body { display: block; }
.accordion-item.open .accordion-arrow { transform: rotate(180deg); }
.accordion-arrow { transition: transform 0.2s; }

/* ===== АНІМАЦІЯ ВСПЛИВАННЯ ===== */
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: pop 0.4s ease-out; }

/* ===== ТОСТИ ===== */
.toast {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  z-index: 1000;
  animation: slideDown 0.3s;
  max-width: 90vw;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--np-red); }
@keyframes slideDown {
  from { transform: translate(-50%, -100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== АДАПТИВ ===== */
@media (max-width: 640px) {
  .timer { font-size: 56px; }
}

/* ===== СТРІК (вогник) ===== */
.streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}
