/* ============================================================
   ShieldPlayer panel — admin styles
   ============================================================ */

:root {
  --black: #000000;
  --navy: #00293B;
  --gold: #E3B23C;
  --grey: #808080;
  --white: #FFFFFF;
  --navy-soft: #0E3A4D;
  --navy-95: #002030;
  --grey-50: #FAFBFC;
  --grey-100: #F5F6F7;
  --grey-200: #E8EAED;
  --grey-300: #D0D4D8;
  --grey-700: #4A4F55;
  --green: #1B9E5B;
  --red: #D9342B;
  --orange: #E08015;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,41,59,.06), 0 2px 6px rgba(0,41,59,.04);
  --shadow-md: 0 4px 16px rgba(0,41,59,.08);
  --shadow-lg: 0 16px 48px rgba(0,41,59,.18);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --t-fast: 120ms ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.55;
  background: var(--grey-100);
  color: var(--navy);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold); }
h1, h2, h3, h4 { color: var(--navy); margin: 0 0 .4em; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .6em; color: var(--grey-700); }

/* ---------- Login page ---------- */
.login-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-soft) 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  text-align: center; margin-bottom: 24px;
}
.login-brand img { height: 60px; margin: 0 auto 14px; }
.login-brand h1 { font-size: 22px; margin: 0; }
.login-brand p { font-size: 13px; color: var(--grey); margin: 4px 0 0; }
.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-form input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: 14.5px; color: var(--navy);
  transition: border-color var(--t-fast);
}
.login-form input:focus { outline: none; border-color: var(--gold); }
.login-form .hint { font-size: 12px; color: var(--grey); margin-top: 6px; }
.login-form .demo-hint {
  background: rgba(227,178,60,.08);
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--grey-700);
  margin: 14px 0 18px;
  border: 1px dashed rgba(227,178,60,.4);
}
.login-form button {
  width: 100%; padding: 12px 18px;
  border: 0; border-radius: var(--radius);
  background: var(--gold); color: var(--navy);
  font-weight: 700; font-size: 15px; cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.login-form button:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ---------- Topbar nav ---------- */
.topbar {
  background: var(--navy);
  color: var(--white);
  padding: 0;
  border-bottom: 1px solid var(--navy-soft);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 24px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; margin-right: 24px; }
.topbar-brand img { height: 34px; width: 34px; }
.topbar-brand span { color: var(--white); font-weight: 700; font-size: 16px; }
.topbar-nav {
  flex: 1;
  display: flex; gap: 4px;
}
.topbar-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 8px;
  color: rgba(255,255,255,.78);
  font-weight: 500; font-size: 14px;
  transition: background var(--t-fast), color var(--t-fast);
}
.topbar-nav a:hover { background: rgba(255,255,255,.06); color: var(--white); }
.topbar-nav a.active { background: rgba(227,178,60,.16); color: var(--gold); }
.topbar-actions {
  display: flex; align-items: center; gap: 14px;
}
.topbar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  background: rgba(255,255,255,.06);
  font-size: 13px; color: rgba(255,255,255,.85);
}
.topbar-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
}
.topbar-actions .logout {
  color: rgba(255,255,255,.7); font-size: 13px;
  padding: 6px 10px; border-radius: 6px;
}
.topbar-actions .logout:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ---------- Page shell ---------- */
.page {
  max-width: 1320px; margin: 0 auto;
  padding: 28px 24px 80px;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-head .crumb {
  font-size: 12.5px; color: var(--grey); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 600;
  background: transparent; color: var(--navy);
  transition: all var(--t-fast); text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-primary:hover { background: #d6a430; transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--navy); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-dark:hover { background: var(--navy-soft); color: var(--white); transform: translateY(-1px); }
.btn-ghost { border-color: var(--grey-200); background: var(--white); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { color: var(--red); background: rgba(217,52,43,.06); }
.btn-danger:hover { background: rgba(217,52,43,.14); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

/* ---------- Cards / stats ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-sm);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid var(--grey-200);
  position: relative; overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(0,41,59,.08); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-card.gold .stat-icon { background: rgba(227,178,60,.16); color: var(--gold); }
.stat-card.green .stat-icon { background: rgba(27,158,91,.14); color: var(--green); }
.stat-card.red .stat-icon { background: rgba(217,52,43,.10); color: var(--red); }
.stat-card.purple .stat-icon { background: rgba(80,40,140,.12); color: #5028A8; }
.stat-card .stat-value { font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; line-height: 1.1; }
.stat-card .stat-label { color: var(--grey); font-size: 12.5px; margin-top: 4px; }
.stat-card .stat-meta  { color: var(--grey-700); font-size: 12px; margin-top: 8px; }
.stat-card .stat-icon svg { width: 20px; height: 20px; }

/* ---------- Two-column section ---------- */
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--grey-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table-toolbar {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--grey-200);
  gap: 12px; flex-wrap: wrap;
}
.table-toolbar .search {
  display: flex; align-items: center; gap: 8px;
  background: var(--grey-100); border-radius: 8px;
  padding: 7px 12px; flex: 1; max-width: 320px;
  border: 1px solid var(--grey-200);
}
.table-toolbar .search input {
  border: 0; background: transparent; outline: none;
  font-size: 13.5px; color: var(--navy); flex: 1;
}
.table-toolbar .search svg { width: 16px; height: 16px; color: var(--grey); }
table.data {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
}
.data th {
  text-align: left; padding: 12px 18px;
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--grey);
  background: var(--grey-50); border-bottom: 1px solid var(--grey-200);
}
.data td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--grey-200);
  vertical-align: middle;
}
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: var(--grey-50); }
.data td.actions { text-align: right; }
.data td.actions .btn { margin-left: 4px; }
.data .strong { font-weight: 600; color: var(--navy); }
.data .muted  { color: var(--grey); }

/* ---------- Badges / pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  border: 1px solid transparent;
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  flex-shrink: 0; opacity: .85;
}
.pill-active   { color: var(--green); background: rgba(27,158,91,.10); }
.pill-revoked  { color: var(--red);   background: rgba(217,52,43,.10); }
.pill-draft    { color: var(--grey);  background: rgba(128,128,128,.12); }
.pill-published{ color: var(--green); background: rgba(27,158,91,.10); }
.pill-pending  { color: var(--orange); background: rgba(224,128,21,.12); }
.pill-processing { color: var(--orange); background: rgba(224,128,21,.12); }
.pill-ready    { color: var(--green); background: rgba(27,158,91,.10); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--navy); }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: 9px; font-size: 14px;
  background: var(--white); color: var(--navy);
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(227,178,60,.16);
}
.field .hint { font-size: 12px; color: var(--grey); }
.field-row { display: flex; gap: 10px; align-items: center; }

.checkbox-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 16px;
}
.checkbox {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--navy); user-select: none;
  cursor: pointer; padding: 6px 0;
}
.checkbox input { width: 16px; height: 16px; cursor: pointer; }

/* ---------- Watermark position grid ---------- */
.wm-grid {
  display: inline-grid; grid-template-columns: repeat(3, 60px); gap: 4px;
  padding: 8px; background: var(--navy); border-radius: 10px;
}
.wm-cell {
  height: 38px; border-radius: 6px;
  background: rgba(255,255,255,.06);
  cursor: pointer; transition: background var(--t-fast);
  border: 1px solid rgba(255,255,255,.08);
}
.wm-cell:hover { background: rgba(227,178,60,.12); }
.wm-cell.on { background: var(--gold); border-color: var(--gold); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,12,20,.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 720px;
  box-shadow: var(--shadow-lg);
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px; border-bottom: 1px solid var(--grey-200);
}
.modal-head h2 { margin: 0; }
.modal-head .close {
  width: 32px; height: 32px; border: 0; cursor: pointer;
  background: var(--grey-100); border-radius: 8px; color: var(--grey-700);
  font-size: 18px; line-height: 1;
}
.modal-head .close:hover { background: var(--grey-200); color: var(--navy); }
.modal-body { padding: 22px 24px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--grey-200);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ---------- License code display ---------- */
.license-code {
  background: var(--navy); color: var(--gold);
  padding: 16px 20px; border-radius: 10px;
  font-family: var(--font-mono); font-size: 13px;
  word-break: break-all; line-height: 1.6;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--navy-soft);
}
.license-code .key { flex: 1; }
.license-code .copy-btn {
  background: var(--gold); color: var(--navy);
  border: 0; padding: 6px 14px; border-radius: 6px;
  font-weight: 700; cursor: pointer; font-size: 12px;
  white-space: nowrap; transition: transform var(--t-fast);
}
.license-code .copy-btn:hover { transform: translateY(-1px); }

.kbd {
  font-family: var(--font-mono); font-size: 12px;
  background: var(--grey-100); border: 1px solid var(--grey-200);
  border-radius: 5px; padding: 2px 7px; color: var(--navy);
}

/* ---------- Empty states ---------- */
.empty {
  text-align: center; padding: 56px 20px; color: var(--grey);
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: var(--grey-100); color: var(--grey);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty h3 { color: var(--navy); margin-bottom: 6px; }
.empty p { color: var(--grey); margin-bottom: 16px; }

/* ---------- Toast / notification ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--white);
  padding: 12px 20px; border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }

/* ---------- Activity feed ---------- */
.activity { display: flex; flex-direction: column; gap: 12px; }
.activity-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--grey-200);
}
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); margin-top: 8px; flex-shrink: 0;
}
.activity-dot.green { background: var(--green); }
.activity-dot.red   { background: var(--red); }
.activity-text { flex: 1; font-size: 13.5px; color: var(--navy); line-height: 1.5; }
.activity-time { font-size: 12px; color: var(--grey); margin-top: 2px; }

/* ---------- Code block ---------- */
.code-block {
  background: var(--navy); color: rgba(255,255,255,.92);
  padding: 16px 18px; border-radius: 10px;
  font-family: var(--font-mono); font-size: 13px;
  overflow-x: auto; line-height: 1.6;
  border: 1px solid var(--navy-soft);
}
.code-block .comment { color: rgba(227,178,60,.7); }
.code-block .str { color: #ffd089; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 22px;
}
.tabs button {
  background: transparent; border: 0; cursor: pointer;
  padding: 10px 16px; font-size: 14px; font-weight: 600;
  color: var(--grey); border-bottom: 2px solid transparent;
  transition: all var(--t-fast);
}
.tabs button:hover { color: var(--navy); }
.tabs button.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Progress bar (fake upload) ---------- */
.progress {
  height: 8px; background: var(--grey-200); border-radius: 999px; overflow: hidden;
  margin: 8px 0;
}
.progress-bar {
  height: 100%; background: var(--gold); border-radius: 999px;
  transition: width .25s ease;
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.muted { color: var(--grey); }
.small { font-size: 12.5px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.between { justify-content: space-between; }
.center  { align-items: center; }
.divider { height: 1px; background: var(--grey-200); margin: 18px 0; }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: var(--grey-100); color: var(--grey-700);
}
