  :root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #60a5fa;
    --primary-subtle: #eff6ff;

    --navy: #0f172a;
    --navy-surface: #1e293b;

    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --bg-page: #f8fafc;
    --card: #ffffff;

    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 24px 60px -24px rgba(15, 23, 42, 0.18), 0 8px 20px -12px rgba(15, 23, 42, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 18px;
    --radius-full: 9999px;
  }

  * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  body {
    min-height: 100vh;
    font-family: "Kantumruy Pro", "Plus Jakarta Sans", "Battambang", sans-serif;
    color: var(--text-main);
    background: var(--bg-page);
    line-height: 1.55;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
  }

  /* =========================================================
     APP HEADER
  ========================================================== */
  .app-header {
    background: linear-gradient(115deg, #0b1a3a 0%, #102759 52%, #1d4ed8 100%);
    color: white;
    padding: 18px 16px 48px;
    position: relative;
    box-shadow: 0 12px 30px -12px rgba(30, 58, 138, 0.45);
  }

  .header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }

  .brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .app-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
    font-size: 21px;
  }

  .brand-titles {
    min-width: 0;
  }

  .brand-titles h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.3;
  }

  .brand-titles p {
    font-size: 11px;
    color: rgba(219, 234, 254, 0.8);
    margin-top: 2px;
  }

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

  .btn-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e0e7ff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s;
  }

  .btn-dashboard:hover {
    background: rgba(255, 255, 255, 0.16);
  }

  .user-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 10px 5px 5px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
  }

  .user-badge-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
  }

  .btn-logout {
    background: #ffffff;
    border: none;
    color: var(--primary-dark);
    padding: 4px 9px;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
  }

  .btn-logout:hover {
    background: #fee2e2;
    color: #b91c1c;
  }

  /* =========================================================
     MAIN CONTAINER & CARD
  ========================================================== */
  .main-wrapper {
    max-width: 940px;
    margin: -28px auto 60px;
    padding: 0 16px;
  }

  .main-card {
    background: var(--card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    padding: 28px;
    margin-bottom: 24px;
  }

  .card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .card-head-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
  }

  .card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .card-icon svg {
    width: 21px;
    height: 21px;
  }

  .form-title {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: var(--navy);
    line-height: 1.35;
  }

  .form-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
  }

  .card-head-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  .card-user {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f1f5f9;
    border-radius: var(--radius-full);
    padding: 5px 11px 5px 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .card-user-initial {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
  }

  .editing-indicator {
    display: none;
    background: #fef3c7;
    color: #92400e;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
  }

  .logs-list-section {
    margin-top: 0;
  }

  .card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }

  .card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* =========================================================
     FORM GRID & FIELDS
  ========================================================== */
  .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .col-full {
    grid-column: 1 / -1;
  }

  .field {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .field-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    min-height: 18px;
    margin-bottom: 6px;
  }

  .field-label-row label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 18px;
  }

  .req {
    color: var(--danger);
    margin-left: 1px;
  }

  .field-hint {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .field-error {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #e11d48;
    line-height: 1.4;
  }

  .field-error:empty {
    display: none;
  }

  .input-control,
  .select-control,
  .textarea-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
  }

  .input-control:hover,
  .select-control:hover,
  .textarea-control:hover {
    border-color: var(--border-hover);
  }

  .input-control:focus,
  .select-control:focus,
  .textarea-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  }

  .input-error,
  .input-control.input-error,
  .select-control.input-error,
  .textarea-control.input-error {
    border-color: #fda4af;
  }

  .input-error:focus,
  .input-control.input-error:focus,
  .select-control.input-error:focus,
  .textarea-control.input-error:focus {
    border-color: #f43f5e;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
  }

  .textarea-control {
    height: auto;
    min-height: 88px;
    padding: 12px 14px;
    resize: vertical;
    line-height: 1.6;
  }

  .range-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .range-row .input-control {
    flex: 1;
    min-width: 0;
  }

  .range-sep {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .range-sep svg {
    width: 16px;
    height: 16px;
  }

  .select-wrap {
    position: relative;
  }

  .select-wrap .select-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    cursor: pointer;
  }

  .select-chevron {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: inline-flex;
  }

  .select-chevron svg {
    width: 16px;
    height: 16px;
  }

  /* =========================================================
     SEARCHABLE PROJECT COMBOBOX
  ========================================================== */
  .combo-wrap {
    position: relative;
  }

  .combo-input {
    padding-left: 38px;
    padding-right: 36px;
  }

  .combo-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: inline-flex;
    pointer-events: none;
  }

  .combo-icon svg {
    width: 16px;
    height: 16px;
  }

  .combo-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s;
  }

  .combo-clear:hover {
    background: #f1f5f9;
    color: var(--text-secondary);
  }

  .combo-list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 288px;
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.28);
  }

  .combo-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .combo-item.active,
  .combo-item:hover {
    background: var(--primary-subtle);
  }

  .combo-item-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 7px;
  }

  .combo-item-body {
    min-width: 0;
    flex: 1;
  }

  .combo-item-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .combo-item-meta {
    display: block;
    margin-top: 1px;
    font-size: 11px;
    color: var(--text-muted);
  }

  .combo-check {
    color: var(--primary);
    font-weight: 800;
    flex-shrink: 0;
  }

  .combo-empty {
    padding: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
  }

  /* =========================================================
     EPISODE RANGE
  ========================================================== */
  .ep-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .ep-pill {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 280px;
    height: 48px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .ep-pill:hover {
    border-color: var(--border-hover);
  }

  .ep-pill:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  }

  .ep-pill.input-error {
    border-color: #fda4af;
  }

  .ep-pill.input-error:focus-within {
    border-color: #f43f5e;
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
  }

  .ep-pill input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    text-align: center;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
  }

  .ep-pill input::placeholder {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
  }

  .ep-pill input::-webkit-outer-spin-button,
  .ep-pill input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .ep-pill input[type="number"] {
    -moz-appearance: textfield;
  }

  .ep-prefix,
  .ep-suffix {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 8px;
    user-select: none;
  }

  .ep-sep {
    flex-shrink: 0;
    color: var(--border-hover);
    padding: 0 8px;
    user-select: none;
  }

  .ep-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: var(--primary-subtle);
    border: 1px solid #dbeafe;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  /* =========================================================
     AI CARD + STATUS (equal height)
  ========================================================== */
  .ai-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 76px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #f8fafc;
    cursor: pointer;
    outline: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  }

  .ai-card:hover {
    border-color: var(--border-hover);
  }

  .ai-card.active {
    background: rgba(239, 246, 255, 0.75);
    border-color: #bfdbfe;
  }

  .ai-card:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  }

  .ai-card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .ai-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
  }

  .ai-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
  }

  .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
  }

  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: background-color 0.25s ease;
    border-radius: 34px;
  }

  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: transform 0.25s ease;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  }

  .switch input:checked + .slider {
    background-color: var(--primary);
  }

  .switch input:checked + .slider:before {
    transform: translateX(20px);
  }

  .status-card {
    position: relative;
    display: flex;
    align-items: center;
    height: 76px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }

  .status-card:hover {
    border-color: var(--border-hover);
  }

  .status-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  }

  .status-card.input-error {
    border-color: #fda4af;
  }

  .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    background: var(--success);
  }

  .status-dot-completed { background: var(--success); }
  .status-dot-inprogress { background: var(--warning); }
  .status-dot-blocked { background: var(--danger); }

  .status-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    padding-right: 26px;
  }

  .status-chevron {
    position: absolute;
    right: 16px;
    color: var(--text-muted);
    pointer-events: none;
    display: inline-flex;
  }

  .status-chevron svg {
    width: 16px;
    height: 16px;
  }

  /* =========================================================
     LIVE SUMMARY
  ========================================================== */
  .summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #f8fafc;
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .summary-ok {
    background: linear-gradient(90deg, #eff6ff 0%, #f0f9ff 55%, #eef2ff 100%);
    border-color: #bfdbfe;
  }

  .summary-warn {
    background: #fffbeb;
    border-color: var(--warning-border);
  }

  .summary-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
  }

  .summary-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1;
  }

  .summary-ok .summary-icon {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
  }

  .summary-warn .summary-icon {
    background: #fef3c7;
    border-color: var(--warning-border);
    color: #d97706;
  }

  .summary-copy {
    min-width: 0;
  }

  .summary-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
  }

  .summary-warn .summary-title {
    color: #92400e;
  }

  .summary-message {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: 1.5;
  }

  .summary-warn .summary-message {
    color: #b45309;
  }

  .summary-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
  }

  .summary-stat {
    text-align: right;
  }

  .stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  .stat-value {
    margin-top: 4px;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #334155;
  }

  .summary-ok .stat-value {
    color: var(--primary-dark);
  }

  .stat-value small {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 2px;
  }

  .summary-stat-hours .stat-value {
    font-size: 22px;
  }

  .summary-divider {
    width: 1px;
    height: 40px;
    background: var(--border);
  }

  .summary-ok .summary-divider {
    background: #bfdbfe;
  }

  /* =========================================================
     ACTION BUTTONS
  ========================================================== */
  .form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
  }

  .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 240px;
    height: 48px;
    padding: 0 28px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.55);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.1s ease;
    flex-shrink: 0;
  }

  .btn-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 12px 28px -8px rgba(37, 99, 235, 0.65);
  }

  .btn-submit:active:not(:disabled) {
    transform: scale(0.995);
  }

  .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }

  .actions-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    flex-shrink: 0;
  }

  .btn-reset {
    height: 48px;
    padding: 0 22px;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
  }

  .btn-reset:hover {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .btn-clear {
    margin-left: auto;
  }

  .btn-cancel {
    border-color: #fecaca;
    background: #fef2f2;
    color: #dc2626;
  }

  .btn-cancel:hover {
    background: #fee2e2;
    border-color: #fca5a5;
  }

  .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
  }

  @keyframes spin {
    to { transform: rotate(360deg); }
  }

  /* =========================================================
     LOGS TABLE
  ========================================================== */
  .logs-table-wrapper {
    overflow-x: auto;
  }

  .logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
  }

  .logs-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg-page);
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
  }

  .logs-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
  }

  .logs-table tr:hover {
    background: #f8fafc;
  }

  .badge-task {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    background: #e0e7ff;
    color: #3730a3;
  }

  .badge-ai {
    display: inline-block;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    background: #dbeafe;
    color: #1e40af;
    margin-left: 4px;
  }

  .badge-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .status-completed { background: var(--success-bg); color: var(--success); }
  .status-inprogress { background: var(--warning-bg); color: #d97706; }
  .status-blocked { background: var(--danger-bg); color: var(--danger); }

  .btn-action-sm {
    border: none;
    background: #f1f5f9;
    padding: 5px 9px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
  }

  .btn-action-sm:hover {
    background: #e2e8f0;
  }

  .btn-delete-sm:hover {
    background: #fee2e2;
    color: #dc2626;
  }

  /* =========================================================
     AUTH PIN MODAL
  ========================================================== */
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
  }

  .modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 28px 24px;
    text-align: center;
  }

  .modal-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 16px;
  }

  .modal-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
  }

  .modal-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 22px;
  }

  .pin-input-group {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
  }

  .pin-digit {
    width: 52px;
    height: 60px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }

  .pin-digit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  }

  /* =========================================================
     TOAST
  ========================================================== */
  .toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    background: #0f172a;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: calc(100vw - 48px);
  }

  .toast.show {
    transform: translateY(0);
    opacity: 1;
  }

  .toast-success { background: #065f46; border-left: 4px solid #10b981; }
  .toast-error { background: #7f1d1d; border-left: 4px solid #ef4444; }

  /* =========================================================
     RESPONSIVE
  ========================================================== */
  @media (max-width: 640px) {
    .app-header {
      padding: 16px 14px 44px;
    }

    .header-inner {
      flex-direction: column;
      align-items: flex-start;
      gap: 12px;
    }

    .header-actions {
      width: 100%;
      justify-content: flex-start;
    }

    .brand-titles h1 {
      font-size: 16px;
    }

    .main-wrapper {
      margin-top: -26px;
      padding: 0 12px;
    }

    .main-card {
      padding: 20px 16px;
    }

    .card-head {
      flex-direction: column;
      gap: 12px;
      margin-bottom: 20px;
    }

    .card-head-meta {
      align-self: flex-start;
    }

    .form-grid {
      grid-template-columns: 1fr;
      gap: 18px;
    }

    .ep-pill {
      max-width: 100%;
    }

    .summary-card {
      flex-direction: column;
      align-items: stretch;
      gap: 14px;
      padding: 16px;
    }

    .summary-stats {
      justify-content: flex-start;
      gap: 24px;
    }

    .summary-stat {
      text-align: left;
    }

    .summary-divider {
      height: 40px;
    }

    .form-actions {
      flex-direction: column;
      align-items: stretch;
      gap: 16px;
      margin-top: 24px;
      padding-top: 20px;
    }

    .actions-divider {
      display: none;
    }

    .btn-submit,
    .btn-reset {
      width: 100%;
      min-width: 0;
    }

    .btn-clear {
      margin-left: 0;
    }

    .toast {
      left: 16px;
      right: 16px;
      bottom: 16px;
      max-width: none;
    }

    .pin-digit {
      width: 44px;
      height: 52px;
      font-size: 20px;
    }
  }
