/* Shared building blocks used by many pages (inputs, pills, tabs, empty states, progress bar ...).
   They were used in the page code but never defined, which broke the design of most sidebar pages.
   Colours come from the theme variables only, so light and dark both work. */

/* ----- form fields ----- */
.tm-input { box-sizing: border-box; width: 100%; background: rgb(var(--c-input)); border: 1px solid rgb(var(--c-line) / .1); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: rgb(var(--c-text)); font-family: inherit; }
.tm-input:focus { border-color: rgb(var(--c-primary)); outline: none; }
.tm-input::placeholder { color: rgb(var(--c-muted)); }
textarea.tm-input { min-height: 96px; resize: vertical; }
/* <label class="tm-field"><span>Title</span><input class="tm-input"> : the label is only a wrapper, the box is the input */
label.tm-field { display: block; background: none; border: 0; padding: 0; margin-bottom: 12px; font-size: inherit; }
label.tm-field > span { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; color: rgb(var(--c-muted)); }

/* ----- buttons ----- */
.tm-btn-block { display: flex; width: 100%; }
.tm-btn.tm-btn-ghost { background: transparent; color: rgb(var(--c-text)); border: 1px solid rgb(var(--c-line) / .14); box-shadow: none; }

/* ----- small labels ----- */
.tm-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1.3; background: rgb(var(--c-line) / .08); color: rgb(var(--c-muted)); }
.tm-pill.is-amber { background: rgb(245 158 11 / .16); color: #b45309; }
.tm-pill.is-green { background: rgb(16 185 129 / .16); color: #047857; }
html[data-theme="dark"] .tm-pill.is-amber { color: #fbbf24; }
html[data-theme="dark"] .tm-pill.is-green { color: #34d399; }

/* ----- tab switch (buttons inside, one has .is-active) ----- */
.tm-seg { display: flex; gap: 4px; padding: 4px; background: rgb(var(--c-input)); border-radius: 14px; }
.tm-seg > button { flex: 1; min-width: 0; padding: 9px 8px; border: 0; border-radius: 11px; background: transparent; color: rgb(var(--c-muted)); font-size: 12px; font-weight: 800; white-space: nowrap; transition: background .2s, color .2s; }
.tm-seg > button.is-active { background: rgb(var(--c-primary)); color: #fff; }

/* ----- empty / locked / loading states ----- */
.tm-empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; text-align: center; color: rgb(var(--c-muted)); }
.tm-empty-state > i { font-size: 34px; opacity: .5; }
.tm-empty-state > p { margin: 0; font-size: 13px; font-weight: 700; }
.tm-gate { text-align: center; padding: 28px 16px; }
.tm-gate > i { display: block; margin-bottom: 10px; font-size: 30px; color: rgb(var(--c-primary)); }
.tm-sk-list { display: grid; gap: 10px; }
.tm-sk-list > .tm-skel { height: 76px; border-radius: var(--tm-card-radius, 16px); }

/* ----- progress bar: <div class="tm-bar"><i style="width:40%"></i></div> ----- */
.tm-bar { height: 8px; border-radius: 999px; background: rgb(var(--c-line) / .1); overflow: hidden; }
.tm-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, rgb(var(--c-primary)), rgb(var(--c-accent))); transition: width .4s ease; }

/* ----- copy-code chip ----- */
.tm-copy { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1.5px dashed rgb(var(--c-primary) / .5); background: rgb(var(--c-primary) / .08); color: rgb(var(--c-primary)); font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 900; letter-spacing: .08em; cursor: pointer; user-select: all; }

/* ----- switches set by Admin > Frontend Control / Preferences ----- */
.tm-reduce-motion *, .tm-reduce-motion *::before, .tm-reduce-motion *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
.tm-sticky-off .sticky { position: static !important; }
.tm-safe-blur body::before { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
