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

:root {
  color-scheme: dark;
  --accent: #aff200;
  --accent-hover: #c4ff33;
  --bg: #0a0d14;
  --bg-elevated: #12161c;
  --card: #1a1f2e;
  --card-hover: #222836;
  --text: #f5f7fb;
  --text-muted: #9aa6b2;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.12);
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg) !important;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Override styles.css rules that hide content */
body.admin-body main,
body.admin-body footer {
  opacity: 1 !important;
  visibility: visible !important;
}

body.admin-body {
  background: var(--bg) !important;
  margin: 0 !important;
}

/* Ensure admin panel elements are visible */
body.admin-body .admin-panel,
body.admin-body .admin-main,
body.admin-body .admin-sidebar,
body.admin-body .admin-content {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Login Screen */
.login-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0d14 0%, #1a1f2e 100%);
  z-index: 9999;
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: var(--card);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  max-width: 180px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
}

.login-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.login-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group label i {
  font-size: 1rem;
  color: var(--text-muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 242, 0, 0.1);
}

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

.login-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: -8px;
  display: none;
}

.login-error.show {
  display: block;
}

.login-footer {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.login-footer p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.login-footer code {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  color: var(--accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0d14;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
}

.btn-danger {
  color: var(--error, #ef4444);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--error, #ef4444);
}

.btn-edit {
  background: #3b82f6;
  color: #ffffff;
  border: none;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 15px;
}

.btn-edit:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-edit i {
  color: #ffffff !important;
}

.btn-delete {
  background: #ef4444;
  color: #ffffff;
  border: none;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 15px;
}

.btn-delete:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-delete i {
  color: #ffffff !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-edit.btn-sm,
.btn-delete.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn i {
  font-size: 1rem;
}

/* Admin Panel Layout */
.admin-panel {
  display: flex !important;
  min-height: 100vh !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Sidebar */
.admin-sidebar {
  width: 240px;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar-logo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sidebar-toggle:hover {
  background: var(--bg-elevated);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

.nav-category {
  margin-top: 2px;
}

.nav-category-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  margin: 0 6px;
}

.nav-category-btn:hover {
  color: var(--text);
}

.nav-category-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-category-btn span {
  flex: 1;
  min-width: 0;
}

.nav-category-chevron {
  font-size: 0.75rem;
  width: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

.nav-category.open .nav-category-chevron {
  transform: rotate(180deg);
}

.nav-category-items {
  display: flex;
  flex-direction: column;
  max-height: 0;
  margin-top: 0;
  padding-left: 6px;
  border-left: 1px solid var(--border);
  margin-left: 20px;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out, margin-top 0.2s ease-out;
}

.nav-category.open .nav-category-items {
  max-height: 400px;
  margin-top: 2px;
  opacity: 1;
}

.nav-category-items .nav-item {
  padding-left: 24px;
  margin-left: 0;
  border-left: none;
}

.nav-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 16px 6px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
}

.nav-group-label:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin: 0 6px 2px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  font-size: 0.875rem;
}

.nav-item:hover {
  color: var(--text);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-nav > .nav-item {
  margin: 2px 6px;
}

.nav-main-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin: 0 6px 2px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.nav-main-link:hover {
  color: var(--text);
}

.nav-main-link.active {
  color: var(--accent);
}

.nav-category-btn.active {
  color: var(--accent);
}

.nav-main-link .nav-category-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-section {
  margin: 4px 0;
}

.nav-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

.nav-section-header i {
  font-size: 0.85rem;
}

.nav-section-items {
  margin-top: 2px;
}

.nav-section-items .nav-item {
  padding-left: 24px;
}


/* Main Content */
.admin-main {
  flex: 1 !important;
  margin-left: 240px !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Topbar */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  backdrop-filter: blur(10px);
  background: rgba(26, 31, 46, 0.95);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: var(--bg-elevated);
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs span {
  color: var(--text);
  font-weight: 500;
}

.breadcrumbs button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  transition: var(--transition);
}

.breadcrumbs button:hover {
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Content Area */
.admin-content {
  position: relative;
  flex: 1 !important;
  padding: 20px !important;
  overflow-y: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.panel-loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 13, 20, 0.7);
  z-index: 100;
  backdrop-filter: blur(2px);
}

.panel-loading-spinner {
  font-size: 2rem;
  color: var(--accent);
  animation: panel-spin 0.8s linear infinite;
}

@keyframes panel-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.panel-lang-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.page-content {
  max-width: 1400px;
  margin: 0 auto;
}

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Dashboard */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 2px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dashboard-quick-actions {
  margin-top: 24px;
}

.dashboard-quick-actions h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.quick-action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-action-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-action-card i {
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.quick-action-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.quick-action-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Content Sections */
.content-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-actions {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-actions .btn {
  min-width: 140px;
}

.section-header-sub {
  margin-top: 20px;
  margin-bottom: 16px;
}

.content-section:hover {
  border-color: var(--border-hover);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.section-header {
  flex-wrap: wrap;
  gap: 16px;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-chat-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.live-chat-search-wrap .bi {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}

.live-chat-search-wrap .form-control {
  width: 260px;
  min-width: 200px;
  max-width: 100%;
  padding: 10px 16px 10px 40px;
  height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.live-chat-search-wrap .form-control::placeholder {
  color: var(--text-muted);
}

.live-chat-search-wrap .form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 242, 0, 0.12);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 4px;
}

/* Конфигурация на модули – подредени секции и редове */
.module-config-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.module-config-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

.module-config-row--basic .form-group,
.module-config-row--background .form-group {
  margin-bottom: 0;
}

.module-config-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.module-config-section--heading {
  margin-top: 4px;
}

.module-config-section--content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.module-config-section--content .module-faq-config-row-wrap,
.module-config-section--content .module-slides-container,
.module-config-section--content .module-features-container,
.module-config-section--content .module-faq-config-row-wrap + .form-group {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .module-config-row {
    grid-template-columns: 1fr;
  }
}

/* FAQ config – категории и въпроси едно до друго */
.module-faq-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 700px) {
  .module-faq-config-row {
    grid-template-columns: 1fr;
  }
}

.content-section .field-grid + .form-actions,
.content-section .field-grid + small + .form-actions,
.content-section > .form-actions {
  margin-top: 24px;
}

.field-full {
  grid-column: 1 / -1;
}

/* Collections */
.collection {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.collection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.collection-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: var(--transition);
}

.collection-item:hover {
  border-color: var(--border-hover);
}

.collection-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.collection-item-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.collection-item-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

/* Partners page – картички с текстови полета */
.partners-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.partners-cards-grid .collection-item {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.partners-cards-grid .collection-item-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.partners-cards-grid .collection-item .field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.partners-cards-grid .collection-item .form-group {
  margin: 0;
}

.partners-cards-grid .collection-item .form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.partners-cards-grid .collection-item .form-group input[type="text"],
.partners-cards-grid .collection-item .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--text);
}

.partners-cards-grid .collection-item .form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* FAQ config – категории и въпроси едно до друго */
.module-faq-config-row-wrap .module-faq-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 700px) {
  .module-faq-config-row-wrap .module-faq-config-row {
    grid-template-columns: 1fr;
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.home-tab-content {
  display: none;
}

.home-tab-content.active {
  display: block;
}

.home-tabs {
  margin-bottom: 20px;
}

/* Admin Games Grid */
.admin-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.admin-game-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.admin-game-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.admin-game-card-view {
  display: flex;
  flex-direction: column;
}

.admin-game-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
}

.admin-game-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-game-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-game-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-game-card-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: var(--transition);
  z-index: 10;
}

.admin-game-card:hover .admin-game-card-actions {
  opacity: 1;
}

.admin-game-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-game-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.admin-game-price {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.admin-game-platforms {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.admin-game-platforms i {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.admin-game-card-edit {
  padding: 20px;
}

.admin-game-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-game-edit-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.admin-game-edit-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.admin-game-edit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 242, 0, 0.1);
}

/* Game Details View */
.admin-game-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-game-details-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

/* Admin Plans Grid - Use same styles as frontend */
.admin-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* Import plan card styles from frontend */
.admin-plans-grid .plan-card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  overflow: visible;
}

.admin-plans-grid .plan-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.admin-plans-grid .plan-recommended {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft, rgba(175, 242, 0, 0.2));
}

.admin-plans-grid .plan-recommended:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-glow, rgba(175, 242, 0, 0.15));
}

.admin-plans-grid .plan-recommended-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #041118;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  z-index: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.admin-plans-grid .plan-background-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
  opacity: 0.3;
  filter: blur(10px);
  -webkit-filter: blur(10px);
}

.admin-plans-grid .plan-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  min-height: 200px;
}

.admin-plans-grid .admin-plan-card {
  position: relative;
}

.admin-plans-grid .plan-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-plans-grid .plan-header i {
  font-size: 1.8rem;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-plans-grid .plan-icon-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.admin-plans-grid .plan-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.admin-plans-grid .plan-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.admin-plans-grid .plan-pricing {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0;
}

.admin-plans-grid .plan-price-first {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  opacity: 0.7;
}

.admin-plans-grid .plan-price-strikethrough {
  text-decoration: line-through;
}

.admin-plans-grid .plan-savings {
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  margin-left: 8px;
}

.admin-plans-grid .plan-price-recurring {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 8px 0;
}

.admin-plans-grid .price-amount {
  font-size: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    #7cff00 25%,
    var(--accent) 50%,
    #7cff00 75%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glass-reflection 4s ease-in-out infinite;
  position: relative;
}

@keyframes glass-reflection {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.admin-plans-grid .price-period {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.admin-plans-grid .plan-processor {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 4px;
  font-weight: 500;
}

.admin-plans-grid .plan-specs {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 12px 0;
}

.admin-plans-grid .plan-spec-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-plans-grid .plan-spec-item:last-child {
  border-right: none;
}

/* Web Hosting cards: grid for 4–6+ params */
.admin-plans-grid .plan-card-webhosting .plan-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  gap: 10px 12px;
}

.admin-plans-grid .plan-card-webhosting .plan-spec-item {
  flex: none;
  border-right: none;
  padding: 4px 0;
  min-width: 0;
}

.admin-plans-grid .plan-spec-item i {
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.admin-plans-grid .spec-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.admin-plans-grid .plan-card-webhosting .spec-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-plans-grid .spec-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-plans-grid .plan-features-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.admin-plans-grid .plan-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.admin-plans-grid .plan-feature-item i {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

/* Admin Plan Card - extends frontend plan-card styles */
.admin-plan-card {
  /* Already has .plan-card class, inherits all styles */
}

.admin-plan-card[data-editing="true"] {
  grid-column: 1 / -1;
}

.admin-plan-card[data-editing="true"] .admin-plan-card-view {
  display: none;
}

/* Use frontend plan styles - admin-plan-card-view extends plan-card */
.admin-plan-card-view {
  /* Inherits all styles from .plan-card */
}

/* Admin plan card actions - positioned below instruction text */
.admin-plan-card-actions {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  opacity: 1;
  transition: var(--transition);
  z-index: 10;
}

.admin-plan-card-actions .btn {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-plan-card-actions .btn-edit {
  background: var(--accent);
  color: #041118;
}

.admin-plan-card-actions .btn-edit:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(175, 242, 0, 0.3);
}

.admin-plan-card-actions .btn-edit i,
.admin-plan-card-actions .btn-edit span {
  color: #041118 !important;
}

.admin-plan-card-actions .btn-delete {
  background: #dc3545;
  color: white;
  margin-left: auto;
}

.admin-plan-card-actions .btn-delete:hover {
  background: #c82333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.admin-plan-card-edit {
  grid-column: 1 / -1;
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
  box-shadow: 0 4px 16px rgba(175, 242, 0, 0.15);
}

.admin-plan-edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-plan-edit-header h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.admin-plan-edit-form textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.admin-plan-edit-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 242, 0, 0.1);
}


/* Responsive adjustments for plans grid */
@media (max-width: 768px) {
  .admin-plans-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .admin-plan-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .admin-plan-card-actions {
    bottom: 8px;
    right: 8px;
  }
  
  .admin-plan-specs {
    grid-template-columns: 1fr;
  }
}

/* Status Notification – top-right corner */
.status-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
}

.status-notification.show {
  display: flex;
}

.status-notification.success {
  border-left: 4px solid var(--success);
}

.status-notification.error {
  border-left: 4px solid var(--error);
}

.status-notification i {
  font-size: 1.25rem;
}

.status-notification.success i {
  color: var(--success);
}

.status-notification.error i {
  color: var(--error);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Confirm Modal */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.confirm-modal.show {
  display: flex;
}
.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.confirm-modal-box {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: confirmModalIn 0.2s ease;
}
@keyframes confirmModalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.confirm-modal-title {
  margin: 0 0 12px 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.confirm-modal-message {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Settings Cards */

/* Live Chat layout - sidebar + detail */
.live-chat-tickets-layout {
  display: flex;
  gap: 0;
  padding: 0;
  min-height: 500px;
}

.live-chat-sidebar {
  display: flex;
  flex-direction: column;
  width: 280px;
  min-width: 280px;
  border-right: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

.live-chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.live-chat-ticket-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.live-chat-ticket-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.live-chat-ticket-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.live-chat-ticket-item.active {
  background: rgba(175, 242, 0, 0.12);
  border-left: 3px solid var(--accent);
}

.live-chat-ticket-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.live-chat-ticket-item-id {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
}

.live-chat-ticket-item-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chat-ticket-item-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chat-ticket-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.live-chat-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.live-chat-detail-content {
  padding: 12px 16px;
}

/* Archived tickets - compact table */
.live-chat-archived-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.live-chat-archived-header {
  display: grid;
  grid-template-columns: 60px 1fr 140px 1fr;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.live-chat-archived-row {
  display: grid;
  grid-template-columns: 60px 1fr 140px 1fr;
  gap: 12px;
  padding: 12px 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.live-chat-archived-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.live-chat-archived-view-header {
  margin-bottom: 16px;
}

.live-chat-archived-view-content {
  padding: 0;
}

.live-chat-archived-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.live-chat-archived-id {
  color: var(--accent);
  font-weight: 600;
}

.live-chat-archived-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-chat-archived-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.live-chat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  border-top: 1px solid var(--border);
}

.live-chat-pagination-info {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.live-chat-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.live-chat-error {
  text-align: center;
  padding: 40px;
  color: var(--error);
}

.live-chat-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.live-chat-review-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.live-chat-review-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.live-chat-review-stars {
  color: var(--accent);
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.live-chat-review-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.live-chat-review-comment {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.ticket-card {
  min-width: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ticket-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ticket-card-id {
  background: var(--accent);
  color: #0a0d14;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
}

.ticket-card-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.ticket-card-assignee {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.ticket-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.ticket-card-actions .live-chat-ticket-assignee,
.ticket-card-actions .live-chat-ticket-status {
  padding: 8px 14px;
  padding-right: 32px;
  min-width: 140px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='%239aa6b2'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ticket-card-actions .live-chat-ticket-assignee:hover,
.ticket-card-actions .live-chat-ticket-status:hover {
  border-color: var(--border-hover);
}

.ticket-card-actions .live-chat-ticket-assignee:focus,
.ticket-card-actions .live-chat-ticket-status:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(175, 242, 0, 0.2);
}

.ticket-card-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.ticket-card-field-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ticket-card-field-value {
  font-weight: 500;
}

.ticket-chat-wrap {
  margin-bottom: 12px;
  min-height: 200px;
}

.ticket-chat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.ticket-messages {
  min-height: 280px;
  max-height: 440px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-taken-block {
  width: 100%;
  margin: 8px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ticket-taken-line {
  width: 100%;
  margin: 0;
  border: none;
  border-top: 1px solid var(--border);
}

.ticket-taken-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ticket-msg-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ticket-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 90%;
  min-width: 0;
}

.ticket-msg-row--user {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.ticket-msg-row--team {
  flex-direction: row;
  align-self: flex-start;
}

.ticket-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  padding: 1px;
  box-sizing: border-box;
  background: var(--border);
  border: 1px solid var(--border);
  flex-shrink: 0;
  align-self: flex-end;
}

.live-chat-team-avatar-preview-wrap {
  border: 1px solid var(--border);
}

.ticket-msg-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.ticket-msg-row--user .ticket-msg-group {
  align-items: flex-end;
}

.ticket-msg-bubble {
  max-width: 85%;
  min-width: 0;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.5;
}

.ticket-msg-bubble--user {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.ticket-msg-bubble--team {
  background: rgba(175, 242, 0, 0.2);
  border: 1px solid rgba(175, 242, 0, 0.15);
  color: var(--text);
}

.ticket-msg-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ticket-msg-image-wrap {
  position: relative;
  display: inline-block;
  margin-top: 4px;
}

.ticket-msg-image {
  max-width: 200px;
  max-height: 160px;
  border-radius: var(--radius-md);
  display: block;
  object-fit: contain;
  border: 1px solid var(--border);
}

.ticket-msg-image-expand {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.2s;
}

.ticket-msg-image-expand:hover {
  background: rgba(0, 0, 0, 0.7);
}

.ticket-image-overlay[hidden] {
  display: none !important;
}

.ticket-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ticket-image-overlay-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticket-image-overlay-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ticket-image-overlay-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.ticket-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ticket-reply-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ticket-reply-pending[hidden] {
  display: none !important;
}

.ticket-reply-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ticket-reply-pending-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
}

.ticket-reply-pending-label {
  flex: 1;
}

.ticket-reply-pending-remove {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--border);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.ticket-reply-pending-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.ticket-reply-attach-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

.ticket-reply-attach-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.ticket-reply-attach-btn:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.ticket-reply-form .ticket-reply-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  transition: var(--transition);
}

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

.ticket-reply-form .ticket-reply-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(175, 242, 0, 0.12);
}

.ticket-reply-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #0a0d14;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.ticket-reply-btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.ticket-reply-btn:active {
  transform: translateY(0);
}

.settings-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.settings-card h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 260px;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .sidebar-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .admin-content {
    padding: 12px 16px 24px;
  }

  .admin-topbar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .topbar-left {
    flex: 1 1 100%;
    min-width: 0;
  }

  .topbar-right {
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }

  .topbar-right .btn {
    min-height: 44px;
    padding: 10px 14px;
  }

  .breadcrumbs {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .quick-action-card {
    padding: 16px;
    min-height: auto;
  }

  .quick-action-card h3 {
    font-size: 1rem;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Предотвратява zoom на iOS */
  }

  .form-actions {
    flex-direction: column;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .admin-sidebar {
    width: 100%;
    max-width: 300px;
  }

  .settings-card {
    padding: 16px;
  }

  .settings-card h3 {
    font-size: 1.1rem;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .table-wrap table {
    min-width: 500px;
  }

  .map-modal {
    padding: 16px;
    align-items: flex-end;
  }

  .map-modal-content {
    max-height: 85vh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin-bottom: env(safe-area-inset-bottom, 0);
  }

  .confirm-modal-box {
    margin: 16px;
    max-width: calc(100% - 32px);
  }
}

@media (max-width: 480px) {
  .admin-content {
    padding: 12px;
  }

  .admin-topbar {
    padding: 12px;
  }

  .mobile-menu-toggle {
    padding: 10px;
    font-size: 1.4rem;
  }

  .stat-card {
    flex-direction: row;
    gap: 16px;
    padding: 14px;
  }

  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }
}

/* Карта с локации в панела */
.panel-map-wrap {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: crosshair;
}
.panel-map-wrap .world-map-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.panel-map-wrap .world-map-pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.panel-map-wrap .world-map-pins .map-pin-wrap {
  position: absolute;
  pointer-events: auto;
  transform: translate(-50%, -100%);
  z-index: 2;
  cursor: default;
}
.panel-map-wrap .map-pin {
  font-size: 1.35rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}
.panel-map-wrap .map-pin--premium { color: #3b82f6; }
.panel-map-wrap .map-pin--budget { color: var(--text-muted); }
.map-add-hint { font-weight: 500; }

.map-locations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-location-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.map-location-row .map-location-label {
  flex: 1;
  min-width: 120px;
  font-weight: 500;
}
.map-location-row .map-location-type {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
}
.map-location-row .map-location-actions {
  display: flex;
  gap: 6px;
}

/* Модал за нова/редакция локация */
.map-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.map-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.map-modal-content {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}
.map-modal-content h3 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}

/* News panel – card previews */
.news-panel-collection {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.news-panel-card-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.news-panel-card {
  display: flex;
  align-items: center;
  padding: 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.news-panel-card:hover {
  background: var(--card-hover);
}
.news-panel-card-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.news-panel-card-image {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}
.news-panel-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-panel-card-content {
  flex: 1;
  min-width: 0;
}
.news-panel-card-content h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.news-panel-card-excerpt {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.news-panel-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.news-panel-card-meta i {
  margin-right: 4px;
}
.news-panel-card-expand-icon {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.news-panel-card-edit {
  border-top: 1px solid var(--border);
  padding: 20px;
}
.news-edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.news-edit-form .form-group {
  margin: 0;
}
.news-lang-tabs-wrap label {
  display: block;
  margin-bottom: 8px;
}
.news-lang-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.news-lang-tab {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}
.news-lang-tab:hover {
  background: var(--bg-elevated);
  color: var(--text);
}
.news-lang-tab.active {
  background: var(--accent);
  color: #041118;
  border-color: var(--accent);
}
.news-content-field {
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 240px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.news-edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
}
