/* Amungsa Studio - Design System & Stylesheet */
@font-face {
  font-family: 'OCRAExtended';
  src: url('assets/ocra.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'OCRAExtended';
  src: url('assets/ocra.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: 'OCR A Extended';
  src: url('assets/ocra.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'OCR A Extended';
  src: url('assets/ocra.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

:root {
  --bg-darker: #090c12;
  --bg-dark: #0f141f;
  --bg-surface: #171d2b;
  --bg-surface-hover: #1f273a;
  --bg-card: #1c2333;
  
  --border-subtle: #273147;
  --border-focus: #3b82f6;
  
  --text-main: #f3f4f6;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-glow: rgba(2, 132, 199, 0.25);
  
  --accent-gold: #d4af37;
  --accent-green: #0c6e50;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  background-color: var(--bg-darker);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
}

/* CONTAINER */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* NAVBAR */
.navbar {
  height: 62px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 20;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.brand-logo-badge img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.brand-text .badge-tag {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.2px;
}

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

.ratio-selector {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 4px;
}

.btn-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-toggle:hover {
  color: var(--text-main);
}

.btn-toggle.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: #10b981;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-surface-hover);
  border-color: #3b82f6;
}

/* MAIN BODY */
.main-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 62px);
}

/* SIDEBAR */
.sidebar {
  width: 420px;
  min-width: 380px;
  max-width: 460px;
  background: var(--bg-dark);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.tabs-nav {
  display: flex;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255,255,255,0.02);
}

.tab-btn.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: var(--bg-surface);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
}

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

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 14px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

/* PANEL SECTIONS */
.panel-section {
  margin-bottom: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.section-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  margin-bottom: 12px;
}

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

.section-header-flex .section-title {
  margin-bottom: 0;
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"],
select,
textarea {
  width: 100%;
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea {
  resize: vertical;
  min-height: 60px;
}

/* GRIDS */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.grid-3col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

/* RANGE SLIDERS */
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  outline: none;
  margin-top: 4px;
}

/* SWITCH TOGGLE */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.switch-toggle.mini {
  width: 32px;
  height: 18px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #334155;
  transition: .3s;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch-toggle.mini .slider.round:before {
  height: 12px;
  width: 12px;
}

input:checked + .slider {
  background-color: #0284c7;
}

input:checked + .slider:before {
  transform: translateX(18px);
}

.switch-toggle.mini input:checked + .slider:before {
  transform: translateX(14px);
}

/* TEMPLATE SELECTION CARDS */
.template-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.tpl-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tpl-card:hover {
  background: var(--bg-surface-hover);
  border-color: #475569;
}

.tpl-card.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.tpl-icon {
  width: 52px;
  height: 52px;
  background: var(--bg-darker);
  border-radius: var(--radius-sm);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

/* TEMPLATE 1: BERITA & SINERGI ICON */
.tpl-icon-berita {
  background: #0f172a;
}
.tpl-icon-berita .f-bg-thumb {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #334155 0%, #09101d 75%);
}
.tpl-icon-berita .f-top-halo {
  position: absolute;
  top: 4px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
}
.tpl-icon-berita .f-badge-tag {
  position: absolute;
  left: 4px; bottom: 20px;
  width: 18px; height: 4px;
  background: #0284c7;
  border-radius: 1px;
}
.tpl-icon-berita .f-headline-bar {
  position: absolute;
  left: 4px; bottom: 14px;
  width: 26px; height: 3px;
  background: #ffffff;
  border-radius: 1px;
}
.tpl-icon-berita .f-headline-bar2 {
  position: absolute;
  left: 4px; bottom: 9px;
  width: 20px; height: 3px;
  background: #ffffff;
  border-radius: 1px;
}
.tpl-icon-berita .f-cal-box {
  position: absolute;
  left: 4px; bottom: 3px;
  width: 6px; height: 5px;
  background: rgba(255,255,255,0.2);
  border: 1px solid #ffffff;
  border-radius: 1px;
}
.tpl-icon-berita .f-wm-mark {
  position: absolute;
  right: 3px; bottom: 4px;
  width: 14px; height: 16px;
  border: 1px dashed rgba(255,255,255,0.25);
  border-radius: 50%;
}

/* TEMPLATE 2: DOKUMENTASI BERSIH ICON */
.tpl-icon-dokumentasi {
  background: #0f172a;
}
.tpl-icon-dokumentasi .f-bg-thumb {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #475569 0%, #0f172a 70%, #070d18 100%);
}
.tpl-icon-dokumentasi .f-top-halo {
  position: absolute;
  top: 4px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
}
.tpl-icon-dokumentasi .f-bot-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 16px;
  background: linear-gradient(180deg, transparent, rgba(7, 13, 24, 0.95));
}
.tpl-icon-dokumentasi .f-wm-mark {
  position: absolute;
  right: 4px; bottom: 3px;
  width: 14px; height: 14px;
  border: 1px dashed rgba(255,255,255,0.3);
  border-radius: 50%;
}

/* TEMPLATE 3: SLOGAN & PENUTUP ICON */
.tpl-icon-slogan {
  background: #0f172a;
}
.tpl-icon-slogan .f-bg-thumb {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #475569 0%, #1e293b 65%, #09101d 100%);
}
.tpl-icon-slogan .f-top-halo {
  position: absolute;
  top: 4px; left: 50%; transform: translateX(-50%);
  width: 8px; height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
}
.tpl-icon-slogan .f-bot-gradient {
  position: absolute;
  left: 0; right: 0; bottom: 0; height: 20px;
  background: linear-gradient(180deg, transparent, rgba(7, 13, 24, 0.95));
}
.tpl-icon-slogan .f-script-quote {
  position: absolute;
  left: 8px; right: 8px; bottom: 7px;
  height: 2px;
  background: #f1f5f9;
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

/* 3 FRAMES ICON PREVIEW */
.tpl-icon-3frames .f-box {
  position: absolute;
  background: #38bdf8;
  border-radius: 2px;
  border: 1px solid #ffffff;
}
.tpl-icon-3frames .f-l { left: 4px; top: 12px; width: 14px; height: 26px; opacity: 0.8; }
.tpl-icon-3frames .f-c { left: 16px; top: 18px; width: 18px; height: 30px; z-index: 2; }
.tpl-icon-3frames .f-r { right: 4px; top: 10px; width: 14px; height: 26px; opacity: 0.8; }

.tpl-info strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
  margin-bottom: 2px;
}

.tpl-info small {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
  display: block;
}

/* PRESET CHIPS */
.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}

.chip-btn:hover {
  color: #ffffff;
  border-color: #475569;
}

.chip-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* COLOR PALETTE */
.color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.color-dot:hover {
  transform: scale(1.15);
}

.color-dot.active {
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 2px solid var(--border-subtle); border-radius: 50%; }

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

/* DATE STYLES BUTTONS */
.date-style-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-choice {
  flex: 1;
  background: var(--bg-darker);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-choice.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* FONT STYLE GRID */
.font-style-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.radio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  position: relative;
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:hover {
  border-color: #475569;
}

.radio-card.active {
  background: rgba(2, 132, 199, 0.1);
  border-color: #38bdf8;
}

.radio-card .sample {
  font-size: 14px;
  margin-bottom: 2px;
  color: #ffffff;
}

.script-sample { font-family: 'Alex Brush', cursive; font-size: 20px !important; }
.script-sample2 { font-family: 'Great Vibes', cursive; font-size: 20px !important; }
.sans-sample { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 11px !important; letter-spacing: 0.5px; }
.serif-sample { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; font-size: 13px !important; }
.img-sample { font-family: monospace; font-size: 11px !important; color: #38bdf8; }

.radio-card small {
  font-size: 10px;
  color: var(--text-dim);
}

/* FRAME TABS */
.frame-selector-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.frame-tab {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.frame-tab.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.frame-editor-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.frame-upload-dropzone {
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.frame-upload-dropzone:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: #60a5fa;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #93c5fd;
}

.dropzone-content span {
  font-size: 13px;
  font-weight: 600;
}

.dropzone-content small {
  font-size: 11px;
  color: #64748b;
}

.mt-3 { margin-top: 12px; }
.w-100 { width: 100%; }

/* BRAND ITEMS ROW */
.brand-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-item-row:last-child {
  border-bottom: none;
}

.brand-item-info strong {
  display: block;
  font-size: 13px;
  color: #ffffff;
}

.brand-item-info small {
  font-size: 11px;
  color: var(--text-dim);
}

.sub-options {
  padding-left: 8px;
  margin-top: 8px;
  margin-bottom: 14px;
}

/* WORKBENCH (CANVAS AREA) - Background Putih / Light Studio */
.workbench {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  overflow: hidden;
  position: relative;
}

.canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  position: relative;
  background-color: #f8fafc;
  background-image: 
    radial-gradient(#cbd5e1 1.5px, transparent 1.5px),
    radial-gradient(#cbd5e1 1.5px, #f8fafc 1.5px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.canvas-wrapper {
  position: relative;
  box-shadow: none;
  border-radius: 4px;
  transition: transform 0.15s ease-out;
  transform-origin: center center;
}

#mainCanvas {
  display: block;
  background: #080c14;
  border: 2px solid #0f172a;
  outline: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 25px 60px -15px rgba(15, 23, 42, 0.45), 
    0 10px 25px -5px rgba(15, 23, 42, 0.25),
    0 0 0 1px rgba(15, 23, 42, 0.15);
  border-radius: 4px;
  cursor: grab;
}

#mainCanvas:active {
  cursor: grabbing;
}

.canvas-hint {
  display: none !important;
}

.toolbar-tip-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* WORKBENCH TOOLBAR */
.workbench-toolbar {
  height: 52px;
  background: #0b1120;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon {
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-surface-hover);
}

#zoomLevelDisplay {
  font-size: 12px;
  color: #38bdf8;
  min-width: 42px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#zoomSlider {
  width: 90px;
  height: 5px;
  accent-color: #0284c7;
  cursor: pointer;
}

.zoom-presets-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.zoom-presets-row .btn-tool {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.zoom-presets-row .btn-tool:hover {
  color: #ffffff;
  border-color: #475569;
}

.zoom-presets-row .btn-tool.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.btn-preview-modal {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-preview-modal:hover {
  background: #0369a1 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
}

.btn-tool {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tool:hover {
  background: var(--bg-surface-hover);
  border-color: #475569;
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 60px;
  right: 24px;
  background: #0f172a;
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.3s;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* NAVBAR IMPORT BUTTON */
.btn-import-glow {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff !important;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
  font-weight: 700;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-import-glow:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.55);
  transform: translateY(-1px);
}

/* IMPORT HERO CARD IN TAB 1 */
.import-hero-card {
  background: linear-gradient(145deg, rgba(2, 132, 199, 0.08) 0%, rgba(15, 23, 42, 0.6) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 18px;
}

.import-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-badge-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
}

.section-subdesc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-mini-action {
  background: #0284c7;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-mini-action:hover {
  background: #0369a1;
}

.quick-import-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.5);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.25s ease;
}

.quick-import-dropzone:hover,
.quick-import-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.quick-drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #e2e8f0;
}

.quick-drop-content svg {
  color: #38bdf8;
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.4));
}

.quick-drop-content span {
  font-size: 13px;
  font-weight: 700;
}

.quick-drop-content small {
  font-size: 11px;
  color: var(--text-muted);
}

/* QUICK APPLY PANEL */
.quick-apply-panel {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.quick-uploaded-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.btn-text-link {
  background: none;
  border: none;
  color: #f87171;
  font-size: 11px;
  cursor: pointer;
  font-weight: 600;
}

.btn-text-link:hover {
  text-decoration: underline;
}

.quick-thumbs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.quick-thumb-item {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid #38bdf8;
  flex-shrink: 0;
  position: relative;
  background: #000;
}

.quick-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quick-apply-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}

.quick-apply-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.btn-tpl-apply {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-align: left;
  transition: all 0.2s;
}

.btn-tpl-apply:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #38bdf8;
  transform: translateY(-1px);
}

.btn-tpl-apply .tpl-tag {
  font-size: 9px;
  font-weight: 800;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-tpl-apply strong {
  font-size: 11px;
  color: #f1f5f9;
}

/* LOCKED SLOGAN CARD IN TAB 2 */
.locked-slogan-card {
  background: linear-gradient(145deg, rgba(12, 110, 80, 0.15) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.locked-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #34d399;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.locked-preview-container {
  background: #080d1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.locked-preview-container img {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8));
}

.locked-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  line-height: 1.5;
  color: #cbd5e1;
}

.locked-info-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.locked-info-note code {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  color: #38bdf8;
  word-break: break-all;
}

/* FLOATING WORKBENCH IMPORT BUTTON */
.floating-import-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid #38bdf8;
  color: #ffffff;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
  z-index: 10;
}

.floating-import-btn:hover {
  background: #0284c7;
  box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

/* MODAL DIALOG STYLES */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: #111827;
  border: 1px solid #38bdf8;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

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

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title-wrap h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.modal-title-wrap small {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.btn-modal-close:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-badge-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ffffff;
}

.step-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #0284c7;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

.modal-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-dropzone:hover,
.modal-dropzone.dragover {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.modal-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
}

.modal-dropzone-inner svg {
  color: #38bdf8;
}

.drop-main-text {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.drop-sub-text {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-thumbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.modal-thumb-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid #38bdf8;
  background: #000;
}

.modal-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-thumb-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.modal-tpl-card {
  background: #1e293b;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s;
  position: relative;
}

.modal-tpl-card input[type="radio"] {
  position: absolute;
  top: 10px;
  right: 10px;
  accent-color: #0284c7;
}

.modal-tpl-card:hover {
  background: #273549;
  border-color: #64748b;
}

.modal-tpl-card.active {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.tpl-mini-preview {
  height: 48px;
  border-radius: var(--radius-sm);
  background: #090d16;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.preview-sinergi {
  flex-direction: column;
  gap: 2px;
}

.prev-badge {
  background: #0f3b6c;
  color: #ffffff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 2px;
}

.prev-title {
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.preview-clean {
  background: #0b1120;
}

.prev-clean-tag {
  color: #38bdf8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
}

.preview-slogan {
  background: #06111e;
}

.prev-script-tag {
  color: #34d399;
  font-family: 'Alex Brush', cursive;
  font-size: 15px;
}

.preview-kolase {
  display: flex;
  gap: 4px;
}

.prev-box {
  width: 14px;
  height: 24px;
  background: #334155;
  border: 1px solid #ffffff;
  border-radius: 3px;
}

.prev-box.b2 {
  height: 30px;
  background: #475569;
}

.modal-tpl-info strong {
  display: block;
  font-size: 12px;
  color: #ffffff;
}

.modal-tpl-info small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #0f172a;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background: var(--bg-surface-hover);
  border-color: #475569;
  color: #ffffff;
}

.chip-btn.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* DOWNLOAD DROPDOWN IN NAVBAR */
.download-dropdown-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.download-dropdown-wrap .btn-primary {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 12px;
}

.btn-dropdown-arrow {
  background: #059669;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  height: 38px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-dropdown-arrow:hover {
  background: #047857;
}

.download-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(2, 132, 199, 0.15);
  min-width: 230px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  animation: modalScaleIn 0.15s ease-out;
}

.download-menu.show {
  display: flex;
}

.download-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}

.download-menu-item:hover {
  background: #1e293b;
  border-color: #334155;
}

.download-menu-item.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.fmt-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.badge-png {
  background: #0284c7;
  color: #ffffff;
}

.badge-jpg {
  background: #f59e0b;
  color: #000000;
}

.badge-webp {
  background: #10b981;
  color: #ffffff;
}

.fmt-info strong {
  display: block;
  font-size: 12px;
  color: #ffffff;
}

.fmt-info small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

/* FORMAT CHOICE BUTTONS IN SIDEBAR */
.format-selector-row {
  display: flex;
  gap: 6px;
}

.btn-fmt-choice {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-fmt-choice:hover {
  color: #ffffff;
  border-color: #475569;
}

.btn-fmt-choice.active {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

/* ========================================================
   RESPONSIVE OFF-CANVAS DRAWER & FULLSCREEN MOBILE CANVAS
   ======================================================== */

.btn-hamburger {
  display: none;
}

.sidebar-mobile-header {
  display: none;
}

.sidebar-backdrop {
  display: none;
}


.ratio-short {
  display: none;
}
.ratio-full {
  display: inline;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
  }

  .app-container {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* TOMBOL TIGA GARIS (HAMBURGER) SISI KIRI */
  .btn-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: #38bdf8;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    margin-right: 4px;
  }

  .btn-hamburger:hover,
  .btn-hamburger:active {
    background: var(--bg-surface-hover);
    color: #ffffff;
    transform: scale(0.96);
  }

  /* TOP NAVBAR ON MOBILE */
  .navbar {
    height: 46px;
    padding: 0 8px;
    gap: 5px;
    z-index: 50;
  }

  .nav-brand {
    gap: 6px;
  }

  .btn-hamburger {
    width: 32px;
    height: 32px;
    border-radius: 6px;
  }

  .btn-hamburger svg {
    width: 18px;
    height: 18px;
  }

  .brand-logo-badge {
    width: 30px;
    height: 30px;
    padding: 2px;
    border-radius: 4px;
  }

  .brand-text h1 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: -0.2px;
    white-space: nowrap;
  }

  .brand-text .badge-tag {
    display: none;
  }

  .nav-actions {
    gap: 4px;
  }

  .ratio-selector {
    padding: 2px;
    gap: 2px;
    border-radius: 5px;
  }

  .btn-toggle {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
  }

  .ratio-short {
    display: inline;
  }

  .ratio-full {
    display: none;
  }

  #btnNavImportModal {
    padding: 5px 8px;
    font-size: 10px;
    border-radius: 5px;
    gap: 3px;
  }

  #btnNavImportModal svg {
    width: 15px;
    height: 15px;
  }

  .btn-import-text {
    display: none;
  }

  #btnCopyClipboard {
    display: none;
  }

  .btn-action {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 5px;
  }

  .btn-action svg {
    width: 14px;
    height: 14px;
  }

  .dropdown-split .btn-action {
    border-radius: 5px 0 0 5px;
  }

  .btn-dropdown-arrow {
    padding: 0 4px;
    border-radius: 0 5px 5px 0;
  }

  .btn-dropdown-arrow svg {
    width: 12px;
    height: 12px;
  }

  /* WORKBENCH TAKES FULLSCREEN ON MOBILE (FOTO TERLIHAT JELAS!) */
  .main-body {
    position: relative;
    height: calc(100dvh - 46px);
    width: 100vw;
    display: block;
    overflow: hidden;
  }

  .workbench {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    z-index: 1;
  }

  .canvas-viewport {
    flex: 1;
    width: 100%;
    height: calc(100% - 38px);
    padding: 8px;
    overflow: hidden;
    background-size: 16px 16px;
  }

  #mainCanvas {
    touch-action: none;
  }

  /* WORKBENCH TOOLBAR: SLIM & SISAKAN FITUR ZOOMING SAJA */
  .workbench-toolbar {
    height: 38px;
    padding: 0 10px;
    justify-content: center;
    background: rgba(10, 15, 29, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
  }

  /* HILANGKAN TOMBOL FOOTER PREVIEW HD, FORMAT, & LAINNYA DI MOBILE */
  .export-quick,
  .toolbar-info,
  #btnOpenZoomPreview,
  #zoomSlider,
  #btnZoom50,
  #btnZoom75,
  #btnZoom100 {
    display: none !important;
  }

  /* SISAKAN FITUR ZOOMING */
  .zoom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
  }

  .zoom-controls .btn-icon {
    width: 28px;
    height: 26px;
    font-size: 16px;
    border-radius: 5px;
    background: #1e293b;
    border: 1px solid #334155;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .zoom-controls .btn-icon:active {
    background: #334155;
    transform: scale(0.94);
  }

  #zoomLevelDisplay {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    min-width: 36px;
    text-align: center;
  }

  .zoom-presets-row {
    display: flex;
    margin-left: 2px;
  }

  #btnZoomFit {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 5px;
    height: 26px;
    background: #0284c7;
    color: #ffffff;
    border: none;
  }

  /* ====================================================
     SIDEBAR AS SLIDE-OUT DRAWER (OFF-CANVAS SETUP)
     ==================================================== */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 86vw;
    max-width: 330px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-dark);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 12px 0 45px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
  }

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

  /* DRAWER HEADER WITH CLOSE BUTTON */
  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
  }

  .sidebar-mobile-header .sm-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
  }

  .btn-close-sidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
  }

  .btn-close-sidebar:hover,
  .btn-close-sidebar:active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
  }

  /* SIDEBAR BACKDROP */
  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    display: block;
  }

  .sidebar-backdrop.show {
    opacity: 1;
    pointer-events: auto;
  }

  /* TAB NAVIGATION COMPACT */
  .tabs-nav {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    height: 36px;
    min-height: 36px;
    background: var(--bg-darker);
    flex-shrink: 0;
  }

  .tabs-nav::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    padding: 6px 10px;
    font-size: 11px;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-btn svg {
    width: 13px;
    height: 13px;
  }

  /* TAB CONTENT & PANEL SECTIONS COMPACT */
  .tab-content {
    flex: 1;
    padding: 10px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .panel-section {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
  }

  .panel-title {
    font-size: 10px;
    margin-bottom: 6px;
  }

  .btn-primary {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 5px;
  }

  .upload-zone-compact {
    padding: 10px 8px;
    margin-top: 8px;
    border-radius: 6px;
  }

  .upload-zone-compact svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
  }

  .upload-zone-compact p {
    font-size: 11px;
  }

  .upload-zone-compact span {
    font-size: 9px;
  }

  .grid-2col,
  .grid-3col {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .templates-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tpl-card {
    padding: 6px 8px;
    gap: 8px;
    border-radius: 6px;
  }

  .tpl-preview {
    width: 36px;
    height: 36px;
    border-radius: 4px;
  }

  .tpl-title {
    font-size: 11px;
    font-weight: 600;
  }

  .tpl-desc {
    font-size: 9.5px;
    line-height: 1.2;
  }

  .form-group {
    margin-bottom: 8px;
  }

  .form-group label {
    font-size: 10px;
    margin-bottom: 3px;
  }

  .input-text, textarea, select {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 5px;
  }

  .btn-tool {
    padding: 3px 7px;
    font-size: 10px;
    border-radius: 4px;
  }

  .radio-pill-group {
    flex-wrap: wrap;
    gap: 4px;
  }

  .radio-pill {
    padding: 3px 7px;
    font-size: 10px;
    border-radius: 4px;
  }

  /* DRAWER FOOTER (EXPORT) */
  .sidebar-footer {
    padding: 8px 12px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
  }

  .format-selector-row {
    gap: 4px;
  }

  .btn-fmt-choice {
    padding: 5px 8px;
    font-size: 10px;
    border-radius: 4px;
  }

  .sidebar-footer .btn-action {
    padding: 8px 12px;
    font-size: 11.5px;
    border-radius: 6px;
    margin-top: 6px !important;
  }

  /* MODALS ON MOBILE */
  .modal-dialog {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
  }

  .modal-header {
    padding: 10px 14px !important;
  }

  .modal-body {
    padding: 12px !important;
  }

  .modal-tpl-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0 6px;
  }

  .brand-text h1 {
    font-size: 12px;
  }

  .btn-toggle {
    padding: 3px 5px;
    font-size: 10px;
  }
}
