* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #f0fdfa;
  --bg-card: rgba(255, 255, 255, 0.88);
  --border-card: rgba(8, 145, 178, 0.12);
  --text-primary: #134e4a;
  --text-secondary: #115e59;
  --text-muted: #5eaaa8;
  --accent-cyan: #0891b2;
  --accent-green: #22c55e;
  --accent-orange: #f59e0b;
  --accent-gray: #e2e8f0;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(8, 145, 178, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(8, 145, 178, 0.12);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.app-shell {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.app-shell.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.verify-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(240, 253, 250, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.verify-gate.leave {
  animation: gateOut 0.45s ease forwards;
}

@keyframes gateOut {
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}

.verify-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(8, 145, 178, 0.18);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card-hover);
  display: grid;
  gap: 10px;
}

.verify-card h2 {
  font-size: 1.2rem;
}

.verify-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.verify-card label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.verify-card input[type="password"] {
  border: 1px solid rgba(8, 145, 178, 0.15);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
}

.verify-btn {
  margin-top: 2px;
}

.verify-message {
  min-height: 1.2em;
  font-size: 0.88rem;
}

.verify-message.ok {
  color: #16a34a;
}

.verify-message.error {
  color: #dc2626;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: glowDrift 16s ease-in-out infinite alternate;
}

.bg-glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  top: -10%;
  left: -5%;
}

.bg-glow-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, var(--accent-green), transparent 70%);
  top: 40%;
  right: -8%;
  animation-delay: -5s;
}

.bg-glow-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
  bottom: -5%;
  left: 30%;
  animation-delay: -10s;
}

@keyframes glowDrift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(20px, -15px) scale(1.08);
  }
}

header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 48px 24px 16px;
}

header h1 {
  font-size: 2.1rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0891b2, #0d9488, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.4px;
}

header p {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.panel {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.section-card.entering {
  opacity: 0;
  transform: translateY(16px);
}

.section-card.entering.entered {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(8, 145, 178, 0.2);
}

.control-card {
  border-color: rgba(8, 145, 178, 0.18);
}

.date-tools,
.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 12px;
}

input[type="date"],
input[type="number"] {
  border: 1px solid rgba(8, 145, 178, 0.15);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text-primary);
  font: inherit;
}

input[type="date"] {
  padding: 9px 10px;
}

button {
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.2s ease, background-color 0.2s ease;
}

button:active {
  transform: translateY(1px);
}

.primary {
  background: linear-gradient(135deg, #0891b2, #0d9488);
  color: #fff;
  padding: 9px 15px;
}

.primary:hover {
  filter: brightness(1.06);
}

.ghost {
  background: #fff;
  border-color: rgba(8, 145, 178, 0.16);
  color: var(--text-secondary);
  padding: 9px 13px;
}

.ghost:hover {
  background: #f5fcfc;
}

.updated-at {
  display: block;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.message {
  min-height: 1.2em;
  margin-top: 6px;
  font-size: 0.92rem;
}

.message.ok {
  color: #16a34a;
}

.message.error {
  color: #dc2626;
}

.sections {
  display: grid;
  gap: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(8, 145, 178, 0.08);
}

.section-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.12), rgba(34, 197, 94, 0.12));
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.cable-item {
  border: 1px solid rgba(8, 145, 178, 0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.8);
}

.cable-item:last-child {
  margin-bottom: 0;
}

.cable-head {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.length-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(8, 145, 178, 0.1);
  color: var(--accent-cyan);
}

.work-grid {
  display: grid;
  gap: 8px;
}

.work-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(8, 145, 178, 0.1);
  background: rgba(240, 253, 250, 0.75);
}

.work-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.step {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(8, 145, 178, 0.2);
  background: #fff;
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1;
}

.step:hover {
  background: #f5fcfc;
}

.step:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background: #eef4f5;
}

.step.transfer {
  font-size: 1rem;
}

.counter input[type="number"] {
  width: 88px;
  text-align: center;
  padding: 7px;
}

.hint {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 1px;
}

@media (max-width: 700px) {
  header h1 {
    font-size: 1.55rem;
  }

  .panel {
    padding: 16px 12px 48px;
  }

  .section-card {
    padding: 18px 14px;
  }

  .counter {
    justify-content: flex-end;
  }

  .counter input[type="number"] {
    width: 120px;
  }

  .work-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-glow {
    animation: none;
  }

  .section-card,
  button {
    transition: none;
  }
}
