:root {
  --bg: #0f172a;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-2: rgba(255, 255, 255, 0.08);
  --text: #e8ecf5;
  --muted: #8b96ad;
  --accent: #0a84ff;
  --accent-2: #2563eb;
  --danger: #ff5f56;
  --border: rgba(255, 255, 255, 0.12);
  --success: #32d74b;
}

.theme-light {
  --bg: #f6f8fc;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-2: rgba(255, 255, 255, 0.82);
  --text: #1f2937;
  --muted: #6b7285;
  --accent: #007aff;
  --accent-2: #2563eb;
  --danger: #ff453a;
  --border: rgba(0, 0, 0, 0.08);
  --success: #2cd35d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

body.theme-dark {
  background: radial-gradient(600px at 25% 12%, rgba(99, 133, 255, 0.18), transparent 55%),
    radial-gradient(700px at 78% 8%, rgba(112, 199, 255, 0.16), transparent 55%),
    radial-gradient(800px at 50% 70%, rgba(61, 92, 200, 0.22), transparent 55%),
    linear-gradient(180deg, #070b1a 0%, #0a1024 55%, #060914 100%);
}

body.theme-light {
  background:
    radial-gradient(620px at 18% 8%, rgba(0, 122, 255, 0.09), transparent 52%),
    radial-gradient(700px at 70% 4%, rgba(37, 99, 235, 0.07), transparent 50%),
    linear-gradient(180deg, #ecf3ff 0%, #f6f8fc 60%, #eef2ff 100%);
}

.app-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 18px 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.clock-widget {
  position: fixed;
  left: 12px;
  top: 10px;
  z-index: 1200;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px 6px;
  min-width: 96px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.18), rgba(79, 168, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: var(--text);
  animation: clockGlow 6s ease-in-out infinite;
}

.clock-widget.dragging {
  cursor: grabbing;
}


.clock-widget .clock-digits {
  font-family: "Inter", "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 14px !important;
  letter-spacing: 0.2px;
}

.clock-widget .clock-date {
  font-size: 9px !important;
  color: var(--muted);
  text-transform: lowercase;
}

@keyframes clockGlow {
  0% {
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.24),
      0 0 0 rgba(10, 132, 255, 0.18);
    transform: translateY(0);
  }
  50% {
    box-shadow:
      0 14px 30px rgba(0, 0, 0, 0.28),
      0 0 18px rgba(10, 132, 255, 0.16);
    transform: translateY(-1px);
  }
  100% {
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.24),
      0 0 0 rgba(10, 132, 255, 0.18);
    transform: translateY(0);
  }
}

.clock-widget {
  position: fixed;
  left: 12px;
  top: 64px;
  z-index: 1100;
  padding: 12px 14px 10px;
  min-width: 120px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.18), rgba(79, 168, 255, 0.14));
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: var(--text);
  animation: clockGlow 6s ease-in-out infinite;
}

.clock-widget .clock-digits {
  font-family: "Inter", "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.6px;
}

.clock-widget .clock-date {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  text-transform: lowercase;
}

@keyframes clockGlow {
  0% {
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.28),
      0 0 0 rgba(10, 132, 255, 0.2);
    transform: translateY(0);
  }
  50% {
    box-shadow:
      0 18px 40px rgba(0, 0, 0, 0.32),
      0 0 22px rgba(10, 132, 255, 0.18);
    transform: translateY(-1px);
  }
  100% {
    box-shadow:
      0 14px 34px rgba(0, 0, 0, 0.28),
      0 0 0 rgba(10, 132, 255, 0.2);
    transform: translateY(0);
  }
}

.space-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.stars,
.glow {
  position: absolute;
  inset: 0;
  background-repeat: repeat;
}

.stars {
  background-image: radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 70% 50%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1px 1px at 85% 25%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 60% 15%, rgba(255, 255, 255, 0.45), transparent);
  animation: twinkle 5s infinite linear;
  opacity: 0.55;
}

.glow {
  background: radial-gradient(380px at 30% 20%, rgba(88, 166, 255, 0.2), transparent 55%),
    radial-gradient(420px at 75% 18%, rgba(116, 235, 213, 0.16), transparent 60%),
    radial-gradient(500px at 50% 70%, rgba(140, 110, 255, 0.18), transparent 60%);
  filter: blur(1px);
  opacity: 0.65;
}

@keyframes twinkle {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 0.4;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 4px;
  border: none;
  background: transparent;
}

#userLabel {
  font-size: 12px;
  opacity: 0.85;
}

.logo {
  letter-spacing: 1px;
  font-weight: 800;
  font-size: 24px;
}

#loginSection {
  width: 100%;
  max-width: 340px;
  align-self: center;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#statsSection {
  width: 100%;
}

#listContainer {
  width: 100%;
}

.footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  padding: 8px 0 6px;
  font-weight: 600;
  width: 100%;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}

.ios-hint {
  margin: 10px 0 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.ios-hint .ios-hint-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.wa-link {
  text-decoration: none;
  color: #25d366;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wa-link:hover {
  filter: brightness(1.1);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar-actions #apkLink {
  order: 1;
}

.topbar-actions #installBtn {
  order: 2;
}

.topbar-actions #themeToggle {
  order: 3;
}

.topbar-actions #logoutBtn {
  order: 4;
}

.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(10, 132, 255, 0.18), rgba(45, 255, 220, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle::after {
  content: "🌙";
  position: absolute;
  font-size: 16px;
  opacity: 0.95;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.theme-light .theme-toggle {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.theme-light .theme-toggle::before {
  transform: translateX(26px);
  background: linear-gradient(135deg, #ffe59d, #ffae00);
  box-shadow: 0 4px 12px rgba(255, 174, 0, 0.35);
}

.theme-light .theme-toggle::after {
  content: "☀️";
  transform: translateX(8px);
}

.theme-dark .theme-toggle::after {
  transform: translateX(-8px);
}

.theme-toggle:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}

.theme-toggle:active::before {
  transform: translateX(0) scale(0.95);
}

.theme-light .theme-toggle:active::before {
  transform: translateX(26px) scale(0.95);
}

.hidden {
  display: none !important;
}

.icon-btn {
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1;
  border-radius: 12px;
}

.content {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
  width: 100%;
}

.logo-top {
  display: flex;
  justify-content: center;
  margin-top: -52px;
  margin-bottom: 10px;
}

.app-subtitle {
  margin: 6px 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 6px 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.subtitle-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(45, 125, 255, 0.12);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(45, 125, 255, 0.2);
}

.subtitle-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.apk-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(120deg, #0a84ff, #4f8bff);
  color: white;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(10, 132, 255, 0.32);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

/* Фиксируем кнопку APK у левого края страницы */
#apkLink {
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 1200;
  margin: 0;
}

.apk-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(45, 125, 255, 0.35);
  opacity: 0.95;
}

.apk-icon {
  font-size: 18px;
}
.card {
  background: var(--panel-2);
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(12px);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  box-shadow: none;
  z-index: 1;
}

.modal-content img {
  max-width: 72vw;
  max-height: 60vh;
  border-radius: 12px;
  object-fit: contain;
  border: none;
  box-shadow: none;
  background: transparent;
}


.login-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  }
  50% {
    transform: translateY(-12px) scale(1.05);
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.30));
  }
  100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
  }
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

h2 {
  text-align: center;
  margin: 0 0 6px;
}

input {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

input:focus {
  border-color: rgba(10, 132, 255, 0.45);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.15);
}

button {
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  border-radius: 14px;
  transition: all 0.2s ease;
}

button.primary {
  background: linear-gradient(120deg, #0ff0ff, #0aa9ff);
  color: #041023;
  padding: 10px 16px;
  border-radius: 18px;
  box-shadow:
    0 12px 28px rgba(10, 169, 255, 0.32),
    0 0 24px rgba(0, 255, 255, 0.25);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: pulse-btn 2.4s infinite ease-in-out;
}

button.ghost {
  background: transparent;
  color: var(--text);
  padding: 9px 12px;
  border: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

button.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

button.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(10, 169, 255, 0.38),
    0 0 26px rgba(0, 255, 255, 0.32);
  filter: brightness(1.03);
}

@keyframes pulse-btn {
  0% {
    box-shadow:
      0 12px 28px rgba(10, 169, 255, 0.32),
      0 0 24px rgba(0, 255, 255, 0.25);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      0 14px 32px rgba(10, 169, 255, 0.38),
      0 0 32px rgba(0, 255, 255, 0.32);
    filter: brightness(1.06);
  }
  100% {
    box-shadow:
      0 12px 28px rgba(10, 169, 255, 0.32),
      0 0 24px rgba(0, 255, 255, 0.25);
    filter: brightness(1);
  }
}

button.ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

button.ghost.danger:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.theme-light button.ghost {
  color: #1f2937;
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.theme-light button.ghost:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.18);
}

.theme-light .modal-content {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

button.small {
  padding: 7px 9px;
  font-size: 12px;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 6px 2px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-bar-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1400;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(79, 168, 255, 0.18));
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
}

.theme-light .bottom-bar-toggle {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 246, 255, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  color: #1f2937;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1300;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  padding: 10px 14px;
  background: rgba(10, 16, 36, 0.9);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.theme-light .bottom-bar {
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.12);
  color: #1f2937;
}

.bottom-bar.open {
  transform: translateY(0);
}

.bottom-bar-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.bottom-bar-content input[type="date"] {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

.theme-light .bottom-bar-content input[type="date"] {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

.bottom-bar button {
  color: inherit;
}

.bottom-bar .icon-only {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 18px;
  border-radius: 12px;
}

.bottom-bar .icon-only svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-bar .calendar-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.theme-light .bottom-bar .calendar-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}

.bottom-bar .date-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.bottom-bar .date-visible {
  position: static;
  opacity: 1;
  width: auto;
  height: auto;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

.theme-light .bottom-bar .date-visible {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

.date-temp-visible {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  pointer-events: auto !important;
  z-index: 1600;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.app-collapsed .app-shell,
.app-collapsed #bottomBar,
.app-collapsed #bottomBarToggle {
  display: none !important;
}

.expand-btn {
  position: fixed;
  left: 12px;
  bottom: 14px;
  z-index: 1500;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.2), rgba(79, 168, 255, 0.18));
  color: var(--text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.theme-light .expand-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 246, 255, 0.9));
  border-color: rgba(0, 0, 0, 0.08);
  color: #1f2937;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.controls-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#statusLabel {
  display: none;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  line-height: 1.5;
}

.empty-state .hint {
  margin-top: 6px;
  color: var(--text);
  opacity: 0.7;
  font-size: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.date-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.date-title {
  font-size: 15px;
  color: var(--muted);
  font-weight: 800;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 8px 10px;
}

.record-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(8px);
}

.record-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  border-color: rgba(255, 255, 255, 0.12);
}

.record-main {
  flex: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
}

.record-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
}

.record-org {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}

.record-title {
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}

.chips {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.chip {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(6px);
}


.record-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.chip.org {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-2);
}

.times {
  display: flex;
  gap: 12px;
  align-items: center;
}

.time {
  font-size: 17px;
  font-weight: 700;
}

.time-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 72px;
}

.time-tag {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.time-note {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}

.time-note.warn {
  color: #f59e0b;
}

.time-note.bad {
  color: #ef4444;
}

.time.enter,
.time.in {
  color: var(--success);
}

.time.exit,
.time.out {
  color: #2b6eff;
}

.time-tag {
  display: none;
}

.record-media {
  width: 140px;
  flex: 0 0 140px;
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-left: auto;
  align-self: flex-start;
  align-items: flex-start;
  margin-top: -6px;
}

.record-img {
  width: 92px;
  height: 122px;
  border-radius: 12px;
  border: none;
  object-fit: cover;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.media-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.media-actions .ghost.small {
  padding: 5px 7px;
  font-size: 11px;
  min-width: 28px;
}

.record-img:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.actions {
  display: flex;
  gap: 6px;
}

/* Минимальное оформление кнопок внутри карточки */
.actions .ghost.small {
  background: rgba(0, 0, 0, 0.04);
  border-color: var(--border);
  color: var(--text);
}
.actions .ghost.small.danger {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}

/* Шапка с фильтром даты/выходом в стиле макета */
.controls-left .muted {
  font-size: 18px;
}
.controls-right {
  gap: 10px;
}
.controls-right input[type="date"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}
.controls-right .ghost {
  color: #2d7dff;
  border-color: rgba(45, 125, 255, 0.25);
}
.topbar-actions .danger,
.controls-right .danger {
  color: var(--danger);
  border-color: rgba(245, 76, 76, 0.3);
}

@media (max-width: 720px) {
  .apk-btn {
    width: 100%;
    justify-content: center;
  }
  .record-card {
    flex-direction: column;
    padding: 10px 9px;
    border-radius: 14px;
  }
  .controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .controls-right {
    width: 100%;
    flex-wrap: wrap;
  }
  .record-main {
    flex-direction: column;
  }
  .times {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }
  .record-name {
    font-size: 17px;
  }
  .time {
    font-size: 17px;
  }
  .chips {
    gap: 6px;
  }
  .chip {
    padding: 5px 9px;
    font-size: 11px;
  }
  .record-media {
    width: 128px;
    flex: 0 0 128px;
    margin-left: auto;
    align-items: flex-start;
    margin-top: -4px;
    gap: 6px;
  }
  .record-img {
    width: 86px;
    height: 114px;
  }
  .card.controls {
    padding: 10px 8px;
  }
  .app-shell {
    padding: 12px 12px 32px;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 10px 10px 28px;
  }
  .topbar-actions button {
    padding: 8px 10px;
  }
  .record-card {
    gap: 8px;
  }
  .times {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .actions .ghost.small {
    padding: 7px 9px;
    font-size: 12px;
  }
  .record-media {
    width: 120px;
    flex: 0 0 120px;
    margin-left: auto;
    align-items: flex-start;
    margin-top: -2px;
    gap: 6px;
  }
  .record-img {
    width: 80px;
    height: 108px;
  }
  .record-name {
    font-size: 16px;
  }
  .time {
    font-size: 16px;
  }
  .chip {
    padding: 5px 8px;
    font-size: 11px;
  }
}


