/* ==========================================================================
   SmartBot AI Admin Portal — Clean, Modern & Efficient Design System
   Unified with PostFusion AI Standard Layout, Colors & Typography
   ========================================================================== */

@import url("/css/dashboard.css?v=20261009_theme_v5");

:root, html {
  color-scheme: dark !important;
  --admin-accent: var(--cyan, #22d3ee);
  --admin-accent-glow: rgba(34, 211, 238, 0.25);
  --admin-card-bg: var(--surface, #101521);
  --admin-card-bg-subtle: var(--surface-2, #151b29);
  --admin-border: var(--line, #252d3e);
  --admin-border-focus: var(--cyan, #22d3ee);
  --admin-text-primary: var(--text, #f4f7fb);
  --admin-text-secondary: var(--muted, #8f9bb0);
  --admin-success: var(--green, #34d399);
  --admin-warning: var(--amber, #fbbf24);
  --admin-danger: var(--red, #fb7185);
}

body.admin-body {
  margin: 0;
  padding: 0;
  background-color: var(--bg, #080b12);
  color: var(--admin-text-primary);
  font-family: 'Plus Jakarta Sans', 'Inter', 'Noto Sans Khmer', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.admin-menu-open,
body.modal-open {
  overflow: hidden;
}

.admin-mobile-menu,
.admin-sidebar-overlay {
  display: none;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.admin-topbar {
  height: 64px;
  background: rgba(16, 21, 33, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.admin-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.admin-brand-text {
  display: flex;
  flex-direction: column;
}

.admin-brand-text strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-brand-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-brand-text small {
  font-size: 11.5px;
  color: var(--admin-text-secondary);
  font-weight: 500;
}

.admin-top-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-text-primary);
}

.admin-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--admin-success);
  box-shadow: 0 0 8px var(--admin-success);
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Language switch pill (Standard of Ai Sale Home Page) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  gap: 2px;
}
.lang-btn {
  background: none;
  border: none;
  padding: 5px 12px;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.lang-btn:hover {
  color: #fff;
}
.lang-btn.active {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  font-family: inherit;
}

.admin-btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}
.admin-btn-primary:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
  transform: translateY(-1px);
}

.admin-btn-accent {
  background: linear-gradient(135deg, #06b6d4 0%, #0ea5e9 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}
.admin-btn-accent:hover {
  background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
  transform: translateY(-1px);
}

.admin-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text-primary);
  border-color: var(--admin-border);
}
.admin-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.admin-btn-facebook {
  background: #1877f2;
  color: #fff;
}
.admin-btn-facebook:hover {
  background: #166fe5;
}

/* ==========================================================================
   APP SHELL & SIDEBAR
   ========================================================================== */
.admin-shell {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  width: 260px;
  background: var(--surface, #101521);
  border-right: 1px solid var(--admin-border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.admin-sidebar-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--admin-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px 8px;
  margin-top: 10px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--admin-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  margin-bottom: 4px;
  font-family: inherit;
}

.admin-nav-item i {
  font-size: 15px;
  width: 20px;
  text-align: center;
  color: var(--admin-text-secondary);
  transition: color 0.15s ease;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.admin-nav-item:hover i {
  color: var(--cyan);
}

.admin-nav-item.active {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #fff;
}
.admin-nav-item.active i {
  color: var(--cyan);
}

.admin-nav-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--admin-text-secondary);
}

.admin-sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--admin-border);
}

.admin-sidebar-card {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
}

.admin-sidebar-card strong {
  display: block;
  color: #fff;
  margin-bottom: 2px;
}

.admin-sidebar-card small {
  color: var(--admin-text-secondary);
  line-height: 1.4;
  display: block;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.admin-workspace {
  flex: 1;
  padding: 24px 32px 60px;
  max-width: 1380px;
  margin: 0 auto;
  width: 100%;
}

.admin-pane {
  display: none;
}
.admin-pane.active {
  display: block;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-page-title h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-page-title p {
  font-size: 12.5px;
  color: var(--admin-text-secondary);
  margin: 0;
}

.admin-page-actions {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.admin-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.admin-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  transition: border-color 0.2s ease;
}
.admin-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  line-height: 1.4;
}

.admin-card-title i {
  color: var(--cyan);
  font-size: 15px;
}

.admin-card-subtitle {
  font-size: 11.5px;
  color: var(--admin-text-secondary);
  margin: 4px 0 0 0;
  line-height: 1.5;
}

/* Status KPI Card */
.admin-stat-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.admin-stat-info strong {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: block;
}

.admin-stat-info span {
  font-size: 11.5px;
  color: var(--admin-text-secondary);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
  margin-bottom: 16px;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--admin-text-primary);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 11px;
  color: var(--admin-text-secondary);
  margin-top: 5px;
  display: block;
  line-height: 1.4;
}

/* Inputs & Textareas */
.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--admin-border);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--admin-border-focus);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

/* Dedicated Dropdown / Select Styling for Dark Mode */
select, .form-select {
  width: 100%;
  height: 42px !important;
  min-height: 42px !important;
  padding: 10px 38px 10px 14px;
  border-radius: 10px;
  background-color: #101521 !important;
  color: #f4f7fb !important;
  border: 1px solid var(--admin-border, #252d3e) !important;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s ease;
  box-sizing: border-box;
  color-scheme: dark !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2322d3ee' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
}

select:focus, .form-select:focus {
  outline: none;
  border-color: var(--cyan, #22d3ee) !important;
  background-color: #151b29 !important;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18) !important;
}

select option, .form-select option {
  background-color: #101521 !important;
  color: #ffffff !important;
  padding: 12px 14px !important;
  font-size: 13px !important;
}

select option:checked, .form-select option:checked {
  background-color: #1e293b !important;
  color: #22d3ee !important;
  font-weight: 700 !important;
}

select option:hover, .form-select option:hover {
  background-color: #1e293b !important;
  color: #22d3ee !important;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.form-input[readonly] {
  background: rgba(0, 0, 0, 0.25);
  color: #cbd5e1;
  cursor: default;
}

.input-with-button {
  display: flex;
  gap: 8px;
}
.input-with-button .form-input {
  flex: 1;
}

/* Password reveal input */
.password-input-wrap {
  position: relative;
}
.password-input-wrap .form-input {
  padding-right: 42px;
}
.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--admin-text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.password-toggle-btn:hover {
  color: #fff;
}

/* ==========================================================================
   MODERN TOGGLE SWITCHES
   ========================================================================== */
.admin-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  margin-bottom: 10px;
  transition: background 0.15s ease;
}
.admin-switch-row:last-child {
  margin-bottom: 0;
}
.admin-switch-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.switch-label-group {
  display: flex;
  flex-direction: column;
}
.switch-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.switch-desc {
  font-size: 11.5px;
  color: var(--admin-text-secondary);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.25s;
  border-radius: 24px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--cyan);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--admin-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.admin-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--admin-text-secondary);
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--admin-text-primary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   LIVE TEST CHAT SIMULATOR (Tab 6)
   ========================================================================== */
.simulator-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  height: calc(100vh - 180px);
  min-height: 580px;
}

.simulator-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.simulator-phone-frame {
  background: #000;
  border: 8px solid #1e293b;
  border-radius: 36px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
}

.sim-phone-header {
  height: 54px;
  background: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sim-phone-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sim-phone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.sim-phone-info strong {
  font-size: 12px;
  color: #fff;
  display: block;
}
.sim-phone-info small {
  font-size: 10px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sim-chat-body {
  flex: 1;
  background: #0b0f19;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: fadeIn 0.15s ease;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg.user {
  align-self: flex-end;
}

.chat-msg-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.bot .chat-msg-bubble {
  background: #1e293b;
  color: #f1f5f9;
  border-bottom-left-radius: 4px;
}

.chat-msg.user .chat-msg-bubble {
  background: #0084ff;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.quick-replies-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.quick-reply-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--cyan);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.quick-reply-chip:hover {
  background: rgba(34, 211, 238, 0.22);
  transform: translateY(-1px);
}

.sim-input-bar {
  padding: 10px 14px;
  background: #111827;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
}

.sim-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 8px 14px;
  color: #fff;
  font-size: 12px;
  outline: none;
}
.sim-input:focus {
  border-color: var(--cyan);
}

.sim-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0084ff;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.sim-send-btn:hover {
  background: #0073e6;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
#smartbot-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 12px;
  background: #101521;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid rgba(34, 211, 238, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(34, 211, 238, 0.25);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Modal styling matching Meta OAuth Dialog */
.meta-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.meta-modal-window {
  width: 520px;
  max-width: 95vw;
  background: #0f172a;
  color: #f1f5f9;
  border: 1px solid #1e293b;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.meta-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #1e293b;
  background: #0b0f19;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meta-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
}

.meta-modal-body {
  padding: 22px;
  color: #cbd5e1;
}

.meta-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #1e293b;
  background: #090d16;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.meta-modal-footer .admin-btn-secondary {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  font-weight: 700;
}
.meta-modal-footer .admin-btn-secondary:hover {
  background: #334155;
  color: #ffffff;
}


/* ==========================================================================
   AUTO SCAN & REVIVE POSTS STYLES
   ========================================================================== */
.revive-preset-btn {
  font-size: 11.5px;
  padding: 5px 12px;
  transition: all 0.2s ease;
}
.revive-preset-btn.active {
  background: rgba(6, 182, 212, 0.2) !important;
  color: #22d3ee !important;
  border-color: rgba(6, 182, 212, 0.5) !important;
}
.revive-subtab-btn {
  font-size: 12px;
  padding: 6px 14px;
  transition: all 0.2s ease;
}
.revive-subtab-btn.active {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #a5b4fc !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
}
.admin-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 1024px) {
  .admin-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .admin-grid-4 {
    grid-template-columns: 1fr;
  }
}
.stat-card {
  background: #0d1322;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: #334155;
}
.stat-icon {
  font-size: 22px;
  margin-bottom: 6px;
}
.stat-val {
  font-size: 26px;
  font-weight: 700;
  color: #f8fafc;
  font-family: 'Outfit', sans-serif;
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}
.badge-status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.badge-status-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}
.badge-status-error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

/* Permission management */
.permission-presets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(34, 211, 238, 0.06));
}

.permission-presets strong,
.permission-presets span {
  display: block;
}

.permission-presets strong {
  color: #f8fafc;
  font-size: 13px;
  margin-bottom: 3px;
}

.permission-presets strong i {
  color: #c084fc;
  margin-right: 5px;
}

.permission-presets span {
  color: #94a3b8;
  font-size: 11px;
}

.permission-preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.permission-preset-btn {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid #334155;
  background: #111827;
  color: #cbd5e1;
  font: 600 11.5px inherit;
  cursor: pointer;
}

.permission-preset-btn:hover,
.permission-preset-btn.active {
  color: #fff;
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.22);
}

.permission-enabled-count {
  display: inline-flex !important;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #67e8f9 !important;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.24);
  font-size: 10px !important;
  vertical-align: middle;
}

/* Responsive Admin shell */
@media (max-width: 1180px) {
  .admin-top-center {
    display: none;
  }

  .admin-workspace {
    padding-inline: 24px;
  }
}

@media (max-width: 1024px) {
  .admin-topbar {
    height: 60px;
    padding: 0 16px;
    gap: 12px;
  }

  .admin-mobile-menu {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
  }

  .admin-brand {
    margin-right: auto;
  }

  .admin-brand-text small,
  .admin-brand-badge,
  .admin-top-actions .admin-btn-secondary {
    display: none;
  }

  .admin-top-actions .admin-btn-primary {
    min-height: 42px;
    padding-inline: 13px;
  }

  .admin-shell {
    min-height: calc(100vh - 60px);
  }

  .admin-sidebar {
    position: fixed;
    z-index: 1300;
    left: 0;
    top: 60px;
    bottom: 0;
    height: auto;
    width: min(86vw, 300px);
    transform: translateX(-105%);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 18px 0 50px rgba(0, 0, 0, 0.45);
  }

  .admin-sidebar.is-open {
    transform: translateX(0);
  }

  .admin-sidebar-overlay {
    position: fixed;
    display: block;
    inset: 60px 0 0;
    z-index: 1200;
    border: 0;
    padding: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .admin-sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-nav-item {
    min-height: 46px;
  }

  .admin-workspace {
    max-width: none;
    padding: 22px 20px 48px;
  }

  .admin-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .simulator-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .admin-brand-text strong {
    font-size: 14px;
  }

  .admin-top-actions .admin-btn-primary {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .admin-top-actions .admin-btn-primary i {
    font-size: 15px;
  }

  .admin-workspace {
    padding: 18px 14px 40px;
  }

  .admin-page-header,
  .admin-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-page-title h2 {
    font-size: 18px;
    line-height: 1.45;
  }

  .admin-page-title p {
    line-height: 1.65;
  }

  .admin-page-actions,
  .admin-page-actions > * {
    width: 100%;
  }

  .admin-page-actions .admin-btn {
    min-height: 44px;
  }

  .admin-grid-2,
  .admin-grid-3,
  .simulator-layout {
    grid-template-columns: 1fr;
  }

  .simulator-layout {
    height: auto;
    min-height: 0;
  }

  .admin-card {
    padding: 16px;
    border-radius: 14px;
  }

  .admin-table-wrap {
    margin-inline: -16px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    scrollbar-width: thin;
  }

  .admin-table {
    min-width: 900px;
  }

  .admin-table th,
  .admin-table td {
    padding: 11px 12px;
  }

  .form-input,
  .form-textarea,
  .form-select {
    min-height: 44px;
    font-size: 16px !important;
  }

  .permission-presets {
    align-items: stretch;
    flex-direction: column;
  }

  .permission-preset-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .permission-preset-btn {
    min-height: 44px;
  }

  .permission-modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    border-radius: 14px !important;
  }

  .permission-modal > div:first-child,
  .permission-modal > div:last-child {
    padding: 14px 16px !important;
  }

  .permission-modal > div:nth-child(2) {
    padding: 16px !important;
  }

  .permission-modal > div:nth-child(2) > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .permission-modal > div:last-child {
    gap: 10px;
  }

  .permission-modal > div:last-child .admin-btn {
    min-height: 44px;
  }

  #smartbot-toast {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 420px) {
  .admin-brand-icon {
    width: 34px;
    height: 34px;
  }

  .admin-brand-text strong {
    font-size: 13px;
  }

  .admin-grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 13px 10px;
  }

  .stat-val {
    font-size: 22px;
  }

  .admin-switch-row {
    align-items: flex-start;
    gap: 12px;
  }

  .permission-modal > div:last-child {
    align-items: stretch !important;
    flex-direction: column-reverse;
  }

  .permission-modal > div:last-child > *,
  .permission-modal > div:last-child .admin-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-sidebar,
  .admin-sidebar-overlay,
  .admin-btn,
  .admin-card,
  .permission-preset-btn {
    scroll-behavior: auto;
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   ADMIN SEGMENTED SUBTABS & COMPACT BUTTONS
   ========================================================================== */
.admin-segmented-tabs {
  display: inline-flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(51, 65, 85, 0.7);
}

.admin-segmented-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.admin-segmented-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.05);
}

.admin-segmented-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.admin-segmented-btn .subtab-badge {
  background: #f59e0b;
  color: #fff;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 800;
}

.admin-btn-xs {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

/* ==========================================================================
   ADMIN MODAL SYSTEM (Center-Fixed, Backdrop Blur, Responsive)
   ========================================================================== */
.admin-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(3, 7, 18, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 2500 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  box-sizing: border-box !important;
}

.admin-modal-dialog {
  background: linear-gradient(135deg, #0b1120 0%, #0f172a 100%) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.12) !important;
  border-radius: 18px !important;
  width: 580px;
  max-width: 95vw !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  animation: adminModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#modal-admin-product .admin-modal-dialog {
  width: 780px !important;
}

#modal-admin-categories .admin-modal-dialog {
  width: 500px !important;
}

@keyframes adminModalPop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.admin-modal-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 16px 22px !important;
  background: #0b0f19 !important;
  border-bottom: 1px solid #1e293b !important;
  flex-shrink: 0 !important;
}

.admin-modal-header h3 {
  margin: 0 !important;
  font-size: 15.5px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.admin-modal-close {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #94a3b8 !important;
  font-size: 18px !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
}

.admin-modal-close:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
  transform: rotate(90deg);
}

.admin-modal-body {
  padding: 22px !important;
  color: #cbd5e1 !important;
  overflow-y: auto !important;
  flex: 1 !important;
  box-sizing: border-box !important;
}

.admin-modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  padding: 14px 22px !important;
  background: #090d16 !important;
  border-top: 1px solid #1e293b !important;
  flex-shrink: 0 !important;
}

/* ==========================================================================
   ADMIN PRODUCTS CATALOG & BILLS DARK LUXURY STYLING
   ========================================================================== */
.admin-products-grid,
.products-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.product-item-card {
  background: linear-gradient(145deg, #0f172a 0%, #111c33 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
  border-radius: 18px !important;
  padding: 18px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.product-item-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(56, 189, 248, 0.15) !important;
}

.prod-card-top {
  display: flex !important;
  gap: 14px !important;
  margin-bottom: 14px !important;
}

.prod-card-img {
  width: 76px !important;
  height: 76px !important;
  border-radius: 12px !important;
  object-fit: cover !important;
  background: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  flex-shrink: 0 !important;
}

.prod-card-details {
  flex: 1 !important;
  min-width: 0 !important;
}

.prod-card-title {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  margin: 0 0 4px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.prod-card-code {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #38bdf8 !important;
  font-family: monospace !important;
  margin-bottom: 6px !important;
}

.prod-card-prices {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
}

.prod-price-usd {
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #fbbf24 !important;
}

.prod-price-khr {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
}

.prod-keywords-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin-bottom: 12px !important;
}

.keyword-tag-pill {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  background: rgba(56, 189, 248, 0.1) !important;
  color: #7dd3fc !important;
  border: 1px solid rgba(56, 189, 248, 0.2) !important;
}

.prod-voice-reply-box {
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
}

.prod-voice-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 11.5px !important;
  color: #cbd5e1 !important;
}

.btn-play-voice {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  background: rgba(56, 189, 248, 0.2) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 11px !important;
  transition: all 0.2s !important;
  flex-shrink: 0 !important;
}

.btn-play-voice:hover {
  background: #38bdf8 !important;
  color: #0b1120 !important;
  transform: scale(1.08) !important;
}

.btn-play-voice.playing {
  background: #f43f5e !important;
  border-color: #fb7185 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6) !important;
  animation: pulse-voice 1.2s infinite ease-in-out !important;
}

@keyframes pulse-voice {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.prod-card-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.prod-stock-badge {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  background: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.prod-action-btns {
  display: flex !important;
  gap: 6px !important;
}

.btn-icon-action {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  font-size: 12px !important;
  transition: all 0.2s !important;
}

.btn-icon-action:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}

.btn-icon-action.danger:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #f87171 !important;
}

/* ==========================================================================
   PRODUCT EDIT MODAL DETAILED SECTIONS (Matching products.php?action=add)
   ========================================================================== */
.modal-section-box {
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 16px 18px !important;
  margin-bottom: 16px !important;
  transition: border-color 0.2s ease !important;
}

.modal-section-box:hover {
  border-color: rgba(56, 189, 248, 0.3) !important;
}

.modal-section-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: #f1f5f9 !important;
  margin-bottom: 14px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.modal-section-title i {
  font-size: 15px !important;
}

/* ==========================================================================
   CATEGORY MANAGER BUTTON & MODAL
   ========================================================================== */
#modal-admin-categories {
  z-index: 2800 !important;
}

.form-label-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 28px !important;
  height: 28px !important;
  margin-bottom: 6px !important;
  box-sizing: border-box !important;
}

.form-label-row .form-label {
  margin-bottom: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1.2 !important;
}

.admin-btn-cat-mgr {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 10px !important;
  height: 26px !important;
  box-sizing: border-box !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition: all 0.18s ease !important;
  font-family: inherit !important;
}

.admin-btn-cat-mgr:hover {
  background: rgba(56, 189, 248, 0.2) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
  transform: translateY(-1px) !important;
}

.cat-modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.cat-modal-item:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.35);
}

.cat-modal-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.cat-modal-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.cat-modal-name {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cat-modal-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ==========================================================================
   PHOTOS & VIDEOS MEDIA STYLES (Admin Add/Edit Product Modal)
   ========================================================================== */
.media-upload-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.media-btn-upload {
  height: 40px;
  min-width: 140px;
  padding: 0 16px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px dashed rgba(139, 92, 246, 0.5);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #c4b5fd;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
}

.media-btn-upload:hover {
  background: rgba(139, 92, 246, 0.28);
  border-color: #a78bfa;
  color: #fff;
  transform: translateY(-1px);
}

.media-url-group {
  flex: 1;
  min-width: 220px;
  display: flex;
  gap: 6px;
}

.media-url-group .form-input {
  height: 40px;
  font-size: 12.5px;
  padding: 0 12px;
}

.media-url-group .admin-btn {
  height: 40px;
  padding: 0 14px;
  font-size: 12px;
  white-space: nowrap;
}

.photos-help-text {
  color: #94a3b8;
  font-size: 11.5px;
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.media-items-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.media-thumb-card {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: #0b0f19;
  cursor: pointer;
  transition: all 0.15s ease;
}

.media-thumb-card:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.media-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-badge-primary {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #06b6d4;
  color: #021219;
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 0.5px;
}

.media-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: all 0.15s ease;
}

.media-remove-btn:hover {
  background: #dc2626;
  transform: scale(1.1);
}

/* Video Columns (2-Column Grid) */
.videos-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (max-width: 680px) {
  .videos-row-grid {
    grid-template-columns: 1fr;
  }
}

.video-col-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.video-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.video-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-size-limit {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.video-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.video-link-input {
  height: 38px !important;
  font-size: 12px !important;
  padding: 0 10px !important;
}

.video-add-link-btn {
  height: 38px !important;
  padding: 0 12px !important;
  font-size: 11.5px !important;
  white-space: nowrap !important;
}

.video-upload-bar-btn {
  height: 38px;
  width: 100%;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px dashed rgba(6, 182, 212, 0.35);
  color: #06b6d4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  font-family: inherit;
}

.video-upload-bar-btn:hover {
  background: rgba(6, 182, 212, 0.18);
  border-color: #06b6d4;
  color: #fff;
  transform: translateY(-1px);
}

.video-upload-bar-btn.howto {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.video-upload-bar-btn.howto:hover {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  color: #fff;
}

.video-items-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.video-item-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 11.5px;
  color: #cbd5e1;
  word-break: break-all;
}

.video-item-chip a {
  color: #38bdf8;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-item-chip a:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

.video-item-chip button {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  transition: color 0.15s;
}

.video-item-chip button:hover {
  color: #f87171;
}

/* Modal Header Preset Actions */
.admin-header-action-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  height: 32px !important;
  padding: 0 11px !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  font-family: inherit !important;
}

.admin-header-action-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.admin-header-action-btn:active {
  transform: translateY(0);
}

.preset-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 48px;
  margin-top: 8px;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  min-width: 280px;
  max-width: 330px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 10050;
  padding: 8px;
}

.preset-dropdown-header {
  font-size: 11px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
  padding: 6px 10px 4px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 4px;
}

.preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #e2e8f0;
  font-size: 12.5px;
  gap: 8px;
}

.preset-item:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.preset-item-delete {
  color: #64748b;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  font-size: 11px;
  cursor: pointer;
}

.preset-item-delete:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.15);
}

/* ==========================================================================
   Catalog AI Sale — API Clients & Access Control Custom Styles
   ========================================================================== */
.api-client-card {
  transition: all 0.25s ease;
}
.api-client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  border: 1px solid var(--sky);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 15px rgba(56, 189, 248, 0.3);
  padding: 14px 20px;
  border-radius: 12px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  animation: toastSlideUp 0.3s ease;
}

@keyframes toastSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}




/* Category filters active style */
#admin-prod-cat-filters .admin-btn.active {
  background: rgba(6, 182, 212, 0.2) !important;
  border-color: rgba(6, 182, 212, 0.6) !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.3) !important;
}
#modal-api-docs {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(3, 7, 18, 0.85) !important;
  backdrop-filter: blur(8px) !important;
  z-index: 3000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
}
