/* ============================================================
   SHAYARI POSTER MAKER — DESIGN SYSTEM
   Material Design + Neo Brutalism + Glassmorphism Fusion
   ============================================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Colors */
  --primary: #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --secondary: #00CEC9;
  --secondary-light: #55efc4;
  --accent: #FD79A8;
  --accent-light: #fab1d0;
  --warning: #FDCB6E;
  --danger: #e17055;
  --success: #00b894;
  --info: #74b9ff;

  /* Backgrounds */
  --bg-primary: #0D1117;
  --bg-secondary: #161B22;
  --bg-tertiary: #1C2333;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.12);
  --bg-input: rgba(255, 255, 255, 0.06);

  /* Text */
  --text-primary: #E6EDF3;
  --text-secondary: #8B949E;
  --text-tertiary: #6E7681;
  --text-inverse: #0D1117;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --border-brutal: 2.5px solid rgba(255, 255, 255, 0.15);
  --border-brutal-accent: 2.5px solid var(--primary);

  /* Shadows — Neo Brutalism */
  --shadow-brutal: 4px 4px 0px rgba(0, 0, 0, 0.6);
  --shadow-brutal-sm: 2px 2px 0px rgba(0, 0, 0, 0.5);
  --shadow-brutal-lg: 6px 6px 0px rgba(0, 0, 0, 0.7);
  --shadow-brutal-primary: 4px 4px 0px var(--primary-dark);
  --shadow-glow: 0 0 20px rgba(108, 92, 231, 0.3);
  --shadow-glow-accent: 0 0 20px rgba(253, 121, 168, 0.3);
  --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevation-1: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-elevation-2: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-elevation-3: 0 8px 32px rgba(0,0,0,0.5);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-hindi: 'Noto Sans Devanagari', 'Hind', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.25s var(--ease-out);
  --transition-slow: 0.4s var(--ease-out);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --topbar-height: 56px;
  --editor-toolbar-height: 48px;

  /* Z-index */
  --z-sidebar: 100;
  --z-topbar: 90;
  --z-modal: 200;
  --z-toast: 300;
  --z-tooltip: 250;
  --z-dropdown: 150;
}

/* ── Base Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; display: block; }

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
}

button { cursor: pointer; border: none; background: none; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-tertiary); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

::selection { background: var(--primary); color: white; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--text-secondary); }
.text-hindi { font-family: var(--font-hindi); }

/* ── Layout — App Shell ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: var(--space-lg);
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
}

.app-content.sidebar-collapsed {
  margin-left: var(--sidebar-collapsed);
}

/* ── Sidebar Navigation ── */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: var(--border-brutal);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: white;
  border: var(--border-brutal);
  box-shadow: var(--shadow-brutal-sm);
  flex-shrink: 0;
}

.sidebar-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  border: 2px solid transparent;
}

.sidebar-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(253, 121, 168, 0.1));
  color: var(--primary-light);
  border: 2px solid rgba(108, 92, 231, 0.3);
  box-shadow: var(--shadow-brutal-sm);
  font-weight: 600;
}

.sidebar-link .material-icons-round {
  font-size: 22px;
  width: 22px;
  flex-shrink: 0;
}

.sidebar-link span { overflow: hidden; text-overflow: ellipsis; }

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: var(--space-sm) 0;
}

.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--bg-secondary);
  border: var(--border-brutal);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  z-index: calc(var(--z-sidebar) + 1);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-brutal-sm);
}

.sidebar-toggle:hover {
  background: var(--primary);
  color: white;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: calc(var(--z-sidebar) - 1);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--space-md);
  left: var(--space-md);
  width: 44px;
  height: 44px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  border: var(--border-brutal);
  border-radius: var(--radius-md);
  z-index: calc(var(--z-sidebar) - 2);
  color: var(--text-primary);
  font-size: 24px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-brutal-sm);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: var(--border-brutal);
  box-shadow: var(--shadow-brutal);
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lg);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-color: var(--primary-dark);
}

.btn-primary:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); }

.btn-secondary {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  backdrop-filter: blur(10px);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #e84393);
  color: white;
  border-color: #e84393;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #00a885);
  color: white;
  border-color: #00a885;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #d63031);
  color: white;
  border-color: #d63031;
}

.btn-ghost {
  background: transparent;
  border: 2px solid var(--border-strong);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-ghost:hover { background: var(--bg-card-hover); box-shadow: var(--shadow-brutal-sm); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon-sm { width: 32px; height: 32px; padding: 0; font-size: 18px; border-radius: var(--radius-sm); }

.btn-fab {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 28px;
  z-index: 50;
  box-shadow: var(--shadow-brutal), var(--shadow-glow);
  border: var(--border-brutal);
}

.btn-fab:hover { transform: scale(1.1) rotate(90deg); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brutal);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.05), rgba(253, 121, 168, 0.03));
  pointer-events: none;
}

.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--shadow-brutal-lg);
  border-color: rgba(108, 92, 231, 0.4);
}

.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}

/* ── Form Elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--bg-input);
  border: var(--border-brutal);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  width: 100%;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

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

textarea.form-input { resize: vertical; min-height: 80px; }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238B949E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  outline: none;
  border: none;
  box-shadow: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: 2px solid white;
  box-shadow: var(--shadow-brutal-sm);
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-glass-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary-dark);
}

.toggle input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

/* Color Picker */
.color-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.color-picker-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: var(--border-brutal);
  cursor: pointer;
  box-shadow: var(--shadow-brutal-sm);
  overflow: hidden;
}

.color-picker-swatch input[type="color"] {
  width: 150%;
  height: 150%;
  border: none;
  cursor: pointer;
  transform: translate(-15%, -15%);
}

/* ── Chips / Tags ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-glass-strong);
  border: 2px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-brutal-sm);
}

/* ── Modal / Dialog ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--bg-secondary);
  border: var(--border-brutal);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-brutal-lg), var(--shadow-glow);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s var(--ease-spring);
}

@keyframes modalSlideIn {
  from { transform: translateY(30px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

.modal-header h3 { font-size: 1.2rem; }

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.modal-close:hover { background: var(--bg-card-hover); color: var(--text-primary); }

.modal-body { padding: var(--space-lg); }

.modal-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: var(--border-brutal);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-brutal);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.9rem;
  font-weight: 500;
  pointer-events: all;
  animation: toastSlideIn 0.4s var(--ease-spring);
  max-width: 360px;
}

.toast.toast-exit { animation: toastSlideOut 0.3s var(--ease-out) forwards; }

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--info); }
.toast-warning { border-left: 4px solid var(--warning); }

.toast .material-icons-round { font-size: 20px; }
.toast-success .material-icons-round { color: var(--success); }
.toast-error .material-icons-round { color: var(--danger); }
.toast-info .material-icons-round { color: var(--info); }
.toast-warning .material-icons-round { color: var(--warning); }

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

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

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  margin-bottom: -2px;
}

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

.tab-btn.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.tab-content { display: none; padding-top: var(--space-lg); }
.tab-content.active { display: block; animation: fadeIn 0.3s var(--ease-out); }

/* ── Search Bar ── */
.search-bar {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.search-bar .material-icons-round {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 20px;
}

.search-bar input {
  width: 100%;
  padding: 10px 16px 10px 44px;
  background: var(--bg-input);
  border: var(--border-brutal);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2);
}

/* ── Grid System ── */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.masonry-grid {
  columns: 3;
  column-gap: var(--space-lg);
}
.masonry-grid > * {
  break-inside: avoid;
  margin-bottom: var(--space-lg);
}

/* ── Page Header ── */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
}

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

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-secondary);
}

.empty-state .material-icons-round {
  font-size: 80px;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-state h3 {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-strong) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fade { animation: fadeIn 0.5s var(--ease-out); }
.animate-slide-up { animation: slideUp 0.5s var(--ease-out); }
.animate-scale { animation: scaleIn 0.3s var(--ease-spring); }

/* staggered children animation */
.stagger-children > * {
  animation: slideUp 0.4s var(--ease-out) both;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* ── Tooltip ── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  padding: 6px 12px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: var(--primary); color: white; }
.badge-accent { background: var(--accent); color: white; }
.badge-success { background: var(--success); color: white; }

/* ── Dropdown ── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-secondary);
  border: var(--border-brutal);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-brutal), var(--shadow-elevation-3);
  z-index: var(--z-dropdown);
  padding: var(--space-xs);
  animation: scaleIn 0.2s var(--ease-spring);
}

.dropdown-menu.active { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES
   ══════════════════════════════════════════════ */

/* ── Dashboard ── */
.dashboard-hero {
  position: relative;
  background: linear-gradient(135deg, #0D1117 0%, #1a1040 30%, #2d1b69 60%, #1a0a3e 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-3xl) var(--space-xl);
  border: var(--border-brutal);
  box-shadow: var(--shadow-brutal-lg);
  overflow: hidden;
  margin-bottom: var(--space-xl);
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.25), transparent 70%);
  animation: float 8s ease-in-out infinite;
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(253, 121, 168, 0.2), transparent 70%);
  animation: float 6s ease-in-out infinite reverse;
}

.dashboard-hero-content {
  position: relative;
  z-index: 2;
}

.dashboard-hero h1 {
  font-size: 2.8rem;
  margin-bottom: var(--space-md);
  line-height: 1.1;
}

.dashboard-hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 500px;
  margin-bottom: var(--space-lg);
}

.dashboard-section {
  margin-bottom: var(--space-xl);
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.dashboard-section-header h2 {
  font-size: 1.4rem;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-brutal);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lg);
}

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

.stat-card-icon.purple { background: rgba(108, 92, 231, 0.2); color: var(--primary-light); }
.stat-card-icon.pink { background: rgba(253, 121, 168, 0.2); color: var(--accent); }
.stat-card-icon.teal { background: rgba(0, 206, 201, 0.2); color: var(--secondary); }
.stat-card-icon.yellow { background: rgba(253, 203, 110, 0.2); color: var(--warning); }

.stat-card-value { font-size: 1.6rem; font-weight: 800; font-family: var(--font-heading); }
.stat-card-label { font-size: 0.8rem; color: var(--text-secondary); }

/* Template Card */
.template-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: var(--border-brutal);
  box-shadow: var(--shadow-brutal);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-normal);
  aspect-ratio: 4/5;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  transform: translate(-3px, -3px) scale(1.02);
  box-shadow: var(--shadow-brutal-lg);
}

.template-card-preview {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  position: relative;
  overflow: hidden;
}

.template-card-preview .preview-text {
  text-align: center;
  z-index: 2;
  position: relative;
  word-break: break-word;
  max-width: 90%;
}

.template-card-info {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-color);
}

.template-card-info h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.template-card-info span {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

.template-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: 3;
}

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

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-pills::-webkit-scrollbar { display: none; }

/* ── Library Cards ── */
.library-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: var(--border-brutal);
  box-shadow: var(--shadow-brutal);
  overflow: hidden;
  transition: all var(--transition-normal);
  background: var(--bg-card);
}

.library-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lg);
}

.library-card-preview {
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.library-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-card-info {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
}

.library-card-name {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.library-card-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.library-card-actions {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.library-card:hover .library-card-actions { opacity: 1; }

.library-card-actions button {
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.library-card-actions button:hover { background: var(--primary); }

/* ── Font Card ── */
.font-card {
  background: var(--bg-card);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brutal);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
}

.font-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lg);
  border-color: rgba(108, 92, 231, 0.4);
}

.font-card-preview {
  font-size: 1.8rem;
  margin-bottom: var(--space-md);
  word-wrap: break-word;
  line-height: 1.4;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.font-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.font-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

/* Signature Preset Card */
.signature-card {
  background: var(--bg-card);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brutal);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.signature-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-lg);
  border-color: var(--accent);
}

.signature-card-preview {
  margin-bottom: var(--space-md);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.signature-card-name {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ══════════════════════════════════════════════
   EDITOR STYLES
   ══════════════════════════════════════════════ */

.editor-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--bg-primary);
}

/* Editor Topbar */
.editor-topbar {
  height: var(--editor-toolbar-height);
  background: var(--bg-secondary);
  border-bottom: var(--border-brutal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  gap: var(--space-md);
  flex-shrink: 0;
}

.editor-topbar-left,
.editor-topbar-center,
.editor-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.editor-topbar-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: var(--space-sm);
}

.editor-tool-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  font-size: 20px;
}

.editor-tool-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.editor-tool-btn.active {
  background: rgba(108, 92, 231, 0.2);
  color: var(--primary-light);
  border-color: rgba(108, 92, 231, 0.3);
}

.editor-tool-divider {
  width: 1px;
  height: 24px;
  background: var(--border-color);
  margin: 0 var(--space-xs);
}

/* Editor Left Panel */
.editor-left-panel {
  width: 300px;
  background: var(--bg-secondary);
  border-right: var(--border-brutal);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.editor-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.editor-panel-tabs::-webkit-scrollbar { display: none; }

.editor-panel-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 4px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

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

.editor-panel-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.editor-panel-tab .material-icons-round { font-size: 20px; }

.editor-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.editor-panel-section {
  margin-bottom: var(--space-lg);
}

.editor-panel-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

/* Editor Canvas Area */
.editor-canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0e14;
}

.editor-canvas-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  overflow: auto;
  position: relative;
}

.editor-canvas {
  position: relative;
  background: white;
  box-shadow: var(--shadow-elevation-3);
  transition: width 0.3s, height 0.3s;
  overflow: hidden;
}

.editor-canvas.show-grid {
  background-image:
    linear-gradient(rgba(128,128,128,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,128,128,0.15) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Canvas Elements */
.canvas-element {
  position: absolute;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.canvas-element.selected {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.canvas-element.selected .resize-handles { display: block; }

.resize-handles { display: none; }

.resize-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 2px;
  z-index: 10;
}

.resize-handle.tl { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.tr { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.bl { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.br { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.tm { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.bm { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.ml { left: -5px; top: 50%; transform: translateY(-50%); cursor: w-resize; }
.resize-handle.mr { right: -5px; top: 50%; transform: translateY(-50%); cursor: e-resize; }

.rotate-handle {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: var(--radius-full);
  cursor: grab;
  display: none;
  z-index: 10;
  border: 2px solid white;
}

.canvas-element.selected .rotate-handle { display: block; }

.rotate-handle::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 8px;
  background: var(--primary);
}

/* Canvas Text Element */
.canvas-text {
  padding: 8px 12px;
  min-width: 60px;
  min-height: 30px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.canvas-text[contenteditable="true"] {
  outline: 1px dashed rgba(108, 92, 231, 0.5);
  cursor: text;
}

/* Canvas Image Element */
.canvas-image {
  overflow: hidden;
}

.canvas-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Snap Lines */
.snap-line {
  position: absolute;
  background: var(--accent);
  z-index: 100;
  pointer-events: none;
}

.snap-line.horizontal {
  height: 1px;
  width: 100%;
  left: 0;
}

.snap-line.vertical {
  width: 1px;
  height: 100%;
  top: 0;
}

/* Editor Right Panel */
.editor-right-panel {
  width: 260px;
  background: var(--bg-secondary);
  border-left: var(--border-brutal);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.editor-right-panel-header {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.editor-right-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

/* Layer List */
.layer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.8rem;
}

.layer-item:hover { background: var(--bg-card-hover); }

.layer-item.active {
  background: rgba(108, 92, 231, 0.15);
  border-color: rgba(108, 92, 231, 0.3);
}

.layer-item-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.layer-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-item-actions {
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.layer-item:hover .layer-item-actions { opacity: 1; }

.layer-item-actions button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-tertiary);
  font-size: 16px;
}

.layer-item-actions button:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Editor Property Panel */
.property-section {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.property-section:last-child { border-bottom: none; }

.property-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.property-row label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  min-width: 60px;
  flex-shrink: 0;
}

.property-row .form-input { font-size: 0.8rem; padding: 6px 10px; }
.property-row .range-slider { flex: 1; }
.property-row .range-value {
  font-size: 0.75rem;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: right;
}

/* Gradient Editor */
.gradient-editor {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  border: 1px solid var(--border-color);
}

.gradient-preview {
  height: 40px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border-color);
}

.gradient-stops {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.gradient-stop {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Quick Template Mini Cards (for editor sidebar) */
.quick-template-card {
  aspect-ratio: 4/5;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs);
}

.quick-template-card:hover {
  border-color: var(--primary);
  transform: scale(1.05);
}

.quick-template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

/* Signature Style List */
.signature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.signature-preset {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  background: var(--bg-card);
}

.signature-preset:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

/* ── Emoji Picker ── */
.emoji-picker {
  position: absolute;
  background: var(--bg-secondary);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brutal-lg);
  width: 320px;
  max-height: 400px;
  z-index: var(--z-dropdown);
  display: none;
  animation: scaleIn 0.2s var(--ease-spring);
}

.emoji-picker.active { display: block; }

.emoji-picker-header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: var(--space-sm);
  max-height: 300px;
  overflow-y: auto;
}

.emoji-picker-item {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.emoji-picker-item:hover {
  background: var(--bg-card-hover);
  transform: scale(1.2);
}

/* ── Settings Page ── */
.settings-section {
  background: var(--bg-card);
  border: var(--border-brutal);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-brutal);
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.settings-section-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.settings-section-header .material-icons-round {
  font-size: 24px;
  color: var(--primary-light);
}

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

.settings-item {
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--transition-fast);
}

.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--bg-card-hover); }

.settings-item-info { flex: 1; }
.settings-item-info h4 { font-size: 0.9rem; font-weight: 600; }
.settings-item-info p { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 2px; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .masonry-grid { columns: 2; }
}

@media (max-width: 1024px) {
  .editor-right-panel { display: none; }
  .editor-left-panel { width: 260px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    z-index: calc(var(--z-sidebar) + 10);
  }

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

  .mobile-menu-btn { display: flex; }

  .app-content {
    margin-left: 0 !important;
    padding: var(--space-md);
    padding-top: 70px;
  }

  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .masonry-grid { columns: 2; }

  .dashboard-hero {
    padding: var(--space-xl) var(--space-lg);
  }

  .dashboard-hero h1 { font-size: 1.8rem; }

  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }

  .page-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-bar { max-width: 100%; }

  /* Editor Mobile Layout */
  .editor-layout {
    flex-direction: column;
  }

  .editor-left-panel {
    width: 100%;
    height: auto;
    max-height: 45vh;
    border-right: none;
    border-bottom: var(--border-brutal);
    order: 2;
  }

  .editor-canvas-area {
    order: 1;
    flex: 1;
    min-height: 40vh;
  }

  .editor-topbar {
    order: 0;
  }

  .editor-canvas-wrapper {
    padding: var(--space-sm);
  }

  .modal { margin: var(--space-md); }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
  }

  .toast { max-width: 100%; }

  .btn-fab {
    bottom: var(--space-md);
    right: var(--space-md);
  }
}

@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }

  .masonry-grid { columns: 1; }

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

  .dashboard-hero h1 { font-size: 1.5rem; }
  .dashboard-hero p { font-size: 0.9rem; }

  .editor-panel-tab { padding: 8px 2px; font-size: 0.65rem; }
  .editor-panel-tab .material-icons-round { font-size: 18px; }
}

/* ── Print/Export Helpers ── */
.no-export { }

/* ── Utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.hidden { display: none !important; }
.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
