/* Zuvi Admin UI — Modernes Sidebar-Layout */

* { box-sizing: border-box; }

:root {
    --c-brand: #C2410C;
    --c-brand-light: #FB923C;
    --c-brand-dark: #7C2D12;
    --c-cream: #FFF7ED;
    --c-warm-gray: #F5E9DA;
    --c-text: #0F0A06;
    --c-text-muted: #6B5D4F;
    --c-bg: #FAFAF7;
    --c-bg-alt: #F5F0E8;
    --c-bg-dark: #0F0A06;
    --c-bg-dark-alt: #1F1A14;
    --c-border: #E5DDD0;
    --c-success: #16A34A;
    --c-warning: #EAB308;
    --c-error: #DC2626;
    --c-premium: #D97706;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.5;
}

/* LOGIN */
.login-section {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--c-cream) 0%, var(--c-warm-gray) 100%);
}

.login-card {
    width: 420px;
    max-width: 90vw;
    background: white;
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.1);
    text-align: center;
}

.login-card .logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 32px;
    margin-bottom: 8px;
}

.login-card h1 {
    font-family: var(--font-display);
    font-size: 24px;
    margin: 16px 0 8px;
}

.login-card input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    margin: 24px 0 16px;
    font-size: 14px;
    font-family: inherit;
}

.login-card button {
    width: 100%;
    padding: 14px;
    background: var(--c-brand);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover { background: var(--c-brand-dark); }

.login-card .hint {
    color: var(--c-text-muted);
    font-size: 13px;
    margin-top: 16px;
}

.login-card .hint code {
    background: var(--c-cream);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* MAIN APP — Sidebar Layout */
#app-section {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--c-bg-dark);
    color: white;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    padding: 8px 12px 24px;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.15s;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: var(--c-brand);
    color: white;
}

.nav-item .icon {
    font-size: 18px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    padding: 10px 16px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.15s;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.main-content {
    padding: 32px 48px;
    overflow-x: hidden;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 32px;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.page-header .subtitle {
    color: var(--c-text-muted);
    margin: 0;
    font-size: 14px;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
    padding: 10px 16px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: white;
    font-size: 14px;
    font-family: inherit;
}

.filter-bar input { flex: 1; min-width: 240px; }

/* BUTTONS */
.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary {
    background: var(--c-brand);
    color: white;
}

.btn-primary:hover { background: var(--c-brand-dark); }

.btn-secondary {
    background: var(--c-warm-gray);
    color: var(--c-text);
    border: 1px solid var(--c-border);
}

.btn-secondary:hover { background: var(--c-border); }

.btn-danger {
    background: var(--c-error);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--c-text);
    border: 1px solid var(--c-border);
}

.btn-ghost:hover { background: var(--c-cream); }

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* RECIPE GRID */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.recipe-card {
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.2s;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: var(--c-brand-light);
}

.recipe-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.recipe-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0;
    flex: 1;
}

.recipe-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.badge {
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-premium {
    background: var(--c-premium);
    color: white;
}

.badge-draft {
    background: var(--c-warm-gray);
    color: var(--c-text-muted);
}

.badge-archived {
    background: var(--c-bg-alt);
    color: var(--c-text-muted);
}

.recipe-meta {
    color: var(--c-text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.recipe-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.recipe-tag {
    background: var(--c-cream);
    color: var(--c-text-muted);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
}

.recipe-actions {
    display: flex;
    gap: 6px;
}

.recipe-actions button {
    flex: 1;
}

/* PARTNER GRID */
.partner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.partner-card {
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 20px;
}

.partner-card h3 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0 0 8px;
}

.partner-contact {
    color: var(--c-text-muted);
    font-size: 13px;
    margin: 4px 0;
}

.partner-stats {
    display: flex;
    gap: 16px;
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
}

.partner-stat {
    text-align: center;
    flex: 1;
}

.partner-stat-value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
}

.partner-stat-label {
    font-size: 11px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* USER LIST */
.user-list {
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    overflow: hidden;
}

.user-row {
    display: grid;
    grid-template-columns: 1fr 1fr 100px 100px 120px;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
    align-items: center;
}

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

.user-row.header {
    background: var(--c-cream);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
}

.user-email {
    font-weight: 500;
}

.user-name {
    color: var(--c-text-muted);
    font-size: 13px;
}

.user-premium-yes {
    color: var(--c-premium);
    font-weight: 600;
}

.user-premium-no {
    color: var(--c-text-muted);
}

/* STATS */
.stats-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 24px;
}

.stat-label {
    font-size: 12px;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

.stat-sublabel {
    color: var(--c-text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.stats-section {
    background: white;
    border: 1px solid var(--c-border);
    border-radius: 16px;
    padding: 24px;
}

.stats-section h2 {
    font-family: var(--font-display);
    font-size: 20px;
    margin: 0 0 16px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th,
.stats-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    font-size: 13px;
}

.stats-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
    font-weight: 600;
}

.stats-table td.numeric {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.missing-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.missing-list li {
    padding: 8px 12px;
    background: var(--c-cream);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.missing-list li strong {
    font-family: var(--font-display);
    margin-right: 8px;
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 32px;
}

.modal[hidden] { display: none !important; }

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1;
}

.modal-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    margin: 0;
}

.btn-close {
    background: transparent;
    color: var(--c-text-muted);
    font-size: 28px;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

/* EDITOR TABS */
.editor-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    border-bottom: 1px solid var(--c-border);
    background: var(--c-bg-alt);
}

.editor-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    color: var(--c-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}

.editor-tab:hover { color: var(--c-text); }

.editor-tab.active {
    color: var(--c-brand);
    border-bottom-color: var(--c-brand);
}

.editor-panel {
    padding: 24px;
}

.editor-panel[hidden] { display: none; }

form {
    padding: 0;
}

fieldset {
    border: 1px solid var(--c-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

legend {
    font-weight: 700;
    padding: 0 12px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

label:last-child { margin-bottom: 0; }

input, textarea, select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    margin-top: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    display: block;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background 0.15s;
}

.checkbox-label:hover { background: var(--c-cream); }

.checkbox-label input {
    margin: 0;
    width: auto;
}

/* TAG PICKER */
.tag-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tag-btn {
    padding: 8px 14px;
    border: 1px solid var(--c-border);
    background: white;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.15s;
    color: var(--c-text);
}

.tag-btn:hover {
    border-color: var(--c-brand);
}

.tag-btn.selected {
    background: var(--c-brand);
    color: white;
    border-color: var(--c-brand);
}

/* DYNAMIC LISTS */
.dynamic-item {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    padding: 12px;
    background: var(--c-cream);
    border-radius: 10px;
}

.ingredient-row {
    grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
}

.step-row {
    grid-template-columns: 1fr;
}

.step-row textarea {
    min-height: 60px;
}

.step-row .step-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 8px;
    margin-top: 8px;
}

.step-row .step-tip {
    margin-top: 8px;
}

.mise-row {
    grid-template-columns: 1fr auto;
}

.dynamic-item .remove-btn {
    background: transparent;
    color: var(--c-text-muted);
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 0 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--c-border);
    background: var(--c-bg-alt);
    border-radius: 0 0 20px 20px;
    position: sticky;
    bottom: 0;
}

.loading {
    text-align: center;
    color: var(--c-text-muted);
    padding: 40px;
}

/* PHONE FRAME — App Preview */
.phone-frame {
    width: 375px;
    height: 812px;
    background: #000;
    border-radius: 48px;
    padding: 12px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.phone-notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #000;
    border-radius: 0 0 16px 16px;
    z-index: 2;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--c-bg);
    border-radius: 36px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.app-preview-header {
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-dark) 100%);
    color: white;
    padding: 56px 20px 32px;
    text-align: center;
}

.app-preview-body { padding: 20px; }

.app-step-num {
    display: inline-block;
    background: var(--c-brand);
    color: white;
    font-weight: 700;
    font-size: 14px;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 12px;
}

.app-step-text {
    font-family: var(--font-display);
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 16px;
}

.app-step-meta {
    display: flex;
    gap: 12px;
    color: var(--c-text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.app-tip-box {
    background: var(--c-cream);
    padding: 16px;
    border-radius: 12px;
    margin: 16px 0;
}

.app-tip-label {
    color: var(--c-brand);
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 6px;
}

.app-tip-text {
    font-size: 14px;
    line-height: 1.5;
}

.app-progress {
    height: 4px;
    background: var(--c-warm-gray);
    border-radius: 2px;
    margin: 24px 0;
    overflow: hidden;
}

.app-progress-bar {
    height: 100%;
    background: var(--c-brand);
    width: 50%;
}

@media (max-width: 1024px) {
    #app-section { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-content { padding: 16px; }
}