:root {
      --bg: #020617;
      --panel: rgba(15, 23, 42, 0.82);
      --panel-2: rgba(30, 41, 59, 0.7);
      --border: rgba(255,255,255,0.10);
      --text: #e2e8f0;
      --muted: #94a3b8;
      --cyan: #22d3ee;
      --violet: #a78bfa;
      --emerald: #34d399;
      --amber: #fbbf24;
      --danger: #f87171;
      --shadow: 0 20px 60px rgba(0,0,0,.35);
      --radius: 24px;
    }

    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; }

    body {
      min-height: 100vh;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(34,211,238,.08), transparent 25%),
        radial-gradient(circle at top right, rgba(167,139,250,.08), transparent 20%),
        linear-gradient(180deg, #0f172a 0%, #020617 100%);
      padding: 16px;
    }

    .app {
      max-width: 1320px;
      margin: 0 auto;
      background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(17,24,39,.94));
      border: 1px solid var(--border);
      border-radius: 30px;
      overflow: hidden;
      box-shadow: var(--shadow);
      backdrop-filter: blur(10px);
    }

    .topbar {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      padding: 24px;
      border-bottom: 1px solid var(--border);
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border-radius: 999px;
      border: 1px solid rgba(34, 211, 238, 0.2);
      background: rgba(34, 211, 238, 0.1);
      color: #bae6fd;
      font-size: 12px;
      font-weight: 700;
      margin-bottom: 10px;
    }

    h1 {
      margin: 0;
      font-size: clamp(1.8rem, 4vw, 2.4rem);
    }

    .subtitle {
      margin: 10px 0 0;
      color: var(--muted);
      line-height: 1.6;
      max-width: 860px;
    }

    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      justify-content: flex-end;
      min-width: 260px;
    }

    .btn {
      appearance: none;
      border: 0;
      cursor: pointer;
      border-radius: 18px;
      min-height: 48px;
      padding: 12px 16px;
      font-weight: 700;
      font-size: .95rem;
      transition: transform .12s ease, opacity .2s ease, background .2s ease, border-color .2s ease;
    }

    .btn:active { transform: scale(.985); }

    .btn-primary {
      background: var(--cyan);
      color: #062233;
    }

    .btn-primary:hover { opacity: .92; }

    .btn-secondary {
      background: rgba(255,255,255,.05);
      color: var(--text);
      border: 1px solid var(--border);
    }

    .btn-secondary:hover { background: rgba(255,255,255,.08); }

    .btn-danger {
      background: rgba(248, 113, 113, 0.16);
      color: #fecaca;
      border: 1px solid rgba(248, 113, 113, 0.25);
    }

    .btn-danger:hover { background: rgba(248, 113, 113, 0.22); }

    .btn-small {
      min-height: 44px;
      padding: 10px 14px;
      border-radius: 16px;
    }

    .layout {
      display: grid;
      grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
      gap: 24px;
      padding: 20px;
    }

    .stack {
      display: grid;
      gap: 20px;
    }

    .card {
      background: rgba(255,255,255,.04);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px;
      box-shadow: 0 10px 30px rgba(0,0,0,.18);
      backdrop-filter: blur(6px);
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }

    .card-title {
      margin: 0;
      font-size: 1.1rem;
    }

    .tag {
      padding: 6px 10px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    .tag-green { background: rgba(52, 211, 153, 0.12); color: #bbf7d0; }
    .tag-violet { background: rgba(167, 139, 250, 0.12); color: #ddd6fe; }
    .tag-amber { background: rgba(251, 191, 36, 0.12); color: #fde68a; }
    .tag-cyan { background: rgba(34, 211, 238, 0.12); color: #bae6fd; }

    .options-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .options-grid.radio-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .option {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 74px;
      padding: 14px 16px;
      border-radius: 20px;
      border: 1px solid var(--border);
      background: rgba(2, 6, 23, 0.55);
      cursor: pointer;
      transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    }

    .option:hover { background: rgba(255,255,255,.06); }

    .option.selected-call {
      border-color: rgba(34, 211, 238, 0.45);
      background: rgba(34, 211, 238, 0.10);
      box-shadow: 0 10px 30px rgba(0, 140, 160, .16);
    }

    .option.selected-reten {
      border-color: rgba(167, 139, 250, 0.45);
      background: rgba(167, 139, 250, 0.10);
      box-shadow: 0 10px 30px rgba(91, 33, 182, .16);
    }

    .option.selected-hour {
      border-color: rgba(251, 191, 36, 0.45);
      background: rgba(251, 191, 36, 0.10);
      box-shadow: 0 10px 30px rgba(180, 83, 9, .16);
    }

    .option input {
      width: 18px;
      height: 18px;
      accent-color: var(--cyan);
    }

    .option.selected-reten input {
      accent-color: var(--violet);
    }

    .option.selected-hour input {
      accent-color: var(--amber);
    }

    .option-title { font-weight: 700; }
    .option-price { margin-top: 4px; font-size: .92rem; color: var(--muted); }

    .time-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .field-box {
      background: rgba(2,6,23,.5);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 14px;
    }

    .field-label {
      margin-bottom: 8px;
      font-size: .95rem;
      color: #cbd5e1;
      font-weight: 600;
    }

    .field-row {
      display: flex;
      gap: 10px;
    }

    input[type="datetime-local"] {
      width: 100%;
      min-height: 48px;
      padding: 12px 14px;
      border-radius: 16px;
      border: 1px solid var(--border);
      background: rgba(2, 6, 23, .85);
      color: var(--text);
      outline: none;
      font: inherit;
    }

    input[type="datetime-local"]:focus {
      border-color: rgba(34, 211, 238, .45);
    }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 14px;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 12px;
      margin-top: 14px;
      padding: 14px;
      background: rgba(2,6,23,.45);
      border: 1px solid var(--border);
      border-radius: 20px;
    }

    .metric-title {
      font-size: .73rem;
      text-transform: uppercase;
      letter-spacing: .08em;
      color: var(--muted);
    }

    .metric-value {
      margin-top: 6px;
      font-size: 1.15rem;
      font-weight: 800;
    }

    .metric-note {
      margin-top: 6px;
      font-size: .78rem;
      color: var(--muted);
    }

    .segments-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }

    .segment-item {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 12px;
      align-items: center;
      padding: 14px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.04);
    }

    .segment-main {
      min-width: 0;
    }

    .segment-title {
      font-weight: 800;
      margin-bottom: 4px;
    }

    .segment-sub {
      color: var(--muted);
      font-size: .92rem;
      line-height: 1.45;
    }

    .segment-amount {
      font-weight: 900;
      font-size: 1rem;
      white-space: nowrap;
    }

    .empty-state {
      color: var(--muted);
      padding: 12px 0 4px;
      line-height: 1.6;
    }

    .sidebar {
      position: sticky;
      top: 16px;
      align-self: start;
    }

    .summary {
      overflow: hidden;
      border-radius: 24px;
      border: 1px solid var(--border);
      background: linear-gradient(180deg, rgba(15,23,42,.95), rgba(2,6,23,.95));
      box-shadow: var(--shadow);
    }

    .summary-head,
    .summary-body,
    .summary-foot {
      padding: 18px;
    }

    .summary-head { border-bottom: 1px solid var(--border); }

    .summary-kicker {
      color: #cbd5e1;
      font-size: .95rem;
      font-weight: 600;
    }

    .summary-total {
      margin-top: 10px;
      font-size: clamp(2rem, 5vw, 3rem);
      font-weight: 900;
      line-height: 1;
    }

    .summary-note {
      margin-top: 10px;
      color: var(--muted);
      line-height: 1.55;
    }

    .summary-row {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
      padding: 14px;
      margin-bottom: 10px;
      border-radius: 18px;
      border: 1px solid var(--border);
      background: rgba(255,255,255,.04);
    }

    .summary-row:last-child { margin-bottom: 0; }

    .summary-row-label { color: #cbd5e1; }
    .summary-row-value { font-weight: 800; }

    .summary-foot {
      border-top: 1px solid var(--border);
      color: var(--muted);
    }

    .summary-foot ul {
      margin: 10px 0 0;
      padding-left: 18px;
    }

    .summary-foot li { margin: 8px 0; }

    .helper {
      margin-top: 14px;
      border-radius: 18px;
      border: 1px solid rgba(251, 191, 36, 0.2);
      background: rgba(251, 191, 36, 0.1);
      padding: 14px;
      color: #fde68a;
      line-height: 1.55;
    }

    .muted { color: var(--muted); }
    .hidden { display: none !important; }

    @media (max-width: 1024px) {
      .layout { grid-template-columns: 1fr; }
      .sidebar { position: static; }
    }

    @media (max-width: 768px) {
      body { padding: 10px; }
      .topbar { padding: 18px; }
      .layout { padding: 14px; gap: 16px; }
      .options-grid,
      .options-grid.radio-3,
      .time-grid,
      .metrics {
        grid-template-columns: 1fr;
      }
      .field-row { flex-direction: column; }
      .actions {
        width: 100%;
        justify-content: stretch;
      }
      .actions .btn { width: 100%; }
      .card-header {
        align-items: flex-start;
        flex-direction: column;
      }
      .segment-item {
        grid-template-columns: 1fr;
      }
    }