/* newfixpanel · Panel Admin ReelsCutter (limopancer.com/reels/) */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --green: #059669;
  --red: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subbrand {
  margin-left: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.page-main {
  padding: 32px 24px;
}

.auth-wrap {
  max-width: 440px;
  margin: 40px auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 6px;
}

h1 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}

h2 {
  font-size: 16px;
  font-weight: 700;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 5px;
  color: #334155;
}

.field input,
.field select,
.field textarea,
.table-toolbar input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: var(--blue);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.grid-main {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 24px;
  overflow: hidden;
}

.kpi-card {
  padding: 18px 20px;
  border-right: 1px solid var(--border);
}

.kpi-card:last-child {
  border-right: none;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.text-green {
  color: var(--green);
}

.text-blue {
  color: var(--blue);
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: #e2e8f0;
  border-radius: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
}

.tab-btn.active {
  background: #ffffff;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.full {
  width: 100%;
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-dark {
  background: var(--ink);
  color: #ffffff;
}

.btn-dark:hover {
  background: #1e293b;
}

.btn-outline {
  background: #ffffff;
  border-color: #cbd5e1;
  color: var(--ink);
}

.btn-danger-outline {
  background: #ffffff;
  border-color: #fecaca;
  color: var(--red);
}

.alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

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

.table-toolbar input {
  max-width: 240px;
}

.filter-pills {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
}

.pill {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
}

.pill.active {
  background: #ffffff;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: #f8fafc;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

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

.right {
  text-align: right;
  white-space: nowrap;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mini-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  cursor: pointer;
  margin-left: 4px;
  margin-bottom: 3px;
}

.mini-btn.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.mini-btn.red {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.form-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preset-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  cursor: pointer;
}

.preset-btn:hover {
  background: #dbeafe;
}

.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-active {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.status-suspended {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.status-expired {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.status-revoked {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.auth-info-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 11px;
  color: #1e3a8a;
}

.auth-info-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: #1e40af;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  word-break: break-all;
  font-size: 12px;
}

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 400px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 960px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
}
