/* ------------------------------------------------------------------ icons */
.icon { width: 18px; height: 18px; flex: 0 0 auto; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; } .icon.xl { width: 30px; height: 30px; }
.spin { animation: spin .8s linear infinite; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: transform .1s, box-shadow .15s, background .15s, border-color .15s, opacity .15s;
  text-decoration: none !important;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px rgba(160, 38, 211, .28); }
.btn.primary:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 10px 26px rgba(160, 38, 211, .38); background: var(--grad); }
.btn.soft { background: var(--primary-50); border-color: transparent; color: var(--primary); }
.btn.soft:hover { background: var(--primary-100); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.danger:hover { background: #dc2626; color: #fff; }
.btn.danger-soft { background: var(--red-50); border-color: transparent; color: var(--red); }
.btn.danger-soft:hover { background: var(--red); color: #fff; }
.btn.success { background: var(--green); border-color: transparent; color: #fff; }
.btn.success:hover { background: #059669; color: #fff; }
.btn.warn { background: var(--amber); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--primary); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn.xl { height: 60px; padding: 0 28px; font-size: 17px; border-radius: 18px; }
.btn.icon-only { width: 40px; padding: 0; } .btn.icon-only.sm { width: 32px; }
.btn.block { width: 100%; }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.field .req { color: var(--red); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err { font-size: 11.5px; color: var(--red); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-size: 14px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 13px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input[disabled], .select[disabled], .textarea[disabled], .input[readonly] { background: var(--surface-3); color: var(--muted); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--red); background: var(--red-50); }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b7896' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.input.sm, .select.sm { height: 34px; font-size: 13px; border-radius: 10px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.input-icon > .suffix { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.form-grid > .s12 { grid-column: span 12; } .form-grid > .s8 { grid-column: span 8; } .form-grid > .s6 { grid-column: span 6; }
.form-grid > .s4 { grid-column: span 4; } .form-grid > .s3 { grid-column: span 3; } .form-grid > .s2 { grid-column: span 2; }
@media (max-width: 760px) { .form-grid > * { grid-column: span 12 !important; } }
.form-section { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--primary); padding: 4px 0; border-bottom: 1px dashed var(--line-strong); margin: 4px 0 -2px; grid-column: span 12; display: flex; align-items: center; gap: 8px; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; }
.check input { appearance: none; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; margin: 1px 0 0; cursor: pointer; transition: all .15s; }
.check input:checked { background: var(--primary); border-color: var(--primary); }
.check input:checked::after { content: ''; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check input[type='radio'] { border-radius: 50%; } .check input[type='radio']:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--green); } .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { box-shadow: var(--ring); }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h3 { font-size: 15.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-body { padding: 16px 20px 20px; }
.card.flat { box-shadow: none; }
.card.tint { background: var(--surface-2); }

/* ------------------------------------------------------------------ badges / chips / status pills */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .icon { width: 13px; height: 13px; }
.badge.primary { background: var(--primary-50); color: var(--primary); }
.badge.green { background: var(--green-50); color: #059669; } [data-theme='dark'] .badge.green { color: #34d399; }
.badge.red { background: var(--red-50); color: #dc2626; } [data-theme='dark'] .badge.red { color: #f87171; }
.badge.amber { background: var(--amber-50); color: #b45309; } [data-theme='dark'] .badge.amber { color: #fbbf24; }
.badge.blue { background: var(--blue-50); color: #2563eb; } [data-theme='dark'] .badge.blue { color: #60a5fa; }
.badge.pink { background: var(--pink-50); color: #db2777; } [data-theme='dark'] .badge.pink { color: #f472b6; }
.badge.teal { background: var(--teal-50); color: #0d9488; }
.badge.gray { background: var(--surface-3); color: var(--muted); }
.badge.has-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.delta { display: inline-flex; align-items: center; gap: 3px; height: 21px; padding: 0 8px; border-radius: 7px; font: 600 10.5px var(--font-display); }
.delta.up { background: var(--green-50); color: #059669; } .delta.down { background: var(--red-50); color: #dc2626; } .delta.flat { background: var(--surface-3); color: var(--muted); }
.delta .icon { width: 11px; height: 11px; stroke-width: 2.6; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.chip b { font-weight: 600; color: var(--text); }
.chip .icon { width: 14px; height: 14px; color: var(--muted); }
button.chip:hover { border-color: var(--primary); }
.chip.tint { background: var(--primary-50); border-color: transparent; color: var(--primary); font-weight: 500; }
.chip-select { position: relative; padding: 0; }
.chip-select select { appearance: none; border: 0; background: transparent; height: 32px; padding: 0 30px 0 12px; font-size: 12.5px; color: var(--text); font-weight: 600; cursor: pointer; border-radius: 10px; max-width: 220px; }
.chip-select select:focus { outline: none; }
.chip-select .icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.chip-select > span { padding-left: 12px; color: var(--muted); }
.chip-select { padding-left: 0; }

/* ------------------------------------------------------------------ segmented / tabs */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 13px; border-radius: 9px; font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: all .15s; white-space: nowrap; }
.seg button:hover { color: var(--primary); }
.seg button.on { background: var(--grad); color: #fff; font-weight: 600; box-shadow: 0 4px 12px rgba(160, 38, 211, .3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; border: 0; background: transparent; padding: 11px 16px; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.tabs button:hover { color: var(--primary); }
.tabs button.on { color: var(--primary); font-weight: 600; }
.tabs button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--grad); }
.tabs .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font: 600 11px/20px var(--font-display); text-align: center; }
.tabs button.on .count { background: var(--primary-50); color: var(--primary); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.table { font-size: 13.2px; }
.table th { position: sticky; top: 0; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; } .table th.sortable:hover { color: var(--primary); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.click { cursor: pointer; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: 4px; justify-content: flex-end; }
.table-empty { padding: 48px 16px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; }
.pager button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.pager button:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.pager button.on { background: var(--grad); color: #fff; border-color: transparent; }
.pager button[disabled] { opacity: .4; cursor: default; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1 1 200px; }

/* ------------------------------------------------------------------ avatar */
.avatar { flex: 0 0 auto; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: #fff; font: 600 13px var(--font-display); background: linear-gradient(135deg, #f59e0b, #ef4444); overflow: hidden; text-transform: uppercase; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 11px; } .avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; } .avatar.xl { width: 96px; height: 96px; border-radius: 26px; font-size: 32px; }
.avatar.round { border-radius: 50%; }
.avatar-stack { display: inline-flex; } .avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; } .avatar-stack .avatar:first-child { margin-left: 0; }

/* ------------------------------------------------------------------ KPI cards + insight */
.kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1359px) { .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: flex; align-items: flex-start; gap: 11px; padding: 14px 14px 13px; min-height: 96px; position: relative; overflow: hidden; }
.kpi .tile { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.kpi .tile .icon { width: 18px; height: 18px; }
.kpi .info { min-width: 0; flex: 1 1 auto; }
.kpi .lbl { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .val { font: 700 22px/1.15 var(--font-display); letter-spacing: -.01em; margin: 2px 0 7px; white-space: nowrap; }
.kpi .val small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi .spark { position: absolute; right: 10px; bottom: 10px; width: 64px; height: 26px; opacity: .95; }
.kpi.click { cursor: pointer; transition: transform .15s, box-shadow .15s; } .kpi.click:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(76, 29, 149, .12); }
.tone-violet { background: var(--primary-50); color: var(--primary); } .tone-pink { background: var(--pink-50); color: var(--pink); }
.tone-amber { background: var(--amber-50); color: var(--amber); } .tone-green { background: var(--green-50); color: var(--green); }
.tone-red { background: var(--red-50); color: var(--red); } .tone-blue { background: var(--blue-50); color: var(--blue); } .tone-teal { background: var(--teal-50); color: var(--teal); }
.insight {
  display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: var(--r-lg); border: 1px solid var(--primary-100);
  background: var(--grad-soft);
}
.insight .bulb { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--primary-100); color: var(--primary); display: grid; place-items: center; }
.insight .tag { font: 700 14px var(--font-display); letter-spacing: .08em; color: var(--primary); }
.insight .txt { flex: 1 1 auto; font-size: 14px; color: var(--text); line-height: 1.6; }
.insight .txt b { color: var(--primary); }
@media (max-width: 760px) { .insight { flex-wrap: wrap; } }

/* ------------------------------------------------------------------ modal / drawer / toast */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(20, 12, 50, .55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .18s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease); overflow: hidden; }
.modal.lg { max-width: 820px; } .modal.xl { max-width: 1080px; } .modal.sm { max-width: 420px; } .modal.full { max-width: 1280px; height: calc(100vh - 40px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; flex: 1 1 auto; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); z-index: 201; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn .25s var(--ease); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); font-size: 13.5px; }
.toast .icon { margin-top: 1px; } .toast.success .icon { color: var(--green); } .toast.error .icon { color: var(--red); } .toast.warn .icon { color: var(--amber); } .toast.info .icon { color: var(--primary); }
.toast b { display: block; font-weight: 600; }

/* ------------------------------------------------------------------ misc blocks */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 16px; color: var(--muted); text-align: center; }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); margin-bottom: 4px; }
.empty .ico .icon { width: 28px; height: 28px; } .empty b { color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 15px; }
.skeleton { position: relative; overflow: hidden; background: var(--surface-3); border-radius: 10px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: shimmer 1.3s infinite; }
[data-theme='dark'] .skeleton::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--primary-100); border-top-color: var(--primary); animation: spin .7s linear infinite; }
.page-loading { display: grid; place-items: center; min-height: 40vh; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; border: 1px solid transparent; }
.alert .icon { margin-top: 2px; }
.alert.info { background: var(--primary-50); color: var(--primary-600); } .alert.warn { background: var(--amber-50); color: #92600a; } [data-theme='dark'] .alert.warn { color: #fbbf24; }
.alert.error { background: var(--red-50); color: #b91c1c; } [data-theme='dark'] .alert.error { color: #fca5a5; } .alert.success { background: var(--green-50); color: #047857; } [data-theme='dark'] .alert.success { color: #6ee7b7; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 620px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } }
.divider-label { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; } .divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .progress > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .4s var(--ease); }
.dropdown-panel { position: absolute; z-index: 90; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .15s var(--ease); }
.dropdown-panel button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 11px; border-radius: 9px; font-size: 13.5px; }
.dropdown-panel button:hover, .dropdown-panel button.hi { background: var(--primary-50); color: var(--primary); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 99px; background: var(--primary-50); color: var(--primary); font-size: 12.5px; font-weight: 500; }
.tag button { border: 0; background: transparent; color: inherit; display: grid; place-items: center; padding: 2px; border-radius: 50%; } .tag button:hover { background: var(--primary-100); }

/* ------------------------------------------------------------------ stepper (approval progress) */
.stepper { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 4px 2px 8px; }
.stepper .st { flex: 1 1 0; min-width: 130px; position: relative; text-align: center; padding: 0 6px; }
.stepper .st::before { content: ''; position: absolute; top: 19px; left: calc(-50% + 22px); right: calc(50% + 22px); height: 3px; border-radius: 3px; background: var(--line-strong); }
.stepper .st:first-child::before { display: none; }
.stepper .st.done::before, .stepper .st.active::before { background: var(--green); }
.stepper .st.rejected::before { background: var(--red); }
.stepper .dot { position: relative; z-index: 1; width: 40px; height: 40px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line-strong); }
.stepper .st.done .dot { background: var(--green); color: #fff; box-shadow: 0 0 0 1.5px var(--green); }
.stepper .st.active .dot { background: var(--grad); color: #fff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .2); animation: ringPulse 2s infinite; }
.stepper .st.rejected .dot, .stepper .st.returned .dot { background: var(--red); color: #fff; box-shadow: 0 0 0 1.5px var(--red); }
.stepper .st.returned .dot { background: var(--amber); box-shadow: 0 0 0 1.5px var(--amber); }
.stepper .st.skipped .dot { opacity: .5; }
@keyframes ringPulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(124, 58, 237, .25); } 50% { box-shadow: 0 0 0 8px rgba(124, 58, 237, .08); } }
.stepper .st b { display: block; font-size: 12.5px; font-weight: 600; }
.stepper .st small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.stepper .st .wait { display: inline-flex; margin-top: 6px; align-items: center; gap: 4px; }

/* ------------------------------------------------------------------ timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line-strong); border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .pin { position: absolute; left: -26px; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-strong); color: var(--muted); }
.tl-item .pin .icon { width: 11px; height: 11px; stroke-width: 2.6; }
.tl-item.green .pin { border-color: var(--green); color: var(--green); background: var(--green-50); } .tl-item.red .pin { border-color: var(--red); color: var(--red); background: var(--red-50); }
.tl-item.primary .pin { border-color: var(--primary); color: var(--primary); background: var(--primary-50); } .tl-item.amber .pin { border-color: var(--amber); color: var(--amber); background: var(--amber-50); }
.tl-item.pink .pin { border-color: var(--pink); color: var(--pink); background: var(--pink-50); }
.tl-item .t { font-weight: 600; font-size: 13.5px; } .tl-item .d { color: var(--text-2); font-size: 13px; margin-top: 2px; } .tl-item .m { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tl-gap { margin: -6px 0 6px; padding-left: 0; }

/* ------------------------------------------------------------------ photos / dropzone */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); cursor: pointer; }
.photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; } .photo:hover img { transform: scale(1.05); }
.photo .x { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(20, 12, 50, .65); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.photo:hover .x, .photo .x:focus-visible { opacity: 1; } .photo .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: 10.5px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed var(--line-strong); background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 500; }
.photo.add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }
.photo .doc { display: grid; place-items: center; height: 100%; gap: 4px; color: var(--muted); font-size: 11px; padding: 8px; text-align: center; }
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(8, 5, 25, .92); display: flex; align-items: center; justify-content: center; animation: fadeIn .2s; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 10px; box-shadow: 0 20px 80px rgba(0, 0, 0, .6); }
.lightbox .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; }
.lightbox .nav:hover { background: rgba(255, 255, 255, .28); } .lightbox .nav.l { left: 20px; } .lightbox .nav.r { right: 20px; }
.lightbox .close { position: absolute; top: 18px; right: 18px; }
.lightbox .cap { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; }

/* ------------------------------------------------------------------ command palette / notification panel */
.cmdk { width: min(640px, 100%); background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s var(--ease); align-self: flex-start; margin-top: 12vh; }
.cmdk input { width: 100%; height: 56px; border: 0; border-bottom: 1px solid var(--line); padding: 0 20px 0 52px; font-size: 16px; background: transparent; outline: none; }
.cmdk .sicon { position: absolute; left: 20px; top: 17px; color: var(--muted); }
.cmdk .list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk .grp { padding: 10px 12px 4px; font-size: 10.5px; letter-spacing: .12em; font-weight: 600; color: var(--faint); text-transform: uppercase; }
.cmdk .it { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.cmdk .it.hi { background: var(--primary-50); } .cmdk .it .t { font-weight: 500; font-size: 13.5px; } .cmdk .it .s { font-size: 11.5px; color: var(--muted); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s var(--ease); z-index: 90; overflow: hidden; }
.notif-panel .head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; }
.notif-panel .list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none !important; color: inherit; }
.notif:hover { background: var(--surface-2); } .notif.unread { background: var(--primary-50); } .notif .t { font-weight: 600; font-size: 13px; } .notif .b { color: var(--text-2); font-size: 12.5px; margin-top: 1px; } .notif .w { color: var(--muted); font-size: 11px; margin-top: 3px; }
.notif .ni { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; }

/* extra grid spans + image-tool details */
.form-grid > .s5 { grid-column: span 5; } .form-grid > .s7 { grid-column: span 7; } .form-grid > .s9 { grid-column: span 9; } .form-grid > .s10 { grid-column: span 10; }
.imgtool .stage .cropper-canvas img, .imgtool .stage .cropper-view-box img { filter: var(--f, none); }
.imgtool .stage.circle .cropper-view-box, .imgtool .stage.circle .cropper-face { border-radius: 50%; }
.imgtool-body { display: flex; flex-direction: column; min-height: 0; }
.imgtool-body > .col { flex: 1 1 auto; min-height: 0; }
.modal.full .modal-body { padding: 16px 20px; }
