/* Base components: modern form controls, glowing buttons, luxury tables, pills, tabs, thumbnails, modal, toast */

/* ---------- form controls ---------- */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]),
select,
textarea {
  min-height: var(--ctl, 42px);
  padding: 10px 14px;
  border-radius: var(--r, 12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 25, 42, 0.85);
  backdrop-filter: blur(8px);
  font: inherit;
  font-size: 14px;
  color: #ffffff !important;
  transition: border-color var(--t, 0.16s), box-shadow var(--t, 0.16s), background var(--t, 0.16s);
}

input:hover:not(:disabled):not([type=checkbox]):not([type=radio]),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(24, 34, 56, 0.95);
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: var(--brand, #6366f1);
  background: rgba(24, 34, 56, 1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4), 0 0 16px rgba(99, 102, 241, 0.25);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: rgba(15, 23, 42, 0.4);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.06);
  cursor: not-allowed;
  opacity: 0.6;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background: rgba(18, 25, 42, 0.85) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
}

input[type=checkbox],
input[type=radio] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand, #6366f1);
  cursor: pointer;
  flex: none;
  border-radius: 4px;
}

input[type=file] {
  font: inherit;
  font-size: 13.5px;
  color: #e2e8f0;
  max-width: 100%;
}

input[type=file]::file-selector-button {
  margin-right: 12px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-sm, 8px);
  background: rgba(30, 41, 59, 0.85);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: all var(--t, 0.16s);
}

input[type=file]::file-selector-button:hover {
  background: rgba(99, 102, 241, 0.35);
  border-color: var(--brand, #6366f1);
}

input[type=search] {
  appearance: none;
  -webkit-appearance: none;
}

label {
  cursor: default;
}

/* ---------- password input with toggle ---------- */
.pw {
  position: relative;
  display: flex;
  align-items: center;
}

.pw input {
  width: 100%;
  padding-right: 68px !important;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--r-sm, 8px);
  cursor: pointer;
  transition: all var(--t, 0.16s);
  user-select: none;
  line-height: 1;
}

.pw-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.pw-toggle:focus-visible {
  outline: 2px solid var(--brand, #6366f1);
  outline-offset: 1px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ctl, 42px);
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--r, 12px);
  background: var(--brand-grad, linear-gradient(135deg, #6366f1, #8b5cf6));
  color: #ffffff !important;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.5);
  transition: all 0.16s ease;
}

.btn:hover:not(:disabled) {
  background: var(--brand-grad-hover, linear-gradient(135deg, #4f46e5, #7c3aed));
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.7);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 0;
  box-shadow: var(--ring, 0 0 0 3px rgba(99, 102, 241, 0.45));
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(8px);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff !important;
  transform: translateY(-1.5px);
}

.btn.danger {
  background: rgba(244, 63, 94, 0.22);
  color: #ffffff !important;
  border: 1px solid rgba(244, 63, 94, 0.4);
  box-shadow: none;
}

.btn.danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.38);
  border-color: #f43f5e;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.45);
}

.btn.sm {
  min-height: var(--ctl-sm, 34px);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--r-sm, 8px);
}

.btn.lg {
  min-height: 48px;
  padding: 12px 26px;
  font-size: 15.5px;
  border-radius: var(--r-lg, 16px);
}

/* ---------- tables ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
  color: #cbd5e1;
  font-weight: 750;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(20, 29, 48, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

td {
  color: #ffffff;
}

th:first-child { border-top-left-radius: var(--r, 12px); }
th:last-child { border-top-right-radius: var(--r, 12px); }

tbody tr {
  transition: background var(--t, 0.16s);
}

tbody tr:hover {
  background: rgba(99, 102, 241, 0.1);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r, 12px);
  background: rgba(15, 23, 42, 0.65);
  box-shadow: var(--shadow-1);
}

.table-wrap table {
  margin: 0;
}

.err-cell {
  font-size: 12px;
  color: #fb7185;
  max-width: 300px;
  display: inline-block;
  line-height: 1.4;
  word-break: break-word;
  cursor: help;
}

/* ---------- status pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.pill.pending {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
}

.pill.posted,
.pill.success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.pill.partial {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border-color: rgba(249, 115, 22, 0.4);
}

.pill.failed {
  background: rgba(244, 63, 94, 0.2);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.4);
}

.pill.processing {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.pill.cancelled,
.pill.draft {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.badge-off {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
}

#targetPreview {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r, 12px);
  padding: 16px;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 16px;
}

/* ---------- tabs ---------- */
.htabs {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  max-width: 100%;
}

.htab {
  padding: 9px 20px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  color: #cbd5e1;
  transition: all var(--t, 0.16s);
}

.htab:hover:not(.active):not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.htab.active {
  background: var(--brand-grad, #6366f1);
  color: #ffffff !important;
  box-shadow: 0 2px 14px rgba(99, 102, 241, 0.45);
}

.htab:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}

.htab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.ctabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ctab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  color: #e2e8f0;
  transition: all var(--t, 0.16s);
}

.ctab:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.ctab.active {
  border-color: transparent;
  color: #ffffff !important;
  background: var(--brand-grad, #6366f1);
  box-shadow: 0 2px 14px rgba(99, 102, 241, 0.5);
}

.ctab:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}

.subtabs .ctab {
  padding: 9px 20px;
  font-size: 14px;
}

.ctab-n {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 750;
  text-align: center;
}

.ctab.active .ctab-n {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* ---------- small helpers ---------- */
.inl {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text, #ffffff);
}

.acc { flex-wrap: wrap; }
.npAccTime { padding: 6px 10px; font-size: 13px; min-height: 36px; }

a.hlink {
  color: #a5b4fc;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  font-weight: 600;
  transition: color var(--t, 0.16s);
}
a.hlink:hover { color: #ffffff; }

.thumbs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.thumb {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: var(--r, 12px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #000;
  box-shadow: var(--shadow-2);
  transition: transform var(--t), border-color var(--t);
}

.thumb:hover {
  transform: scale(1.03);
  border-color: var(--brand, #6366f1);
}

.thumb img,
.thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb .tb {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  background: rgba(9, 13, 22, 0.9);
  backdrop-filter: blur(6px);
}

.thumb .tb button {
  flex: 1;
  border: 0;
  background: none;
  color: #ffffff;
  cursor: pointer;
  padding: 6px 0;
  font-size: 11.5px;
  font-weight: 650;
}

.thumb .tb button:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ---------- scheduled item rows ---------- */
.sgroup { margin-bottom: 24px; }
.sgroup h3 { font-size: 16px; margin: 0 0 10px; color: #ffffff; font-weight: 750; }
.splat { margin: 0 0 12px 14px; }
.splat h4 { font-size: 14px; margin: 10px 0 6px; color: #ffffff; font-weight: 700; }
.sacct { font-size: 13px; font-weight: 650; margin: 8px 0 6px 12px; color: #cbd5e1; }

.sitem {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 0 0 8px 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r, 12px);
  flex-wrap: wrap;
  background: rgba(18, 25, 42, 0.75);
  backdrop-filter: blur(8px);
  transition: all var(--t, 0.16s);
}

.sitem:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(24, 34, 56, 0.9);
  box-shadow: var(--shadow-1);
}

.sitem .sinfo {
  flex: 1;
  min-width: 180px;
  font-size: 14px;
  line-height: 1.5;
  color: #ffffff;
}

.sact {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sthumb {
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm, 8px);
  object-fit: cover;
  background: #1e293b;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.sthumb.none {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 12px;
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: auto;
  padding: 36px 16px;
  z-index: 50;
  animation: fade 0.18s ease;
}

.modal-in {
  max-width: 820px;
  margin: 0 auto;
  box-shadow: var(--shadow-3), 0 0 40px rgba(99, 102, 241, 0.25);
  border-radius: var(--r-xl, 22px) !important;
  background: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  animation: pop 0.22s var(--ease, ease);
}

.modal-in.lp-in { max-width: 1200px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  max-width: min(440px, calc(100vw - 36px));
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.45);
  padding: 14px 20px;
  border-radius: var(--r, 12px);
  font-size: 14px;
  line-height: 1.45;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.35);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s var(--ease, ease);
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: none;
}

/* ---------- handles page header ---------- */
.hp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ---------- drafts empty box ---------- */
.drafts-empty-cell {
  padding: 48px 24px !important;
  text-align: center !important;
}

.drafts-empty-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 480px;
  margin: 0 auto;
}

.drafts-empty-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 4px;
}

.drafts-empty-title {
  font-size: 16px;
  font-weight: 750;
  color: #ffffff;
}

.drafts-empty-sub {
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
}

