
    :root {
      --bg-main: #0d1117;
      --bg-card: #161b22;
      --bg-hover: #1f242c;
      --bg-input: #0f1620;
      --bg-modal: #1a1f26;

      --border: #30363d;
      --border-light: #3c444d;

      --text: #e6edf3;
      --text-muted: #8b949e;
      --text-light: #cdd9e5;

      --primary: #3b82f6;
      --primary-hover: #60a5fa;

      --radius: 10px;
      --shadow: 0 10px 30px rgba(0,0,0,0.4);
    }

    body {
      margin: 0;
      background: var(--bg-main);
      color: var(--text);
      font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    }

    /* ============================================================
       HEADER
       ============================================================ */
    .header {
      text-align: center;
      padding: 20px 10px;
      background: #11161d;
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    }

    .header-title {
      font-size: 20px;
      font-weight: 600;
    }

    .counter-box {
      margin-top: 10px;
      display: flex;
      justify-content: center;
    }

    .counter {
      background: #21262d;
      padding: 6px 14px;
      border-radius: 999px;
      border: 1px solid var(--border);
      font-size: 13px;
      box-shadow: inset 0 0 10px rgba(59,130,246,0.35);
    }

    /* ============================================================
       MAIN CONTAINER + ACTION BUTTONS
       ============================================================ */
    .container {
      max-width: 900px;
      margin: 20px auto;
      padding: 0 14px;
    }

    .actions {
      margin-top: 40px;
      margin-bottom: 40px;
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 10px;
    }

    .actions button {
      background: var(--primary);
      color: white;
      border: none;
      border-radius: 999px;
      padding: 10px 18px;
      font-size: 14px;
      cursor: pointer;
      box-shadow: 0 6px 16px rgba(59,130,246,0.35);
      transition: 0.15s;
    }

    .actions button:hover {
      background: var(--primary-hover);
      transform: translateY(-2px);
    }

    @media (max-width: 600px) {
      .actions {
        flex-direction: column;
        width: 90%;
        margin: 30px auto;
      }
    }

    /* ============================================================
       TEMPLATE CARDS
       ============================================================ */
    #templateList {
      display: grid;
      gap: 14px;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .template-item {
      position: relative;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      cursor: pointer;
      transition: 0.12s;
      box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    }

    .template-item:hover {
      background: var(--bg-hover);
      border-color: var(--primary);
      transform: translateY(-3px);
    }

    .template-title {
      display: flex;
      justify-content: space-between;
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .template-type {
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 999px;
      border: 1px solid var(--border-light);
    }

    .template-type.tiktok { background: #000; color: #fff; }
    .template-type.youtube { background: #c30000; color: #fff; }
    .template-type.common { background: #1e293b; color: #7dd3fc; }

    .template-desc {
      font-size: 12px;
      color: var(--text-muted);
      max-height: 40px;
      overflow: hidden;
    }

    /* Delete button */
    .delete-btn {
      background: #b91c1c;
      color: white;
      border: none;
      padding: 6px 10px;
      border-radius: 8px;
      font-size: 12px;
      position: absolute;
      top: 10px;
      right: 10px;
      display: none;
      cursor: pointer;
      transition: 0.15s;
    }

    .template-item:hover .delete-btn {
      display: block;
    }

    .delete-btn:hover {
      background: #dc2626;
    }

    .empty {
      text-align: center;
      margin-top: 20px;
      font-size: 13px;
      color: var(--text-muted);
    }

    /* ============================================================
       MODALS (Create/Edit & Confirm Delete)
       ============================================================ */

    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.65);
      backdrop-filter: blur(4px);
      justify-content: center;
      align-items: center;
      padding: 10px;
      z-index: 50;
    }

    .modal {
      background: var(--bg-modal);
      border: 1px solid var(--border);
      border-radius: 14px;
      width: 100%;
      max-width: 560px;
      padding: 12px 14px;
      box-shadow: var(--shadow);
      display: flex;
      flex-direction: column;
      max-height: 92vh;
      box-sizing: border-box;
    }

    .modal h2 {
      margin: 0;
      margin-bottom: 4px;
      font-size: 18px;
    }

    .modal-subtitle {
      color: var(--text-muted);
      margin-bottom: 10px;
      font-size: 13px;
    }

    .modal-body {
      overflow-y: auto;
      overflow-x: hidden;
      padding-right: 2px;
      flex: 1;
    }

    .modal-row {
      margin-bottom: 8px;
    }

    .modal-row label {
      font-size: 13px;
      color: var(--text-light);
      margin-bottom: 3px;
      display: block;
    }

    input, select, textarea {
      width: 100%;
      background: var(--bg-input);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 6px 8px;
      font-size: 13px;
      outline: none;
      box-sizing: border-box;
    }

    textarea {
      resize: vertical;
      min-height: 48px;
    }

    input:focus, select:focus, textarea:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 1px var(--primary);
    }

    /* CHECKBOX FIX */
    .inline-check {
      display: flex;
      gap: 6px;
      align-items: center;
      white-space: nowrap;
    }

    .inline-check input[type="checkbox"] {
      width: 16px;
      height: 16px;
      margin: 0;
      flex-shrink: 0;
    }

    .inline-check label {
      margin: 0;
      font-size: 13px;
      color: var(--text-light);
    }

    .modal-footer {
      border-top: 1px solid var(--border);
      padding-top: 10px;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
    }

    .btn {
      padding: 8px 14px;
      border-radius: 8px;
      cursor: pointer;
      border: none;
      font-size: 14px;
    }

    .btn-primary { background: var(--primary); color: white; }
    .btn-secondary { background: #475569; color: white; }
    .btn-danger { background: #dc2626; color: white; }