/* ===== ADD SERVICE PAGE ===== */
.page-add-service { background: var(--bg); }

.add-service-page { padding: 20px 0 48px; }

.add-service-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.add-service-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.3;
}
.add-service-header p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Form layout */
.add-form-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
}

.form-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
}
.form-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-section-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--text);
}
.form-label .required { color: var(--red); margin-left: 2px; }

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(1,119,255,0.08);
}
.form-textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}
.form-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

.bb-editor-toolbar,
.task-editor-toolbar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #fafbfc;
}
.bb-editor-toolbar button,
.task-editor-toolbar button {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
}
.bb-editor-toolbar button:hover,
.task-editor-toolbar button:hover {
    background: #eef2f7;
    color: var(--primary);
}

.bb-editor-wrap .bb-editor-toolbar,
.bb-editor-wrap .task-editor-toolbar {
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
}
.bb-editor-field {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    background: #fff;
}
.bb-editor-source {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.bb-editor-surface {
    min-height: 180px;
    max-height: 420px;
    overflow: auto;
    padding: 10px 12px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: #374151;
    word-break: break-word;
    outline: none;
}
.bb-editor-surface.is-empty:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.bb-editor-surface ul,
.bb-editor-surface ul.bb-list {
    margin: 0.5em 0;
    padding-left: 1.4em;
}
.bb-editor-surface strong { font-weight: 700; }
.bb-editor-surface em { font-style: italic; }
.bb-content ul.bb-list,
.bb-content ul { margin: 0.75em 0; padding-left: 1.4em; }
.bb-content strong { font-weight: 700; }
.bb-content em { font-style: italic; }

@media (max-width: 768px) {
    .bb-editor-surface { min-height: 140px; }
}

/* Image upload */
.upload-block { margin-bottom: 16px; }
.upload-block:last-child { margin-bottom: 0; }
.upload-label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}
.upload-label .required { color: var(--red); }

.image-upload {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
    position: relative;
}
.image-upload:hover,
.image-upload.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.image-upload i {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.image-upload-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.image-upload-hint { font-size: 0.75rem; color: var(--text-muted); }
.image-upload input[type="file"] { display: none; }

.upload-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;
    max-width: 480px;
}
.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.upload-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}
.upload-preview-remove:hover { background: var(--red); }
.upload-preview-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
}

.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.uploaded-image {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.uploaded-image img { width: 100%; height: 100%; object-fit: cover; }
.uploaded-image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.65rem;
    border: none;
    transition: var(--transition);
}
.uploaded-image-remove:hover { background: var(--red); }

/* Package mode toggle */
.package-mode {
    display: flex;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 20px;
    max-width: 400px;
}
.package-mode-btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.package-mode-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* Package tabs (3 packages mode) */
.package-tabs-edit {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}
.package-tab-edit {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.package-tab-edit:hover { color: var(--primary); }
.package-tab-edit.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.package-panel { display: none; }
.package-panel.active { display: block; }

/* Price stepper */
.price-field {
    display: flex;
    align-items: stretch;
    max-width: 280px;
}
.price-field .form-input {
    flex: 1;
    min-width: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    text-align: center;
    font-weight: 700;
    font-size: 1rem;
    height: 44px;
}
.price-step-btn {
    width: 44px;
    height: 44px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.price-step-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.price-step-btn.price-minus { border-radius: 8px 0 0 8px; }
.price-step-btn.price-plus { border-radius: 0; }
.price-currency {
    padding: 0 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-left: none;
    border-radius: 0 8px 8px 0;
    height: 44px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Package options (what's included) */
.package-options-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.package-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.package-option-row .form-input { flex: 1; }
.btn-remove-option {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #FFEBEE;
    color: var(--red);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-remove-option:hover { background: var(--red); color: white; }
.btn-add-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn-add-option:hover { background: var(--primary); color: white; }

/* Extra options section */
.extra-options-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.extra-option-row {
    display: grid;
    grid-template-columns: 1fr minmax(240px, 300px) 36px;
    gap: 10px;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
}
.extra-price-field {
    min-width: 0;
}
.extra-price-field .form-input.extra-price {
    min-width: 88px;
    text-align: center;
}
.extra-option-row .price-field { max-width: none; }
.extra-option-row .price-field .form-input { font-size: 0.88rem; height: 40px; }
.extra-option-row .price-step-btn { height: 40px; width: 36px; font-size: 0.95rem; }
.extra-option-row .price-currency { height: 40px; font-size: 0.82rem; padding: 0 10px; }

/* Sidebar */
.form-sidebar { position: sticky; top: 80px; }
.sidebar-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.sidebar-card h3 {
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 14px;
}
.sidebar-steps { display: flex; flex-direction: column; gap: 10px; }
.sidebar-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.sidebar-step i {
    width: 20px;
    text-align: center;
    font-size: 0.75rem;
}
.sidebar-step.done { color: var(--green); }
.sidebar-step.active { color: var(--primary); font-weight: 600; }

.sidebar-tip {
    background: var(--primary-light);
    border-radius: 10px;
    padding: 14px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.sidebar-tip strong { display: block; color: var(--primary); margin-bottom: 4px; font-size: 0.82rem; }

.form-actions-sidebar { display: flex; flex-direction: column; gap: 10px; }
.btn-submit {
    padding: 13px;
    font-size: 0.92rem;
    font-weight: 700;
}
.btn-draft {
    padding: 11px;
    font-size: 0.85rem;
}

.form-actions-mobile {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    gap: 10px;
    z-index: 150;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.form-actions-mobile .btn { flex: 1; padding: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .add-form-layout { grid-template-columns: 1fr; }
    .form-sidebar { display: none; }
}

@media (max-width: 768px) {
    .add-service-page { padding: 12px 0 80px; }
    .add-service-header h1 { font-size: 1.2rem; }
    .form-section { padding: 18px 16px; }
    .form-row { grid-template-columns: 1fr; }
    .extra-option-row {
        grid-template-columns: 1fr;
    }
    .form-actions-mobile { display: flex; }
    .page-add-service { padding-bottom: 70px; }
}
