/* ==========================================================================
   SiteCraft Studio — Master Application Stylesheet
   Minimalist, Modern SaaS UI
   ========================================================================== */

:root {
  --app-bg: #090d16;
  --app-surface: #0f172a;
  --app-surface-subtle: #141f36;
  --app-border: #1e293b;
  --app-border-strong: #334155;
  --app-text: #f8fafc;
  --app-text-muted: #94a3b8;
  --app-text-light: #64748b;
  
  --brand-primary: #3b82f6;
  --brand-hover: #2563eb;
  --brand-light: rgba(59, 130, 246, 0.16);
  
  /* Legacy CSS variable aliases for backward compatibility */
  --primary-color: #3b82f6;
  --text-secondary: #94a3b8;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --surface-secondary: #141f36;
  --surface-color: #0f172a;
  --bg-color: #090d16;
  --text-color: #f8fafc;
  
  --danger-color: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.2);
  --success-color: #10b981;
  --success-light: rgba(16, 185, 129, 0.2);
  --warning-color: #f59e0b;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 28px -4px rgba(0, 0, 0, 0.6), 0 6px 12px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 25px 40px -5px rgba(0, 0, 0, 0.7), 0 10px 18px -5px rgba(0, 0, 0, 0.5);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--app-bg);
  color: var(--app-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   BUTTONS & COMMON UI
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
  text-decoration: none;
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #141f36;
  color: #f8fafc;
  border-color: #27354f;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.btn-secondary:hover {
  background-color: #1c2b48;
  border-color: #3b82f6;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost {
  background-color: transparent;
  color: #94a3b8;
}
.btn-ghost:hover {
  background-color: #141f36;
  color: #f8fafc;
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.5);
  transform: translateY(-1px);
}

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
  background-color: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
}
.btn-icon:hover:not(:disabled) {
  background-color: #141f36;
  color: #f8fafc;
  border-color: #27354f;
}
.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.text-danger {
  color: var(--danger-color) !important;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: 6px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--app-text-muted);
  margin-top: 4px;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  font-family: inherit;
  font-size: 0.875rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
  background-color: #0b1120;
  color: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: #475569;
}

.form-select option {
  background-color: #0f172a;
  color: #f8fafc;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand-primary);
  background-color: #0e1629;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-textarea {
  resize: vertical;
}

.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.form-range {
  width: 100%;
  accent-color: var(--brand-primary);
  cursor: pointer;
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background-color: #0b1120;
  border: 1px solid #1e293b;
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}

.seg-btn {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.seg-btn.active {
  background-color: #1e293b;
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   DASHBOARD VIEW (Dark Studio Redesign)
   ========================================================================== */

.dashboard-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #080c16;
  background-image: 
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(37, 99, 235, 0.22), transparent 70%),
    radial-gradient(ellipse 70% 45% at 90% 15%, rgba(139, 92, 246, 0.15), transparent 60%),
    radial-gradient(circle at 10% 70%, rgba(59, 130, 246, 0.08), transparent 45%);
  background-attachment: fixed;
}

.dashboard-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.dashboard-header {
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 30;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.dashboard-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(37, 99, 235, 0.4);
}

.logo-title-group {
  display: flex;
  flex-direction: column;
}

.logo-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.logo-tagline {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

/* Hero Banner */
.dash-hero-banner {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 56px;
  padding: 24px 16px 0;
}

.dash-hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background-color: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.25);
  backdrop-filter: blur(8px);
}

.dash-hero-title {
  font-size: clamp(2.2rem, 4vw, 3.3rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 20%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 18px;
}

.dash-hero-subtitle {
  font-size: 1.125rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.dash-hero-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Dashboard Sections */
.dashboard-section {
  margin-bottom: 48px;
}

.dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.dash-sec-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.dash-sec-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
}

/* Category Filter Pills */
.category-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.cat-pill {
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1px solid #1e293b;
  background-color: #111827;
  color: #94a3b8;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cat-pill:hover {
  border-color: #3b82f6;
  background-color: #172138;
  color: #f8fafc;
  transform: translateY(-1px);
}

.cat-pill.active {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(37, 99, 235, 0.5);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background-color: #0f172a;
  border-radius: var(--radius-md);
  border: 1px solid #1e293b;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}

.project-card-image {
  position: relative;
  height: 160px;
  background-color: #090d16;
  overflow: hidden;
}

.project-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-card-image img {
  transform: scale(1.04);
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(9, 13, 22, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.project-card:hover .project-card-overlay {
  opacity: 1;
}

.project-card-body {
  padding: 16px;
  background-color: #0f172a;
}

.project-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.project-card-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 12px;
}

.project-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border-top: 1px solid #1e293b;
  padding-top: 10px;
}

/* Templates Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.template-gallery-card {
  background-color: #0f172a;
  border-radius: var(--radius-lg);
  border: 1px solid #1e293b;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.template-gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 24px rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
}

.template-image-box {
  position: relative;
  height: 220px;
  background-color: #090d16;
  overflow: hidden;
}

.template-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.template-gallery-card:hover .template-image-box img {
  transform: scale(1.05);
}

.template-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.template-hover-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(9, 13, 22, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.template-gallery-card:hover .template-hover-overlay {
  opacity: 1;
}

.template-content-box {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #0f172a;
}

.template-cat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.template-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.template-desc {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
  flex: 1;
}

.dashboard-footer {
  margin-top: auto;
  border-top: 1px solid #1e293b;
  background-color: #070a12;
  padding: 28px 0;
}

.footer-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #94a3b8;
}

/* ==========================================================================
   3-PANEL EDITOR LAYOUT
   ========================================================================== */

.editor-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--app-bg);
}

/* Navbar */
.editor-navbar-container {
  height: 56px;
  background-color: #0a0e17;
  border-bottom: 1px solid #1e293b;
  z-index: 20;
  flex-shrink: 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 16px;
}

.navbar-left, .navbar-right, .navbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-divider {
  width: 1px;
  height: 24px;
  background-color: #1e293b;
}

.navbar-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s;
}

.navbar-title-box:hover {
  background-color: #141f36;
}

.navbar-project-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #f8fafc;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-edit-icon {
  color: #64748b;
}

.navbar-save-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.save-status-saved {
  background-color: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.save-status-saved .save-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.save-status-saving {
  background-color: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.save-status-saving .save-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #f59e0b;
  animation: pulse 1s infinite;
}

.save-status-error {
  background-color: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.save-status-error .save-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background-color: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Device Switcher */
.device-switcher {
  display: flex;
  background-color: #0b1120;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
}

.device-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s;
}

.device-btn.active {
  background-color: #1e293b;
  color: #38bdf8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.undo-redo-group {
  display: flex;
  gap: 2px;
}

/* Main 3-panel area */
.editor-main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar */
.editor-sidebar-container {
  width: 220px;
  background-color: #080c14;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.2s ease, margin-left 0.2s ease;
}

.sidebar-inner {
  padding: 16px 10px;
}

.sidebar-group-title {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.08em;
  padding: 0 10px;
  margin-bottom: 8px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: #cbd5e1;
  cursor: pointer;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-nav-item:hover {
  background-color: #141d2e;
  color: #f8fafc;
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #60a5fa;
  font-weight: 600;
  box-shadow: 0 0 14px rgba(37, 99, 235, 0.2);
}

.nav-item-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.sidebar-nav-item.active .nav-item-icon {
  color: #60a5fa;
}

.sidebar-nav-item.item-disabled {
  opacity: 0.45;
}

.badge-disabled {
  margin-left: auto;
  color: #64748b;
}

/* Middle Editor Settings Pane */
.editor-pane-container {
  width: 360px;
  background-color: #0d1322;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
  flex-shrink: 0;
  padding: 24px;
  transition: width 0.2s ease, margin-left 0.2s ease;
}

.editor-pane-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e293b;
}

.pane-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 4px;
}

.pane-subtitle {
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.45;
}

.editor-subheading {
  font-size: 0.875rem;
  font-weight: 700;
  color: #e2e8f0;
  margin: 20px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid #1e293b;
}

/* Right / Center Preview Area */
.editor-preview-container {
  flex: 1;
  background-color: #050811;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1.2px, transparent 1.2px);
  background-size: 22px 22px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.site-preview-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.preview-viewport-wrapper {
  background-color: #ffffff;
  transition: all 0.25s ease;
}

.preview-desktop {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--app-border);
}

.preview-tablet {
  width: 768px;
  height: 100%;
  max-height: 940px;
  border-radius: 24px;
  border: 12px solid #1e293b;
  box-shadow: var(--shadow-xl);
}

.preview-mobile {
  width: 375px;
  height: 740px;
  border-radius: 36px;
  border: 12px solid #0f172a;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.preview-mobile::before {
  content: '';
  display: block;
  width: 90px;
  height: 18px;
  background: #0f172a;
  margin: 0 auto -18px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  position: relative;
  z-index: 60;
}

.preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #ffffff;
}

/* Fullscreen Preview Mode */
.fullscreen-preview-active .editor-sidebar-container,
.fullscreen-preview-active .editor-pane-container {
  display: none !important;
}

.fullscreen-preview-active .editor-preview-container {
  background-color: #0f172a;
}

/* ==========================================================================
   IMAGE UPLOADER & CARDS
   ========================================================================== */

.image-uploader-box {
  border: 1px dashed #334155;
  border-radius: var(--radius-md);
  background-color: #0b1120;
  overflow: hidden;
  transition: border-color 0.2s, background-color 0.2s;
}

.image-uploader-box:hover {
  border-color: #3b82f6;
}

.uploader-empty-state {
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.uploader-empty-state:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

.uploader-empty-icon {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.uploader-empty-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 2px;
}

.uploader-empty-desc {
  font-size: 0.72rem;
  color: #94a3b8;
}

.image-preview-wrapper {
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.image-preview-thumb {
  max-width: 100%;
  max-height: 140px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border: 1px solid #1e293b;
}

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

/* Card lists in editor */
.item-editor-card {
  background-color: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.item-editor-card.item-hidden {
  opacity: 0.45;
  background-color: #070a12;
}

.item-card-header {
  padding: 10px 14px;
  background-color: #141f36;
  border-bottom: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.item-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #f8fafc;
}

.item-card-num {
  color: #38bdf8;
  font-weight: 800;
  font-size: 0.75rem;
}

.item-card-actions {
  display: flex;
  gap: 4px;
}

.item-card-body {
  padding: 14px;
  background-color: #0f172a;
}

.card-image-uploader-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid #1e293b;
}

.badge-tag {
  background-color: rgba(59, 130, 246, 0.16);
  color: #60a5fa;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.badge-tag-hidden {
  background-color: rgba(239, 68, 68, 0.16);
  color: #f87171;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Theme Presets Grid */
.theme-presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.theme-preset-card {
  padding: 10px;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  background-color: #0f172a;
  cursor: pointer;
  transition: all 0.15s;
}

.theme-preset-card:hover {
  border-color: #3b82f6;
  background-color: #141f36;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-preset-card.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  background-color: rgba(59, 130, 246, 0.12);
}

.preset-colors {
  display: flex;
  gap: 5px;
  margin-bottom: 6px;
}

.preset-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.preset-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #f8fafc;
}

.colors-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-picker-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-picker-input {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid #1e293b;
  padding: 2px;
  cursor: pointer;
  background-color: #0b1120;
}

.color-text-input {
  flex: 1;
}

/* Section Manager List */
.section-manager-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background-color: #0b1120;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.15s ease;
}

.section-manager-card:hover {
  border-color: #334155;
  background-color: #111a2f;
}

.section-manager-card.is-disabled {
  opacity: 0.45;
  background-color: #070a12;
}

.card-drag-handle {
  color: #64748b;
  cursor: grab;
}

.card-info {
  flex: 1;
}

.card-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #f8fafc;
}

.card-status {
  font-size: 0.72rem;
  color: #94a3b8;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Template Choice Cards */
.templates-choice-grid {
  display: grid;
  gap: 14px;
}

.template-choice-card {
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.template-choice-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.template-choice-card.is-active-template {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
}

.template-choice-image-box {
  position: relative;
  height: 120px;
}

.template-choice-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-choice-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: var(--brand-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.template-current-pill {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background-color: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.template-choice-body {
  padding: 12px;
}

.template-choice-cat {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-primary);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.template-choice-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 4px;
}

.template-choice-desc {
  font-size: 0.78rem;
  color: var(--app-text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.template-choice-footer {
  display: flex;
  justify-content: flex-end;
}

/* Menu rows and highlights */
.menu-item-row, .highlight-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.alert-info-box {
  background-color: var(--brand-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8125rem;
  color: #1e40af;
  line-height: 1.5;
  margin-top: 16px;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease-out;
}

.modal-box {
  background-color: var(--app-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}

.modal-lg {
  max-width: 680px;
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--app-text);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--app-text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: var(--app-text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--app-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background-color: var(--app-surface-subtle);
}

.modal-closing {
  animation: fadeOut 0.15s forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes slideUp {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* File Dropzone */
.file-dropzone {
  border: 2px dashed var(--app-border-strong);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  background-color: var(--app-surface-subtle);
  cursor: pointer;
  transition: all 0.15s;
}

.file-dropzone:hover, .file-dropzone.drag-active {
  border-color: var(--brand-primary);
  background-color: var(--brand-light);
}

.dropzone-icon {
  color: var(--brand-primary);
  margin-bottom: 10px;
}

.dropzone-text {
  font-size: 0.875rem;
  color: var(--app-text-muted);
}

/* Export Options Grid */
.export-options-grid {
  display: grid;
  gap: 14px;
}

.export-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  background-color: var(--app-surface);
  cursor: pointer;
  transition: all 0.15s;
}

.export-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.export-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.export-card-content {
  flex: 1;
}

.export-card-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 3px;
}

.export-card-content p {
  font-size: 0.8rem;
  color: var(--app-text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background-color: #0f172a;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toastSlideIn 0.2s ease-out;
  max-width: 380px;
}

.toast-success {
  background-color: #064e3b;
  color: #ecfdf5;
}
.toast-success .toast-icon {
  color: #34d399;
}

.toast-error {
  background-color: #7f1d1d;
  color: #fef2f2;
}
.toast-error .toast-icon {
  color: #f87171;
}

.toast-info {
  background-color: #1e293b;
  color: #f8fafc;
}
.toast-info .toast-icon {
  color: #60a5fa;
}

.toast-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.25rem;
  cursor: pointer;
  margin-left: auto;
  line-height: 1;
}

.toast-close:hover {
  color: #ffffff;
}

.toast-fade-out {
  animation: toastFadeOut 0.25s forwards;
}

@keyframes toastSlideIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes toastFadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */

@media (max-width: 1024px) {
  .editor-sidebar-container {
    width: 72px;
  }
  .sidebar-group-title, .nav-item-text, .badge-disabled {
    display: none;
  }
  .sidebar-nav-item {
    justify-content: center;
    padding: 10px;
  }
  .editor-pane-container {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .editor-main-container {
    flex-direction: column;
  }
  .editor-sidebar-container {
    width: 100%;
    height: 52px;
    border-right: none;
    border-bottom: 1px solid var(--app-border);
  }
  .sidebar-inner {
    display: flex;
    overflow-x: auto;
    padding: 6px;
  }
  .sidebar-section-group {
    display: flex;
  }
  .editor-pane-container {
    width: 100%;
    max-height: 320px;
    border-right: none;
    border-bottom: 1px solid var(--app-border);
  }
  .dash-hero-title {
    font-size: 2rem;
  }
  .navbar-project-name {
    max-width: 140px;
  }
}

/* ==========================================================================
   LEGAL / 152-ФЗ COMPLIANCE MODULE STYLES
   ========================================================================== */

.legal-engine-badge-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.legal-tabs-nav {
  display: flex;
  background-color: var(--app-surface-subtle);
  border-bottom: 1px solid var(--app-border);
  padding: 4px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.legal-tabs-nav::-webkit-scrollbar {
  display: none;
}

.legal-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.legal-tab-btn:hover {
  color: var(--app-text);
  background-color: var(--app-surface);
}
.legal-tab-btn.active {
  color: var(--brand-primary);
  background-color: var(--app-surface);
  box-shadow: var(--shadow-sm);
}

.legal-tab-score-pill {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background-color: rgba(37, 99, 235, 0.12);
  color: var(--brand-primary);
  font-weight: 700;
}

.legal-tab-content {
  padding: 20px 24px;
}

/* Checklist Summary Card */
.legal-checklist-summary-card {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border: 1px solid #1e293b;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.checklist-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.checklist-summary-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
}
.checklist-summary-desc {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  margin-top: 2px;
}
.checklist-score-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
}
.checklist-progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.checklist-progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Legal Disclaimer Alert */
.legal-disclaimer-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 4px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.disclaimer-alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}
.disclaimer-alert-text {
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
}
.disclaimer-alert-text strong {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

/* Checklist Items Grid */
.checklist-items-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.checklist-card {
  background-color: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.checklist-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}
.checklist-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.checklist-card-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--app-surface-subtle);
  color: var(--app-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.checklist-card-info {
  flex: 1;
}
.checklist-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
}
.checklist-card-ref {
  font-size: 0.75rem;
  color: var(--brand-primary);
  font-weight: 500;
}
.checklist-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}
.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}
.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}
.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.checklist-card-note {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  line-height: 1.45;
  padding-left: 34px;
}

/* Roskomnadzor Box */
.legal-rkn-box {
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-top: 10px;
}
.rkn-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.rkn-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e40af;
}
.rkn-box-text {
  font-size: 0.8125rem;
  color: #1e3a8a;
  line-height: 1.5;
  margin-bottom: 12px;
}
.rkn-box-actions {
  display: flex;
  gap: 8px;
}

/* Documents Grid */
.legal-docs-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.legal-doc-card {
  background-color: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all 0.15s ease;
}
.legal-doc-card.enabled {
  border-left: 4px solid var(--brand-primary);
}
.legal-doc-card.disabled {
  opacity: 0.7;
  border-left: 4px solid #cbd5e1;
}
.legal-doc-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.legal-doc-header-main {
  flex: 1;
}
.legal-doc-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--app-text);
  line-height: 1.3;
}
.legal-doc-card-file {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--brand-primary);
  margin-top: 2px;
}
.legal-doc-card-desc {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  line-height: 1.45;
  margin-bottom: 14px;
}
.legal-doc-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Switch Toggle Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background-color: #cbd5e1;
  border-radius: 22px;
  transition: 0.2s ease;
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch-toggle input:checked + .switch-slider {
  background-color: var(--brand-primary);
}
.switch-toggle input:checked + .switch-slider:before {
  transform: translateX(18px);
}

/* Legal Preview Modal Dialog */
.legal-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.legal-modal-dialog {
  background-color: var(--app-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--app-border);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease-out;
}
.legal-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--app-surface);
}
.legal-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--app-text);
}
.legal-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-modal-body {
  padding: 28px;
  overflow-y: auto;
  background-color: #ffffff;
  color: #1e293b;
}
.legal-doc-rendered-content {
  font-size: 0.95rem;
  line-height: 1.65;
}
.legal-doc-rendered-content h1 {
  font-size: 1.65rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #0f172a;
}
.legal-doc-rendered-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 10px 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
  color: #0f172a;
}
.legal-doc-rendered-content p {
  margin-bottom: 12px;
}
.legal-doc-rendered-content ul {
  margin: 10px 0 14px 24px;
}
.legal-doc-rendered-content li {
  margin-bottom: 6px;
}
.legal-doc-rendered-content .legal-doc-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.legal-doc-rendered-content .legal-highlight-box {
  background: rgba(37, 99, 235, 0.08);
  border-left: 4px solid var(--brand-primary);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 18px 0;
  font-size: 0.9rem;
}
.legal-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--app-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--app-surface-subtle);
}

/* ==========================================================================
   THEME CATALOG & DESIGN SECTION STYLES
   ========================================================================== */

.theme-tabs-nav {
  display: flex;
  background-color: var(--app-surface-subtle);
  border-bottom: 1px solid var(--app-border);
  padding: 6px;
  gap: 6px;
}

.theme-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-tab-btn:hover {
  color: var(--app-text);
  background-color: var(--app-surface);
}

.theme-tab-btn.active {
  color: var(--brand-primary);
  background-color: var(--app-surface);
  box-shadow: var(--shadow-sm);
}

.theme-tab-count-pill {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background-color: rgba(37, 99, 235, 0.12);
  color: var(--brand-primary);
  font-weight: 700;
}

.theme-tab-content-area {
  padding: 20px 24px;
}

/* Active Theme Banner */
.theme-current-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.theme-current-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--app-text-muted);
}

.theme-current-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--app-text);
  margin-top: 2px;
}

.theme-current-palette {
  display: flex;
  gap: 6px;
}

/* Quick Actions */
.theme-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* Category Filter Pills */
.theme-category-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 18px;
  scrollbar-width: none;
}
.theme-category-pills::-webkit-scrollbar {
  display: none;
}

.theme-category-pill {
  padding: 5px 12px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background-color: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.theme-category-pill:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.theme-category-pill.active {
  background-color: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* Rich Theme Cards */
.theme-cards-rich-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.theme-card-rich {
  background-color: var(--app-surface);
  border: 2px solid var(--app-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: var(--shadow-sm);
}

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

.theme-card-rich.is-active {
  border-color: var(--brand-primary);
  background-color: rgba(37, 99, 235, 0.02);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.theme-card-rich-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.theme-card-rich-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--app-text);
  line-height: 1.3;
}

.theme-category-badge {
  display: inline-block;
  font-size: 0.675rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background-color: var(--app-surface-subtle);
  border: 1px solid var(--app-border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 4px;
}

.theme-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.725rem;
  font-weight: 700;
  color: #065f46;
  background-color: #d1fae5;
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.theme-card-rich-desc {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
}

.theme-card-palette-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.palette-chip {
  flex: 1;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.theme-card-preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--app-border);
  margin-bottom: 8px;
}

.theme-card-preview-font {
  font-size: 0.825rem;
  font-weight: 600;
}

.theme-card-mini-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
}

.theme-card-click-hint {
  font-size: 0.75rem;
  color: var(--brand-primary);
  font-weight: 600;
  text-align: right;
  margin-top: 6px;
}

/* Font Specimen Box in Design Tab */
.font-specimen-box {
  background-color: #0b1120;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
  margin-bottom: 16px;
}

.font-specimen-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.font-specimen-desc {
  font-size: 0.85rem;
  color: var(--app-text-muted);
  line-height: 1.45;
}

/* Button Styles Segmented */
.theme-button-styles-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.theme-reset-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--app-border);
}



/* ==========================================================================
   COMMERCIAL VERSION 1.0 STYLES (AUTH, CABINET, CHECKOUT, ADMIN)
   ========================================================================== */

/* Auth Modals */
.modal-auth {
  max-width: 440px;
}

.auth-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-box {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8125rem;
  line-height: 1.45;
}

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

.alert-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}

/* User Pill & Dropdown */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background-color: var(--app-surface-subtle);
  border: 1px solid var(--app-border);
  border-radius: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--app-text);
}

.user-avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background-color: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  padding: 6px;
  z-index: 1000;
}

.dropdown-header {
  padding: 8px 10px;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--app-border);
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--app-text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--app-surface-subtle);
}

.dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: #dc2626;
}

/* Checkout Modal */
.modal-checkout {
  max-width: 520px;
}

.checkout-summary-card {
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 20px;
}

.checkout-tariff-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--brand-primary);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.checkout-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(191, 219, 254, 0.6);
  margin-bottom: 14px;
}

.checkout-project-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
}

.checkout-price-box {
  text-align: right;
}

.checkout-price-val {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand-primary);
  line-height: 1;
}

.checkout-price-period {
  font-size: 0.75rem;
  color: #64748b;
}

.checkout-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8125rem;
  color: #334155;
  line-height: 1.4;
}

.simulated-card-form {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
}

.card-chip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Personal Cabinet Styles */
.cabinet-layout {
  min-height: 100vh;
  background-color: var(--app-surface-subtle);
  display: flex;
  flex-direction: column;
}

.cabinet-topbar {
  background-color: var(--app-surface);
  border-bottom: 1px solid var(--app-border);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.cabinet-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cabinet-hero-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.cabinet-hero-left h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--app-text);
  margin-bottom: 6px;
}

.cabinet-hero-left p {
  font-size: 0.875rem;
  color: var(--app-text-muted);
}

.cabinet-stats-strip {
  display: flex;
  gap: 24px;
}

.cab-stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 16px;
  background-color: var(--app-surface-subtle);
  border-radius: 10px;
  border: 1px solid var(--app-border);
  min-width: 110px;
}

.cab-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--app-text);
}

.cab-stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--app-text-muted);
}

.cabinet-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--app-border);
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cab-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--app-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cab-tab-btn:hover {
  color: var(--app-text);
  background-color: rgba(0, 0, 0, 0.02);
}

.cab-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  background-color: var(--app-surface);
}

/* Cabinet Projects Grid */
.cabinet-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.cab-project-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cab-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cab-project-card.card-paid {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, #0f172a 60px);
}

.cab-proj-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.cab-proj-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--app-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cab-proj-meta {
  font-size: 0.8125rem;
  color: var(--app-text-muted);
  margin-bottom: 20px;
}

.cab-proj-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--app-border);
}

.cab-more-actions {
  display: flex;
  gap: 4px;
}

/* Tables */
.table-responsive-box {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  overflow-x: auto;
}

.cabinet-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.cabinet-table th {
  padding: 14px 18px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--app-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background-color: var(--app-surface-subtle);
  border-bottom: 1px solid var(--app-border);
}

.cabinet-table td {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--app-text);
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}

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

.cabinet-table tr:hover td {
  background-color: var(--app-surface-subtle);
}

/* Profile & Legal Grids */
.cabinet-profile-grid,
.cabinet-legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.profile-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 24px;
}

.empty-state-card {
  background: var(--app-surface);
  border: 1px dashed var(--app-border);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--app-text-muted);
}

.empty-state-icon {
  margin: 0 auto 16px;
  color: var(--brand-primary);
}

/* Admin Metrics Grid */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.metric-card {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--app-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--app-text);
  line-height: 1.1;
  margin-bottom: 4px;
}

.metric-sub {
  font-size: 0.75rem;
  color: var(--app-text-muted);
}
