/* ═══════════════════════════════════════
   PANELS.CSS — page-specific styles
   Loaded only on panel, login, and error
   pages (NOT on index/home) to keep the
   base dashboard.css lean and reduce
   unused CSS on the landing page.
═══════════════════════════════════════ */

/* ══════════════════════════════════════
   PANEL PAGES (staff, customer, etc.)
══════════════════════════════════════ */
.panel-page {
  padding: 5rem 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.panel-page.media-page {
  max-width: 1600px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.panel-title-group {}

.panel-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.panel-title i {
  color: var(--red);
}

.panel-sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-top: .2rem;
}

/* ── Stats Row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 44px;
  height: 44px;
  background: rgba(230, 57, 70, .1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--red);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── Table ── */
.table-wrapper {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.table-toolbar-title {
  font-size: .9rem;
  font-weight: 600;
  color: var(--white);
}

.search-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .45rem .9rem;
  font-size: .825rem;
  width: 240px;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

.form-input {
  background: var(--bg3) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  color: var(--white) !important;
  padding: .55rem 1rem;
  font-size: .9rem;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px var(--red-glow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  padding: .75rem 1.25rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

td {
  padding: .9rem 1.25rem;
  font-size: .85rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(255, 255, 255, .02);
}

.td-name {
  font-weight: 500;
  font-family: monospace;
  font-size: .8rem;
  color: var(--text-muted);
}

.td-date {
  color: var(--text-muted);
  font-size: .8rem;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .8rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--white);
  border-color: var(--text-muted);
}

.btn-icon.red:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ── Forms ── */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .4rem;
}

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .65rem 1rem;
  font-size: .875rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%238a8a9a' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  display: none;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  position: relative;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: .25rem;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--white);
  background: var(--bg4);
}

/* ── Upload Area ── */
.upload-zone {
  background: var(--bg3);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--red);
  background: rgba(230, 57, 70, .05);
}

.upload-zone-icon {
  font-size: 2.5rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.upload-zone-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: .25rem;
}

.upload-zone-sub {
  font-size: .825rem;
  color: var(--text-muted);
}

/* Progress Bar */
.progress-bar-wrap {
  background: var(--bg4);
  border-radius: 20px;
  overflow: hidden;
  height: 6px;
  margin-top: .75rem;
}

.progress-bar {
  height: 100%;
  background: var(--red);
  border-radius: 20px;
  width: 0%;
  transition: width .3s ease;
}

/* ── Alerts ── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1rem;
}

.alert-success {
  background: rgba(34, 197, 94, .1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, .2);
}

.alert-danger {
  background: rgba(230, 57, 70, .1);
  color: var(--red);
  border: 1px solid rgba(230, 57, 70, .2);
}

.alert-info {
  background: rgba(99, 179, 237, .1);
  color: #63b3ed;
  border: 1px solid rgba(99, 179, 237, .2);
}

/* ── Credits Display ── */
.credits-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(230, 57, 70, .15), rgba(230, 57, 70, .05));
  border: 1px solid rgba(230, 57, 70, .3);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
}

.credits-number {
  font-size: 3rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.credits-label {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ── License Card ── */
.license-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.license-key {
  font-family: monospace;
  font-size: .95rem;
  background: var(--bg3);
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--red);
  letter-spacing: .04em;
  word-break: break-all;
  margin: .5rem 0;
}

.expiry-bar {
  background: var(--bg4);
  border-radius: 20px;
  overflow: hidden;
  height: 8px;
  margin: .5rem 0;
}

.expiry-fill {
  height: 100%;
  border-radius: 20px;
  background: var(--red);
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .4rem;
}

/* ── Video Grid ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.video-card {
  background: #111;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card.pinned {
  border-color: #ffd600;
  box-shadow: 0 0 0 1px rgba(255, 214, 0, .25);
}

.drag-handle {
  text-align: center;
  padding: 2px 0 6px;
  color: rgba(255,255,255,.2);
  cursor: grab;
  font-size: 0.75rem;
  transition: color .15s;
  user-select: none;
}

.drag-handle:hover {
  color: rgba(255,255,255,.5);
}

.drag-handle:active {
  cursor: grabbing;
}

.video-card.pinned .drag-handle {
  display: none;
}

.sortable-ghost {
  opacity: 0.35;
  outline: 2px dashed var(--red);
  border-radius: 8px;
}

.pin-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #ffd600;
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.btn-icon.pin-btn {
  background: var(--bg4);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-icon.pin-btn:hover {
  background: rgba(255, 214, 0, .15);
  color: #ffd600;
  border-color: rgba(255, 214, 0, .4);
}

.btn-icon.pin-btn.active {
  background: rgba(255, 214, 0, .2);
  color: #ffd600;
  border-color: rgba(255, 214, 0, .5);
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(211, 47, 47, 0.35);
}

.video-card.pinned:hover {
  box-shadow: 0 6px 20px rgba(255, 214, 0, .25);
}

.video-card .yt-ratio {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 4px;
}

.video-card .yt-ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 8px;
}

.video-meta {
  min-width: 0;
  flex: 1;
}

.video-url-label {
  color: #aaa;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-card .btn-icon.red {
  background: #8b0000;
  border: none;
  color: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.video-card .btn-icon.red:hover {
  background: #d32f2f;
}

.yt-url-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 16px; /* Aumentamos 1px el padding vertical para mejor balance */
  background: var(--bg4);
  
  /* Borde más sutil para que no "brille" tanto en reposo */
  border: 1px solid rgba(255, 255, 255, 0.05); 
  
  color: var(--text);
  font-size: 0.9rem;
  border-radius: var(--radius);
  outline: none;
  
  /* Transición más suave usando ease-in-out */
  transition: all 0.2s ease-in-out;
  font-family: inherit;
  
  /* Añadimos un sombreado interno para dar profundidad (look "hollow") */
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.yt-url-input:focus {
  border-color: var(--red);
  
  /* El glow debe ser sutil. Si var(--red-glow) es muy opaca, usa rgba */
  box-shadow: 0 0 0 3px var(--red-glow), 
              inset 0 1px 2px rgba(0, 0, 0, 0.4);
  
  /* Un ligero cambio de fondo al hacer foco ayuda a la usabilidad */
  background: var(--bg3); 
}

.yt-url-input::placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  /* El placeholder un poco más transparente para no distraer */
  opacity: 0.6; 
}

.yt-url-input:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

@media (max-width: 960px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* ── Reseller Grid ── */
@media (max-width: 768px) {
  .reseller-grid { grid-template-columns: 1fr !important; }
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.credits-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}

.credits-label {
  color: var(--text-muted);
  font-size: .8rem;
  margin-top: .2rem;
}

/* ── History Table ── */
.history-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 680px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .825rem;
}

.history-type {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  flex-shrink: 0;
}

.history-add {
  background: rgba(34, 197, 94, .15);
  color: #22c55e;
}

.history-spend {
  background: rgba(230, 57, 70, .15);
  color: var(--red);
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 60% 60% at 50% 50%, rgba(230, 57, 70, .12) 0%, transparent 70%),
    var(--bg);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .4);
}

.login-logo {
  width: 72px;
  height: 72px;
  background: var(--red);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px var(--red-glow);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .5rem;
}

.login-sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}

.btn-discord {
  background: #5865F2;
  color: #fff;
  width: 100%;
  justify-content: center;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  font-size: .95rem;
  box-shadow: 0 4px 16px rgba(88, 101, 242, .3);
}

.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
}

/* ── Error Page ── */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-code {
  font-size: 7rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  opacity: .25;
}

.error-message {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
  margin: 1rem 0 .5rem;
}

.error-sub {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 2rem;
}

/* ── Responsive — panel elements ── */
@media (max-width: 768px) {
  .panel-page {
    padding: 4rem 1.25rem 2rem;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .credits-number {
    font-size: 2.5rem;
  }

  .search-input {
    width: 100%;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}}

/* ════════════════════════════════════════════════════════════════
   STAFF PANEL — Sub-navigation
════════════════════════════════════════════════════════════════ */
.staff-subnav {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .4rem;
}

.staff-subnav-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem 1.15rem;
  border-radius: calc(var(--radius) - 3px);
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
}

/* Icon bubble */
.snav-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  background: transparent;
  color: inherit;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.staff-subnav-item:hover {
  color: var(--white);
}

.staff-subnav-item:hover .snav-icon {
  background: color-mix(in srgb, var(--snav-color, var(--red)) 18%, transparent);
  color: var(--snav-color, var(--red));
}

/* Active state */
.staff-subnav-item.active {
  background: color-mix(in srgb, var(--snav-color, var(--red)) 12%, transparent);
  color: var(--white);
}

.staff-subnav-item.active .snav-icon {
  background: color-mix(in srgb, var(--snav-color, var(--red)) 22%, transparent);
  color: var(--snav-color, var(--red));
}

/* Bottom indicator line */
.staff-subnav-item.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  border-radius: 99px;
  background: var(--snav-color, var(--red));
  box-shadow: 0 0 6px var(--snav-color, var(--red));
}

/* ─── Log feed ─────────────────────────────────────────────────── */
.log-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.25rem;
}

.log-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .38rem .9rem;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .13s, color .13s, border-color .13s;
}

.log-filter-btn:hover   { background: var(--surface2); color: var(--white); }
.log-filter-btn.active  { border-color: currentColor; }

.log-filter-btn[data-cat="all"]        { color: var(--white); }
.log-filter-btn[data-cat="moderation"] { color: #c0392b; }
.log-filter-btn[data-cat="members"]    { color: #27ae60; }
.log-filter-btn[data-cat="channels"]   { color: #2980b9; }
.log-filter-btn[data-cat="roles"]      { color: #8e44ad; }
.log-filter-btn[data-cat="emojis"]     { color: #e67e22; }
.log-filter-btn[data-cat="messages"]   { color: #95a5a6; }
.log-filter-btn[data-cat="voice"]      { color: #16a085; }

.log-filter-btn.active { background: color-mix(in srgb, currentColor 18%, transparent); }

.log-entry-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-moderation { background: #c0392b; }
.dot-members    { background: #27ae60; }
.dot-channels   { background: #2980b9; }
.dot-roles      { background: #8e44ad; }
.dot-emojis     { background: #e67e22; }
.dot-messages   { background: #95a5a6; }
.dot-voice      { background: #16a085; }

.log-details-cell {
  font-size: .78rem;
  color: var(--text-muted);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-load-more {
  width: 100%;
  margin-top: 1.25rem;
  padding: .65rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.log-load-more:hover { background: var(--surface2); color: var(--white); }
.log-load-more:disabled { opacity: .45; cursor: default; }

@media (max-width: 600px) {
  .staff-subnav { gap: .2rem; }
  .staff-subnav-item { padding: .45rem .7rem; font-size: .82rem; }
  .snav-label { display: none; }
  .staff-subnav-item { justify-content: center; }
  .snav-icon { width: 30px; height: 30px; font-size: .9rem; }
  .log-details-cell { max-width: 160px; }
}

/* ════════════════════════════════════════════════════════════════
   STAFF DASHBOARD — Section cards
════════════════════════════════════════════════════════════════ */
.staff-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

.staff-dash-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}

/* Subtle left accent bar using the card colour */
.staff-dash-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--sdc-color, var(--red));
  border-radius: var(--radius) 0 0 var(--radius);
  opacity: 0;
  transition: opacity .18s;
}

.staff-dash-card:hover {
  background: var(--bg3);
  border-color: color-mix(in srgb, var(--sdc-color, var(--red)) 40%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}

.staff-dash-card:hover::before { opacity: 1; }

/* Icon wrap */
.sdc-icon-wrap {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--sdc-color, var(--red)) 14%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sdc-color, var(--red));
  font-size: 1.25rem;
  transition: background .18s;
}

.staff-dash-card:hover .sdc-icon-wrap {
  background: color-mix(in srgb, var(--sdc-color, var(--red)) 24%, transparent);
}

/* Text */
.sdc-body { flex: 1; min-width: 0; }

.sdc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: .25rem;
}

.sdc-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Arrow */
.sdc-arrow {
  color: var(--text-muted);
  font-size: .85rem;
  transition: color .18s, transform .18s;
  flex-shrink: 0;
}

.staff-dash-card:hover .sdc-arrow {
  color: var(--sdc-color, var(--red));
  transform: translateX(3px);
}

@media (max-width: 600px) {
  .staff-dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Store Integration ── */
.store-page {
  max-width: 1500px;
}

.store-frame-shell {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 760px;
}

.store-frame {
  display: block;
  width: 100%;
  height: min(82vh, 980px);
  min-height: 760px;
  border: 0;
  background: var(--bg);
}

.store-empty {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.store-empty code {
  color: var(--white);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .12rem .35rem;
}

.store-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.store-product-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.store-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.store-product-head h2 {
  color: var(--white);
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 .45rem;
}

.store-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  color: var(--text-muted);
  font-size: .78rem;
}

.store-status {
  border: 1px solid rgba(34, 197, 94, .4);
  background: rgba(34, 197, 94, .12);
  color: #22c55e;
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.store-variant-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.store-variant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .85rem;
}

.store-variant-name {
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.store-variant-stock {
  color: var(--text-muted);
  font-size: .76rem;
  margin-top: .18rem;
}

.store-variant-actions {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.store-price {
  min-width: 92px;
  text-align: right;
  color: var(--white);
  line-height: 1.2;
}

.store-price strong {
  display: block;
  font-size: .9rem;
}

.store-price-slash {
  display: block;
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: .72rem;
}

.store-checkout-btn[disabled] {
  opacity: .7;
  cursor: wait;
  transform: none;
}

.store-iframe-details {
  margin-top: 1.25rem;
}

.store-iframe-details summary {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  margin-bottom: .8rem;
}

.store-iframe-details summary:hover {
  color: var(--white);
}

@media (max-width: 768px) {
  .store-product-grid {
    grid-template-columns: 1fr;
  }

  .store-variant-row,
  .store-variant-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .store-variant-actions {
    display: grid;
  }

  .store-price {
    min-width: 0;
    text-align: left;
  }

  .store-frame-shell,
  .store-frame {
    min-height: 640px;
  }
}

/* ════════════════════════════════════════════════════════════════
   DISCORD-STYLE MENTION BADGES
════════════════════════════════════════════════════════════════ */
.mention-user,
.mention-channel,
.mention-role,
.mention-emoji {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: .1rem .4rem;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: default;
  transition: background .12s;
}

/* @user — blurple */
.mention-user {
  background: rgba(88, 101, 242, 0.2);
  color: #bdc8f7;
}
.mention-user:hover { background: rgba(88, 101, 242, 0.35); }

/* #channel — blue */
.mention-channel {
  background: rgba(88, 101, 242, 0.15);
  color: #7289da;
}
.mention-channel:hover { background: rgba(88, 101, 242, 0.28); }

/* @role — purple */
.mention-role {
  background: rgba(142, 68, 173, 0.2);
  color: #c39bd3;
}
.mention-role:hover { background: rgba(142, 68, 173, 0.33); }

/* :emoji: — orange */
.mention-emoji {
  background: rgba(230, 126, 34, 0.18);
  color: #e59866;
}
.mention-emoji:hover { background: rgba(230, 126, 34, 0.3); }

/* ════════════════════════════════════════════════════════════════
   TICKET CHAT
════════════════════════════════════════════════════════════════ */
.tc-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 62px); /* below navbar */
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Header ───────────────────────────────────────────── */
.tc-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tc-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: var(--bg3);
  border: 1px solid var(--border);
  font-size: .9rem;
  text-decoration: none;
  transition: color .15s, background .15s;
}
.tc-back-btn:hover { color: var(--white); background: var(--bg4); }

.tc-header-info { display: flex; align-items: center; gap: .6rem; }

.tc-header-name {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .35rem;
  color: var(--white);
}
.tc-header-name .fa-hashtag { color: var(--text-muted); font-size: .85rem; }

.tc-header-badge {
  font-size: .72rem;
  padding: .15rem .5rem;
  border-radius: 30px;
  background: rgba(255,255,255,.07);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.tc-header-user { font-size: .82rem; color: var(--text-muted); white-space: nowrap; }

/* ── Feed ─────────────────────────────────────────────── */
.tc-feed {
  flex: 1;
  overflow-y: auto;
  padding: .5rem 0 .25rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}
.tc-feed::-webkit-scrollbar { width: 6px; }
.tc-feed::-webkit-scrollbar-track { background: transparent; }
.tc-feed::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }

.tc-load-more-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .35rem .9rem;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tc-load-more-btn:hover { background: var(--bg4); color: var(--white); }

/* ── Message ──────────────────────────────────────────── */
.tc-msg {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .45rem .5rem;
  border-radius: 6px;
  position: relative;
}
.tc-msg:hover { background: rgba(255,255,255,.025); }
.tc-msg:hover .tc-msg-reply-btn { opacity: 1; }

.tc-msg--compact {
  padding-top: .1rem;
  padding-bottom: .1rem;
  padding-left: calc(.5rem + 40px + .75rem); /* avatar width + gap */
  align-items: center;
}

.tc-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg4);
}

.tc-msg-body { flex: 1; min-width: 0; }
.tc-msg-header { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .15rem; }
.tc-msg-name { font-weight: 700; font-size: .9rem; color: var(--white); }
.tc-msg-ts { font-size: .71rem; color: var(--text-muted); cursor: default; }

.tc-msg-text {
  font-size: .9rem;
  line-height: 1.55;
  word-break: break-word;
  color: #dcddde;
}
.tc-msg-text br { display: block; content: ''; margin: .05em 0; }
.tc-inline-code {
  background: #2f3136;
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .82rem;
  font-family: 'Consolas', 'Courier New', monospace;
  color: #f8f8f2;
}

.tc-code-block {
  margin-top: .45rem;
  background: #1e1f22;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: .7rem .8rem;
  font-size: .82rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: #dcddde;
  font-family: 'Consolas', 'Courier New', monospace;
}

.tc-msg-text blockquote,
.tc-embed-description blockquote,
.tc-embed-field-value blockquote,
.tc-embed-footer blockquote {
  margin: .35rem 0;
  padding-left: .7rem;
  border-left: 3px solid rgba(255,255,255,.25);
  color: #b9bbbe;
}

/* compact timestamp shown on hover */
.tc-msg--compact .tc-msg-compact-ts {
  position: absolute;
  left: .5rem;
  font-size: .68rem;
  color: var(--text-muted);
  opacity: 0;
  white-space: nowrap;
  transition: opacity .12s;
  width: 40px;
  text-align: center;
}
.tc-msg--compact:hover .tc-msg-compact-ts { opacity: 1; }

/* reply ref */
.tc-reply-ref {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .2rem;
  padding-left: .6rem;
  border-left: 2px solid rgba(255,255,255,.15);
  cursor: default;
}
.tc-reply-ref-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}

/* attachments */
.tc-attachment { margin-top: .4rem; }
.tc-attachment img {
  max-width: 350px;
  max-height: 280px;
  border-radius: 8px;
  cursor: zoom-in;
  border: 1px solid var(--border);
  display: block;
}
.tc-attachment-file a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #7289da;
  text-decoration: none;
  font-size: .85rem;
}
.tc-attachment-file a:hover { background: var(--bg3); text-decoration: underline; }

/* reply button on hover */
.tc-msg-reply-btn {
  background: var(--bg4);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: .25rem .5rem;
  font-size: .75rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s, color .12s;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: .2rem;
}
.tc-msg-reply-btn:hover { color: var(--white); }

/* ── Input Wrap ───────────────────────────────────────── */
.tc-input-wrap {
  flex-shrink: 0;
  padding: .5rem 0 1rem;
}

.tc-reply-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .9rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: .82rem;
  color: var(--text-muted);
}
.tc-reply-bar strong { color: var(--white); }
.tc-reply-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 400px; font-style: italic; }
.tc-reply-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  font-size: .85rem;
  padding: .2rem .3rem;
  border-radius: 4px;
  transition: color .12s;
  flex-shrink: 0;
}
.tc-reply-cancel:hover { color: var(--white); }

.tc-input-box {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: visible;
  position: relative;
}
.tc-reply-bar + .tc-input-box { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

.tc-input-area {
  display: flex;
  align-items: flex-end;
  padding: .4rem .5rem;
  gap: .4rem;
}

.tc-attach-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .12s, background .12s;
  flex-shrink: 0;
}
.tc-attach-label:hover { color: var(--white); background: rgba(255,255,255,.06); }

.tc-input-inner { flex: 1; min-width: 0; }

.tc-file-preview {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .6rem .15rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin: .2rem .2rem 0;
  background: rgba(255,255,255,.03);
  border-radius: 4px 4px 0 0;
}

.tc-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: .9rem;
  line-height: 1.5;
  resize: none;
  min-height: 38px;
  max-height: 200px;
  padding: .4rem .4rem;
  font-family: inherit;
  overflow-y: auto;
}
.tc-textarea::placeholder { color: var(--text-muted); }

.tc-send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--red);
  border: none;
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.tc-send-btn:hover { background: var(--red-dark); }
.tc-send-btn:active { transform: scale(.93); }
.tc-send-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Mention Dropdown ─────────────────────────────────── */
.tc-mention-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
}

.tc-mention-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .88rem;
  transition: background .1s;
}
.tc-mention-item:hover,
.tc-mention-item.active { background: rgba(255,255,255,.07); }

.tc-mention-av {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────
   Ticket embed rendering
───────────────────────────────────────────────────── */
.tc-embed {
  margin-top: .75rem;
  display: block;
  width: fit-content;
  max-width: min(100%, 520px);
  border: 1px solid rgba(79, 84, 92, .45);
  border-left: 4px solid var(--embed-color, #4f545c);
  border-radius: 4px;
  background: #2b2d31;
  overflow: hidden;
  box-shadow: none;
}
.tc-embed-author,
.tc-embed-footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem .35rem;
  color: #b9bbbe;
  font-size: .75rem;
}
.tc-embed-author-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}
.tc-embed-title {
  padding: 0 .8rem;
  margin-bottom: .2rem;
  font-weight: 700;
  font-size: .96rem;
  color: #fff;
}
.tc-embed-description {
  padding: 0 .8rem .45rem;
  color: #d3d4d6;
  font-size: .9rem;
  line-height: 1.42;
}
.tc-embed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .6rem;
  padding: 0 .8rem .6rem;
}
.tc-embed-field {
  min-width: 100%;
}
.tc-embed-field-inline { min-width: calc(50% - .35rem); }
.tc-embed-field-name {
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: .2rem;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.tc-embed-field-value {
  color: #d3d4d6;
  font-size: .85rem;
  line-height: 1.35;
}
.tc-embed-thumbnail,
.tc-embed-image {
  width: 100%;
  max-height: 300px;
  overflow: hidden;
}
.tc-embed-thumbnail img,
.tc-embed-image img {
  width: 100%;
  display: block;
  object-fit: cover;
}
.tc-embed-footer {
  padding-top: .35rem;
  padding-bottom: .55rem;
  font-size: .72rem;
  color: #8a8a9a;
}

.tc-embed-footer-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.tc-embed-footer-sep {
  opacity: .65;
}

.tc-msg-text a,
.tc-embed-description a,
.tc-embed-field-value a,
.tc-embed-footer a {
  color: #00a8fc;
  text-decoration: none;
}

.tc-msg-text a:hover,
.tc-embed-description a:hover,
.tc-embed-field-value a:hover,
.tc-embed-footer a:hover {
  text-decoration: underline;
}
