/* Tabs strip below topbar */
.editor-tabs {
    position: sticky;
    top: var(--header-h);
    z-index: 25;
    background: var(--surface);
    border-bottom: 1px solid var(--divider);
    padding: 10px 16px;
}
.editor-tabs .tabs {
    max-width: 720px;
    margin: 0 auto;
}

.editor-container {
    height: calc(100vh - var(--header-h) - 56px);
    overflow: hidden;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

/* ── Left panel: list of recipes / ingredients ─────────────────────────── */
.editor-list-panel {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--divider);
    overflow-y: auto;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.editor-new-btn {
    margin: 10px 12px;
    justify-content: center;
}

.editor-search {
    padding: 0 12px 8px;
}

.editor-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--divider);
}
.editor-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid var(--divider);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.editor-list-item:hover { background: var(--primary-light); }
.editor-list-item.active {
    background: var(--primary-light);
    border-left-color: var(--primary);
}
.eli-name { flex: 1; font-size: 0.95rem; }
.eli-meta { font-size: 0.78rem; color: var(--text-secondary); }

/* ── Right panel: editor ───────────────────────────────────────────────── */
.editor-panel {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg);
}

.editor-card {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 12px;
    text-align: center;
    padding: 32px;
}
.editor-empty-icon {
    font-size: 48px;
    line-height: 1;
    opacity: 0.5;
}

/* ── Form row helpers ──────────────────────────────────────────────────── */
.field-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.ico-btn {
    flex-shrink: 0;
    width: 38px;
    padding: 8px 0;
    justify-content: center;
}

/* ── Ingredient table ──────────────────────────────────────────────────── */
.ing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}
.ing-header .card-title { margin: 0; }

.ing-table {
    width: 100%;
    border-collapse: collapse;
}
.ing-table th {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 4px 6px 6px;
    border-bottom: 1px solid var(--divider);
    text-align: left;
}
.ing-row td {
    padding: 4px 6px;
    vertical-align: middle;
}
.ing-row .input { padding: 6px 10px; font-size: 0.9rem; }

.ing-name-cell { width: 65%; }
.ing-qty-cell  { width: 22%; }
.ing-del-cell  { width: 38px; text-align: center; }
.qty-input { text-align: right; }

.instructions-textarea {
    min-height: 180px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Actions row ───────────────────────────────────────────────────────── */
.editor-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--divider);
}
.editor-actions .grow { flex: 1; }

.btn-warn {
    background: #d32f2f;
    color: white;
}
.btn-warn:hover { background: #b71c1c; }

[ng-cloak] { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .editor-container {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    .editor-list-panel {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid var(--divider);
    }
    .editor-panel {
        padding: 14px;
    }
}
