/* ═══════════════════════════════════════════════════════════
   NP2 Layout Module Styles
   Matches: app.css, editorial.css, cic.css design system
   ═══════════════════════════════════════════════════════════ */

/* ─── Page Config Layout ──────────────────────────────────── */

.page-config-wrapper {
    padding: 20px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-config-header h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.page-config-header .text-muted {
    color: #9ca3af;
    font-size: 13px;
    margin: 0 0 20px 0;
}

.page-config-pub-select {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-config-pub-select label {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.page-config-pub-select select {
    max-width: 300px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: white;
    transition: border-color 0.15s;
}

.page-config-pub-select select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

/* ─── Two-column layout: form + preview ───────────────────── */

.page-config-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.page-config-form-col {
    flex: 1;
    min-width: 0;
}

.page-config-preview-col {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.page-config-preview-col h4 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-preview-container {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-dimensions {
    text-align: center;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
    font-family: 'Space Mono', monospace;
}

/* ─── Toolbar ─────────────────────────────────────────────── */

.page-config-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.page-config-toolbar label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.page-config-toolbar select {
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    background: white;
}

.page-config-toolbar select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

/* ─── Form ────────────────────────────────────────────────── */

.page-config-form fieldset {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
    margin: 0 0 12px 0;
    background: white;
}

.page-config-form fieldset legend {
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 8px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
    color: #374151;
}

.unit-label,
.unit-label-m,
.unit-label-s {
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
}

.form-control.pc-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Space Mono', monospace;
    color: #111827;
    background: white;
    transition: border-color 0.15s;
}

.form-control.pc-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

/* ─── Calculated Values ───────────────────────────────────── */

.page-config-calculated {
    margin-top: 4px;
    padding: 12px 16px;
    background: #eff6ff;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.page-config-calculated h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calc-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 13px;
}

.calc-label {
    color: #6b7280;
    font-weight: 500;
}

.calc-value {
    font-family: 'Space Mono', monospace;
    color: #111827;
    font-weight: 500;
}

/* ─── Actions ─────────────────────────────────────────────── */

.page-config-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-config-actions .np2-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.page-config-actions .np2-btn:hover {
    background: #1d4ed8;
}

.page-config-actions .np2-btn i,
.page-config-actions .np2-btn svg {
    width: 14px;
    height: 14px;
}

.save-status {
    font-size: 13px;
    font-weight: 600;
}
.save-status.saving { color: #9ca3af; }
.save-status.saved  { color: #059669; }
.save-status.error  { color: #dc2626; }

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .page-config-layout {
        flex-direction: column-reverse;
    }
    .page-config-preview-col {
        width: 100%;
        position: static;
    }
}

/* ═══════════════════════════════════════════════════════════
   Workspace Dashboard
   ═══════════════════════════════════════════════════════════ */

.layout-dashboard {
    padding: 20px;
}

.layout-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.layout-dash-header h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.layout-dash-header .text-muted {
    color: #9ca3af;
    font-size: 13px;
    margin: 0;
}

.layout-dash-header .np2-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.layout-dash-header .np2-btn:hover {
    background: #1d4ed8;
}

.layout-dash-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.layout-dash-filters label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.layout-dash-filters select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #374151;
    min-width: 200px;
}

.layout-dash-loading,
.layout-dash-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ─── Workspace Cards ────────────────────────────────────── */

.ws-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, transform 0.15s;
}

.ws-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.ws-card-date {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.ws-card-pub {
    font-size: 13px;
    color: #6b7280;
}

.ws-card-template {
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

.ws-card-center {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 13px;
    color: #6b7280;
}

.ws-stat-sep {
    color: #d1d5db;
}

.ws-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ws-status-planning { background: #fef3c7; color: #92400e; }
.ws-status-ads_placed { background: #dbeafe; color: #1d4ed8; }
.ws-status-editorial { background: #ede9fe; color: #6d28d9; }
.ws-status-ready { background: #d1fae5; color: #065f46; }
.ws-status-published { background: #f3f4f6; color: #6b7280; }

.ws-lock {
    font-size: 14px;
    margin-left: 8px;
}

/* ─── Create Modal ───────────────────────────────────────── */

.ws-create-form .form-group {
    margin-bottom: 14px;
}

.ws-create-form label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.ws-create-form .form-control {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
}

.ws-create-form .form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.ws-create-error {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
}

/* Fallback modal (when NP2Modal not available) */

.ws-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.ws-modal {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.ws-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.ws-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.ws-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #9ca3af;
    cursor: pointer;
}

.ws-modal-body {
    padding: 20px;
}

.ws-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e5e7eb;
}

.ws-btn-cancel {
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: #6b7280;
    cursor: pointer;
}

.ws-btn-cancel:hover {
    background: #f3f4f6;
}

.ws-btn-secondary {
    background: white !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
}

.ws-btn-secondary:hover {
    background: #f3f4f6 !important;
}

/* ─── Workspace Detail ───────────────────────────────────── */

.ws-detail-actions {
    display: flex;
    gap: 8px;
}

.ws-detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .ws-detail-grid {
        grid-template-columns: 1fr;
    }
}

.ws-detail-sections h3,
.ws-detail-ads h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

/* Section cards */

.ws-section-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.ws-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.ws-section-key {
    font-weight: 700;
    font-size: 16px;
    color: #2563eb;
    min-width: 24px;
}

.ws-section-name {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    flex: 1;
}

.ws-section-pages {
    font-size: 12px;
    color: #9ca3af;
}

.ws-page-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 14px;
}

.ws-page-thumb {
    width: 48px;
    height: 64px;
    border: 1.5px solid #d1d5db;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    position: relative;
}

.ws-page-thumb:hover {
    border-color: #2563eb;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.15);
}

.ws-page-empty { background: #f9fafb; }
.ws-page-in_progress { background: #fef3c7; border-color: #f59e0b; }
.ws-page-complete { background: #d1fae5; border-color: #10b981; }
.ws-page-locked { background: #e5e7eb; border-color: #9ca3af; }

.ws-page-num {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
}

.ws-page-blocks {
    font-size: 9px;
    color: #9ca3af;
    margin-top: 2px;
}

/* ─── Ad List (sidebar) ──────────────────────────────────── */

.ws-ad-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ws-ad-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
}

.ws-ad-number {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    min-width: 60px;
}

.ws-ad-customer {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
}

.ws-ad-size {
    font-size: 12px;
    color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════
   Workspace Editor (PageCanvas integration)
   ═══════════════════════════════════════════════════════════ */

.we-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height, 52px));
    overflow: hidden;
}

/* ─── Toolbar ────────────────────────────────────────────── */

.we-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    gap: 12px;
}

.we-toolbar-left,
.we-toolbar-center,
.we-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.we-toolbar-left .btn-back {
    padding: 4px 8px;
    font-size: 12px;
}

.we-title {
    font-weight: 700;
    font-size: 15px;
    color: #111827;
}

.we-date {
    font-size: 13px;
    color: #6b7280;
}

.we-btn-small {
    padding: 5px 12px !important;
    font-size: 12px !important;
}

/* ─── Gravity Toggle ─────────────────────────────────────── */

.we-gravity-group {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.we-gravity-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 6px;
}

.we-gravity-btn {
    width: 30px;
    height: 28px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.we-gravity-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.we-gravity-btn.we-gravity-active {
    background: #2563eb;
    color: white;
    border-color: #1d4ed8;
}

/* ─── Zoom Controls ──────────────────────────────────────── */

.we-zoom-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.we-zoom-btn {
    width: 28px;
    height: 26px;
    border: none;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.we-zoom-btn:hover {
    background: #f3f4f6;
    color: #111827;
}

.we-zoom-level {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #6b7280;
    min-width: 36px;
    text-align: center;
}

/* ─── Grid Opacity Slider ────────────────────────────────── */

.we-grid-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.we-grid-slider label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.we-grid-slider input[type="range"] {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.we-grid-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

/* ─── Body: Canvas + Sidebar ─────────────────────────────── */

.we-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.we-canvas-area {
    flex: 1;
    overflow: hidden;
    background: #e5e7eb;
    position: relative;
}

.we-canvas-area .pc-svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ─── Sidebar ────────────────────────────────────────────── */

.we-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    border-left: 1px solid #e5e7eb;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ─── Sidebar Tabs ───────────────────────────────────────── */

.we-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.we-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 4px 6px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.15s;
}

.we-tab:hover {
    color: #6b7280;
    background: #f9fafb;
}

.we-tab-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.we-tab svg {
    width: 18px;
    height: 18px;
}

.we-tab-badge {
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    position: absolute;
    top: 3px;
    right: 3px;
}

.we-tab {
    position: relative;
}

.we-tab-disabled {
    opacity: 0.4;
    cursor: default;
}

.we-setting-default {
    font-weight: 400;
    color: #9ca3af;
    font-size: 11px;
}

/* ─── Sidebar Resize Handle ──────────────────────────────── */

.we-sidebar-resize {
    width: 5px;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.15s;
}

.we-sidebar-resize:hover,
.we-sidebar-resize:active {
    background: #2563eb;
}

.we-sidebar {
    position: relative;
}

/* ─── Tab Panels ─────────────────────────────────────────── */

.we-tab-panel {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.we-tab-panel-active {
    display: block;
}

/* ─── Settings Rows ──────────────────────────────────────── */

.we-setting-row {
    margin-bottom: 10px;
}

.we-setting-row label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.we-setting-input {
    display: flex;
    align-items: center;
    gap: 4px;
}

.we-setting-input input[type="number"] {
    width: 80px;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
}

.we-setting-input input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.08);
}

.we-setting-unit {
    font-size: 12px;
    color: #9ca3af;
}

.we-setting-help {
    font-size: 11px;
    color: #9ca3af;
    margin: 4px 0 0 0;
}

.we-setting-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #2563eb;
}

.we-full-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e5e7eb;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin-top: 4px;
}

.we-full-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2563eb;
    cursor: pointer;
}

.we-sidebar-section {
    padding: 12px 14px;
    border-bottom: 1px solid #f3f4f6;
}

.we-sidebar-section h4 {
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ─── Unplaced Ad Cards (draggable) ──────────────────────── */

.we-unplaced-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.we-ad-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}

.we-ad-card:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.we-ad-card:active {
    cursor: grabbing;
    opacity: 0.7;
}

.we-ad-number {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    min-width: 52px;
}

.we-ad-detail {
    flex: 1;
    min-width: 0;
}

.we-ad-name {
    font-size: 12px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.we-ad-dims {
    font-size: 11px;
    color: #9ca3af;
}

/* ─── Block Info Panel ───────────────────────────────────── */

.we-block-info {
    font-size: 13px;
}

.we-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
}

.we-info-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.we-info-value {
    font-size: 12px;
    color: #111827;
}

/* ─── Page Stats ─────────────────────────────────────────── */

.we-page-stats {
    font-size: 13px;
}

/* ─── Unplaced Block Cards ───────────────────────────────── */

.we-block-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    cursor: grab;
    transition: all 0.15s;
    user-select: none;
}

.we-block-card:hover {
    background: #dcfce7;
    border-color: #86efac;
}

.we-block-card:active {
    cursor: grabbing;
    opacity: 0.7;
}

.we-block-type-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #15803d;
    background: #bbf7d0;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

/* ─── Inline Block Edit ──────────────────────────────────── */

.we-edit-block {
    font-size: 13px;
}

.we-edit-row {
    margin-bottom: 8px;
}

.we-edit-row label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 3px;
}

.we-edit-row input[type="text"],
.we-edit-row input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
}

.we-edit-row input[type="text"] {
    width: 100%;
    box-sizing: border-box;
}

.we-edit-row input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.08);
}

.we-edit-readonly {
    font-size: 13px;
    color: #374151;
}

.we-edit-size {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
}

.we-edit-ad-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.we-edit-ad-number {
    font-size: 12px;
    font-weight: 700;
    color: #2563eb;
    white-space: nowrap;
    background: #eff6ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #bfdbfe;
}

.we-edit-ad-label input {
    flex: 1;
    min-width: 0;
}

/* ─── Section Header with Add Button ─────────────────────── */

.we-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.we-section-header h4 {
    margin: 0;
}

.we-add-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #d1d5db;
    background: white;
    color: #6b7280;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.we-add-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

/* ─── Add Block Form ─────────────────────────────────────── */

.we-add-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
}

.we-add-form .we-edit-row {
    margin-bottom: 6px;
}

.we-add-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.we-btn-cancel {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}

.we-btn-cancel:hover {
    color: #374151;
}

/* ─── Unplaced Card Edit ─────────────────────────────────── */

.we-ad-card-wrap {
    margin-bottom: 4px;
}

.we-ad-card {
    position: relative;
}

.we-edit-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.15s;
}

.we-ad-card:hover .we-edit-icon {
    opacity: 1;
}

.we-edit-icon:hover {
    color: #2563eb;
    background: #eff6ff;
}

.we-inline-edit {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0 0 6px 6px;
    padding: 8px 10px;
    margin-top: -2px;
}

.we-inline-edit .we-edit-row {
    margin-bottom: 5px;
}

/* ─── Classified Tab ─────────────────────────────────────── */

.we-classified-stats {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 6px;
    padding: 10px;
}

.we-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 13px;
}

.we-stat-label {
    color: #6b7280;
}

.we-stat-value {
    font-weight: 600;
    color: #374151;
}

.we-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    background: white;
}

.we-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.08);
}

.we-class-block-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
}

.we-class-block-item:last-child {
    border-bottom: none;
}

.we-class-block-page {
    font-weight: 700;
    color: #ec4899;
    min-width: 28px;
}

.we-class-block-ci {
    margin-left: auto;
    color: #9ca3af;
    font-size: 11px;
}