/* ═══════════════════════════════════════════════════════════
   Kampagnen-Tool – Main Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5; color: #111827; background: #f3f4f6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── Layout ───────────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; min-height: 100vh; }
.app-body { display: flex; flex: 1; }

/* ─── Topbar ────────────────────────────────────────────────── */
.topbar { height: 56px; background: #1e293b; color: #f8fafc; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; position: sticky; top: 0; z-index: 100; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-toggle span { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; }
.brand { display: flex; align-items: center; gap: 10px; color: #f8fafc; font-weight: 700; font-size: 16px; }
.brand-icon { display: flex; align-items: center; color: #f8fafc; }
.brand-name { letter-spacing: -0.02em; }

/* ─── User Menu ─────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-btn { background: none; border: 1px solid #334155; border-radius: 8px; color: #cbd5e1; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 6px 10px; transition: background 0.15s; }
.user-btn:hover { background: #334155; }
.avatar { width: 30px; height: 30px; background: #1a56db; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: #64748b; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.12); min-width: 180px; display: none; z-index: 200; overflow: hidden; }
.user-dropdown.open { display: block; }
.user-dropdown a { display: flex; align-items: center; gap: 8px; padding: 10px 16px; color: #374151; transition: background 0.1s; font-size: 14px; }
.user-dropdown a:hover { background: #f9fafb; }
.user-dropdown hr { border: none; border-top: 1px solid #f3f4f6; margin: 4px 0; }
.text-danger { color: #e02424 !important; }

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e5e7eb; display: flex; flex-direction: column; flex-shrink: 0; transition: width 0.2s; overflow: hidden; }
.sidebar.collapsed { width: 56px; }
.sidebar-nav { flex: 1; padding: 12px 6px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: #6b7280; transition: all 0.15s; white-space: nowrap; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: #f3f4f6; color: #111827; }
.nav-item.active { background: #eff6ff; color: #1a56db; }
.nav-item svg { flex-shrink: 0; width: 22px; height: 22px; }
.nav-label { white-space: nowrap; overflow: hidden; transition: opacity 0.15s, max-width 0.2s; max-width: 200px; }
.nav-divider { border: none; border-top: 1px solid #f3f4f6; margin: 8px 0; }
/* Collapsed state: hide labels, center icons precisely */
.sidebar.collapsed .nav-label { opacity: 0; max-width: 0; overflow: hidden; pointer-events: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar.collapsed .nav-item svg { width: 24px; height: 24px; }
.sidebar-footer { padding: 12px; border-top: 1px solid #f3f4f6; }
.sidebar-version { font-size: 11px; color: #9ca3af; text-align: center; }

/* ─── Main Content ──────────────────────────────────────────── */
.main-content { flex: 1; padding: 24px; overflow-y: auto; max-width: 100%; }

/* ─── Page Header ───────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; color: #111827; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6b7280; margin-bottom: 4px; }
.breadcrumb a { color: #1a56db; }
.breadcrumb span { color: #9ca3af; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; margin-top: 8px; }
.section-title { font-size: 18px; font-weight: 600; color: #111827; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.btn-primary { background: #1a56db; color: #fff; }
.btn-primary:hover { background: #1e429f; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-ghost { background: transparent; color: #6b7280; }
.btn-ghost:hover { background: #f3f4f6; color: #111827; }
.btn-danger { background: #e02424; color: #fff; }
.btn-danger:hover { background: #c81e1e; }
.btn-danger-ghost { background: transparent; color: #e02424; }
.btn-danger-ghost:hover { background: #fee2e2; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; color: #111827; background: #fff; transition: border-color 0.15s, box-shadow 0.15s; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,.1); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.form-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }
.form-layout { max-width: 800px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.input-with-toggle { position: relative; }
.input-with-toggle .form-input { padding-right: 42px; }
.input-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; }

/* ─── Cards ──────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #f3f4f6; }
.card-title { font-size: 16px; font-weight: 600; color: #111827; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid #f3f4f6; }
.p-0 { padding: 0 !important; }

/* ─── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; line-height: 1.5; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-dismissible { position: relative; padding-right: 40px; transition: opacity 0.3s; }
.alert-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; opacity: 0.6; }

/* ─── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-lg { padding: 4px 12px; font-size: 13px; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table-container { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { background: #f9fafb; padding: 10px 16px; text-align: left; font-size: 12px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #e5e7eb; }
.table td { padding: 12px 16px; border-bottom: 1px solid #f3f4f6; color: #374151; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f9fafb; }
.row-inactive { opacity: 0.5; }
.actions-cell { white-space: nowrap; }
.monospace { font-family: 'Courier New', monospace; font-size: 12px; }

/* ─── Dashboard Stats ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 20px; display: flex; align-items: center; gap: 16px; cursor: pointer; transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.stat-card[href] { cursor: pointer; }
.stat-card-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 16px; padding: 20px; background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; cursor: pointer; transition: box-shadow 0.2s, border-color 0.15s; }
.stat-card-link:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); border-color: #d1d5db; }
.stat-arrow { color: #d1d5db; margin-left: auto; transition: color 0.15s; }
.stat-card-link:hover .stat-arrow { color: #9ca3af; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 700; color: #111827; }
.stat-label { font-size: 13px; color: #6b7280; }
.dashboard-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.dashboard-right { display: flex; flex-direction: column; gap: 16px; }

/* ─── List Items ─────────────────────────────────────────────── */
.list-items { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; transition: background 0.1s; }
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: #f9fafb; }
.list-item-preview { width: 52px; height: 40px; border-radius: 6px; overflow: hidden; background: #f3f4f6; flex-shrink: 0; }
.list-item-preview img { width: 100%; height: 100%; object-fit: cover; }
.list-item-info { flex: 1; min-width: 0; }
.list-item-title { font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-meta { display: flex; gap: 8px; font-size: 12px; color: #9ca3af; margin-top: 2px; flex-wrap: wrap; align-items: center; }

/* ─── Campaign Grid ──────────────────────────────────────────── */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.campaign-card { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; transition: box-shadow 0.2s; }
.campaign-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.campaign-card-image { display: block; position: relative; height: 160px; background: #f3f4f6; overflow: hidden; }
.campaign-card-image img { width: 100%; height: 100%; object-fit: cover; }
.campaign-card-badge { position: absolute; top: 10px; left: 10px; }
.campaign-card-body { padding: 16px; }
.campaign-card-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.campaign-card-title a { color: #111827; }
.campaign-card-title a:hover { color: #1a56db; }
.campaign-card-brand { font-size: 12px; color: #6b7280; margin-bottom: 8px; }
.campaign-card-meta { display: flex; gap: 8px; font-size: 12px; color: #9ca3af; margin-bottom: 12px; flex-wrap: wrap; }
.campaign-card-footer { display: flex; justify-content: space-between; font-size: 12px; color: #9ca3af; }

/* ─── Campaign Card New (dashed placeholder) ─────────────────── */
.campaign-card-new { border: 2px dashed #d1d5db; background: transparent; display: flex; align-items: center; justify-content: center; min-height: 220px; cursor: pointer; transition: all 0.2s; border-radius: 12px; }
.campaign-card-new:hover { border-color: #1a56db; background: #eff6ff; }
.campaign-card-new-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #9ca3af; padding: 32px; text-align: center; }
.campaign-card-new:hover .campaign-card-new-inner { color: #1a56db; }
.campaign-card-new-inner span { font-size: 14px; font-weight: 600; }

/* ─── Motif Grid ─────────────────────────────────────────────── */
.motif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.motif-card { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; overflow: hidden; }
.motif-card-image { display: block; position: relative; height: 140px; background: #f3f4f6; overflow: hidden; }
.motif-card-image img { width: 100%; height: 100%; object-fit: cover; }
.motif-card-image .badge { position: absolute; top: 8px; right: 8px; }
.motif-card-body { padding: 12px; }
.motif-card-body h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.motif-card-body h3 a { color: #111827; }
.motif-card-meta { font-size: 12px; color: #9ca3af; display: flex; gap: 8px; }

/* ─── Variant Grid ───────────────────────────────────────────── */
.variant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.variant-card { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; overflow: hidden; }
.variant-card-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f3f4f6; }
.format-badge { font-size: 11px; font-weight: 700; color: #6b7280; }
.variant-preview { background: #f3f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.variant-preview img { width: 100%; height: 100%; object-fit: contain; }
.variant-card-body { padding: 12px; }
.variant-format-name { font-weight: 600; font-size: 14px; }
.variant-dims { font-size: 12px; color: #6b7280; }
.variant-card-actions { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #f3f4f6; }
.motif-info-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 16px; }
.info-chip { font-size: 13px; color: #6b7280; padding: 4px 10px; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; }

/* ─── Master Badge ───────────────────────────────────────────── */
.master-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: #fef3c7; color: #92400e; border-radius: 999px; font-size: 11px; font-weight: 700; }
.variant-card-master { border: 2px solid #f59e0b; }

/* ─── Info Cards ─────────────────────────────────────────────── */
.info-cards { margin-bottom: 24px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

/* ─── Asset Preview ──────────────────────────────────────────── */
.asset-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.asset-preview-item { position: relative; border-radius: 8px; overflow: hidden; background: #f3f4f6; aspect-ratio: 1; }
.asset-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview-label { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; padding: 4px 6px; text-align: center; }

/* ─── Format Checkboxes ──────────────────────────────────────── */
.format-group { margin-bottom: 20px; }
.format-group-title { font-size: 13px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; }
.format-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.format-checkbox { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 2px solid #e5e7eb; border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.format-checkbox input { display: none; }
.format-checkbox.checked { border-color: #1a56db; background: #eff6ff; }
.format-checkbox.small { padding: 6px 10px; font-size: 13px; }
.format-checkbox-name { font-weight: 600; font-size: 13px; color: #374151; }
.format-checkbox-dims { font-size: 11px; color: #9ca3af; }

/* ─── Format Pill ────────────────────────────────────────────── */
.format-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #f3f4f6; border-radius: 6px; font-size: 12px; cursor: pointer; border: 1px solid #e5e7eb; transition: all 0.15s; }
.format-pill:hover, .format-pill.active { background: #eff6ff; border-color: #1a56db; color: #1a56db; }

/* ─── Asset Types ────────────────────────────────────────────── */
.asset-type-groups { display: flex; flex-direction: column; gap: 20px; }
.asset-group { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; overflow: hidden; }
.asset-group-title { padding: 12px 16px; font-size: 13px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; background: #f9fafb; border-bottom: 1px solid #f3f4f6; }
.asset-list { display: flex; flex-direction: column; }
.asset-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; }
.asset-item:last-child { border-bottom: none; }
.asset-item.inactive { opacity: 0.5; }
.asset-item-preview { width: 60px; height: 48px; border-radius: 6px; overflow: hidden; background: #f3f4f6; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.asset-item-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-text { font-size: 11px; color: #374151; padding: 4px; word-break: break-word; }
.asset-item-info { flex: 1; min-width: 0; }
.asset-item-title { font-weight: 600; font-size: 14px; }
.asset-item-meta { font-size: 12px; color: #9ca3af; }
.asset-item-actions { display: flex; gap: 4px; }

/* ─── Global Asset Grid ──────────────────────────────────────── */
.global-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.global-asset-card { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; overflow: hidden; transition: box-shadow 0.15s; }
.global-asset-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.global-asset-card-img { height: 120px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.global-asset-card-img img { width: 100%; height: 100%; object-fit: cover; }
.global-asset-card-body { padding: 10px 12px; }
.global-asset-card-title { font-size: 13px; font-weight: 600; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.global-asset-card-type { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.global-asset-card-actions { display: flex; gap: 4px; padding: 8px 12px; border-top: 1px solid #f3f4f6; }
.global-asset-card-new { border: 2px dashed #d1d5db; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 172px; cursor: pointer; background: transparent; color: #9ca3af; font-size: 13px; font-weight: 500; transition: all 0.15s; width: 100%; }
.global-asset-card-new:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }

/* ─── Filter Search Wrap ─────────────────────────────────────── */
.filter-search-wrap { position: relative; flex: 1; min-width: 160px; max-width: 260px; }
.filter-search-wrap .filter-search { padding-left: 36px; width: 100%; }
.filter-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.filter-select { min-width: 130px; }

/* ─── Empty State SVG Icon ───────────────────────────────────── */
.empty-icon-svg { margin-bottom: 16px; display: flex; justify-content: center; }

/* ─── Template Cards ─────────────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.template-card { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; }
.template-card-image { height: 160px; background: #f3f4f6; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.template-card-image img { width: 100%; height: 100%; object-fit: cover; }
.template-type-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.template-card-body { padding: 16px; }
.template-card-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.template-card-body p { font-size: 13px; color: #6b7280; }
.template-card-meta { display: flex; gap: 8px; font-size: 12px; color: #9ca3af; margin-top: 8px; flex-wrap: wrap; }
.template-card-actions { padding: 12px 16px; border-top: 1px solid #f3f4f6; display: flex; gap: 8px; }

/* ─── Ad Groups ──────────────────────────────────────────────── */
.ad-group { background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; margin-bottom: 20px; }
.ad-group-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #f3f4f6; cursor: pointer; user-select: none; }
.ad-group-header:hover { background: #f9fafb; border-radius: 12px; }
.ad-group-title { font-size: 16px; font-weight: 600; color: #111827; flex: 1; }
.ad-group-meta { font-size: 13px; color: #9ca3af; }
.ad-group-toggle { color: #9ca3af; transition: transform 0.2s; }
.ad-group-toggle.open { transform: rotate(180deg); }
.ad-group-body { padding: 16px 20px; }
.ad-group-new { border: 2px dashed #d1d5db; background: transparent; border-radius: 12px; padding: 14px 20px; display: flex; align-items: center; gap: 10px; color: #9ca3af; cursor: pointer; font-size: 14px; font-weight: 500; transition: all 0.15s; margin-bottom: 8px; }
.ad-group-new:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }

/* ─── Filters Bar ────────────────────────────────────────────── */
.filters-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.filters-form { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: nowrap; overflow-x: auto; }
.filter-search { flex: 1; min-width: 140px; max-width: 240px; }
/* Force uniform height on all filter controls */
.filters-form .form-input, .filters-form .form-select { padding: 7px 12px; height: 38px; }
.filters-form .filter-search-wrap .form-input { padding: 7px 12px 7px 36px; }
.filters-form .btn-sm { height: 38px; padding: 0 14px; }
.result-count { font-size: 13px; color: #6b7280; white-space: nowrap; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.pagination-btn { padding: 8px 14px; border-radius: 6px; border: 1px solid #e5e7eb; background: #fff; color: #374151; font-size: 14px; }
.pagination-btn.active { background: #1a56db; color: #fff; border-color: #1a56db; }
.pagination-btn:hover:not(.active) { background: #f3f4f6; }

/* ─── Comments ───────────────────────────────────────────────── */
.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment { background: #f9fafb; border-radius: 8px; padding: 12px 16px; }
.comment-header { display: flex; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.comment-author { font-weight: 600; color: #374151; }
.comment-date { color: #9ca3af; }
.comment-body { font-size: 14px; color: #374151; }

/* ─── User Cell ──────────────────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: 8px; }
.format-title { font-weight: 600; font-size: 14px; }
.format-desc { font-size: 12px; color: #9ca3af; }

/* ─── Empty States ───────────────────────────────────────────── */
.empty-state { padding: 32px; text-align: center; color: #6b7280; }
.empty-state.large { padding: 64px 32px; }
.empty-state p { margin-bottom: 16px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: #374151; margin-bottom: 8px; }
.preview-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9ca3af; background: #f3f4f6; }
.preview-placeholder svg { width: 32px; height: 32px; opacity: 0.4; }
.preview-placeholder.small svg { width: 20px; height: 20px; }
.preview-placeholder span { font-size: 11px; color: #9ca3af; }

/* ─── Settings Layout ────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.settings-tabs { display: flex; flex-direction: column; gap: 2px; background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; padding: 8px; height: fit-content; min-width: 0; }
.settings-tab { padding: 10px 14px; border-radius: 8px; color: #6b7280; font-size: 14px; transition: all 0.1s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-tab:hover { background: #f3f4f6; color: #111827; }
.settings-tab.active { background: #eff6ff; color: #1a56db; font-weight: 600; }
.settings-content { }

/* ─── Sync from Master ───────────────────────────────────────── */
.sync-from-master { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }

/* ─── Modal ──────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 500; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid #e5e7eb; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #6b7280; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 20px; border-top: 1px solid #e5e7eb; }

/* ─── Progress Bar ───────────────────────────────────────────── */
.progress-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: #1a56db; border-radius: 3px; transition: width 0.3s; width: 0%; }

/* ─── Auth Layout ────────────────────────────────────────────── */
.auth-layout { min-height: 100vh; background: linear-gradient(135deg, #1e293b 0%, #1e40af 100%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-container { width: 100%; max-width: 400px; }
.auth-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.auth-header { padding: 32px; text-align: center; }
.auth-logo { font-size: 48px; margin-bottom: 12px; color: #1a56db; display: flex; align-items: center; justify-content: center; }
.auth-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.auth-header p { color: #6b7280; font-size: 14px; }
.auth-form { padding: 0 32px 24px; }
.auth-links { padding: 16px 32px; border-top: 1px solid #f3f4f6; text-align: center; font-size: 13px; }
.auth-links a { color: #1a56db; }

/* ─── User Tag & Date Tag ────────────────────────────────────── */
.user-tag, .date-tag { font-size: 12px; color: #9ca3af; }

/* ─── Hidden ─────────────────────────────────────────────────── */
.hidden { display: none !important; }
