/* ═══════════════════════════════════════════════════════
   Netcrom Studio — stylesheet
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --s-bg:          #0f0e17;
    --s-sidebar:     #16151f;
    --s-sidebar-w:   240px;
    --s-accent:      #7c3aed;
    --s-accent-soft: #ede9fe;
    --s-text:        #e2e0f0;
    --s-muted:       #6b6883;
    --s-border:      #2a2838;
    --s-content-bg:  #f5f4fc;
    --s-white:       #ffffff;
    --s-radius:      10px;
    --s-shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--s-content-bg); color: #1e1b2e; }

/* ── Layout ─────────────────────────────────────────── */
.studio-wrapper  { display: flex; min-height: 100vh; }
.studio-sidebar  { width: var(--s-sidebar-w); background: var(--s-sidebar); display: flex; flex-direction: column; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; border-right: 1px solid var(--s-border); }
.studio-main     { margin-left: var(--s-sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.studio-content  { flex: 1; padding: 28px 32px; }

/* ── Sidebar ────────────────────────────────────────── */
.studio-logo {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--s-border);
}
.studio-logo a {
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--s-text);
    letter-spacing: -.3px;
}
.studio-logo a span { color: var(--s-accent); }

.studio-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.studio-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--s-muted);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.studio-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.studio-nav a:hover  { background: rgba(124,58,237,.12); color: var(--s-text); }
.studio-nav a.active { background: rgba(124,58,237,.18); color: #c4b5fd; }

.studio-nav-section {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--s-muted);
    padding: 16px 12px 6px;
}

.studio-sidebar__footer {
    padding: 16px 20px;
    border-top: 1px solid var(--s-border);
    font-size: .75rem;
    color: var(--s-muted);
}

/* ── Topbar ─────────────────────────────────────────── */
.studio-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    background: var(--s-white);
    border-bottom: 1px solid #e5e3f0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.studio-topbar__title { font-size: .95rem; font-weight: 600; color: #1e1b2e; }
.studio-topbar__user  { display: flex; align-items: center; gap: 12px; font-size: .85rem; color: #6b6883; }
.studio-topbar__user strong { color: #1e1b2e; }

/* ── Buttons ────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: .875rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: opacity .15s, box-shadow .15s; }
.btn--primary   { background: var(--s-accent); color: #fff; }
.btn--primary:hover { opacity: .9; box-shadow: 0 0 0 3px rgba(124,58,237,.25); }
.btn--secondary { background: transparent; color: #6b6883; border: 1px solid #d4d2e3; }
.btn--secondary:hover { background: #f0eeff; color: var(--s-accent); border-color: var(--s-accent); }
.btn--sm { padding: 5px 12px; font-size: .8rem; }
.btn--danger { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.btn--danger:hover { background: #fee2e2; }

/* ── Cards ──────────────────────────────────────────── */
.card { background: var(--s-white); border-radius: var(--s-radius); border: 1px solid #e5e3f0; box-shadow: var(--s-shadow); padding: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 1rem; font-weight: 600; color: #1e1b2e; }

/* ── Stats grid ─────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--s-white); border: 1px solid #e5e3f0; border-radius: var(--s-radius); padding: 20px; box-shadow: var(--s-shadow); }
.stat-card__label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: #6b6883; margin-bottom: 8px; }
.stat-card__value { font-size: 1.75rem; font-weight: 700; color: #1e1b2e; line-height: 1; }
.stat-card__sub   { font-size: .75rem; color: #6b6883; margin-top: 4px; }

/* ── Collection grid ────────────────────────────────── */
.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.collection-card {
    background: var(--s-white);
    border-radius: var(--s-radius);
    border: 1px solid #e5e3f0;
    box-shadow: var(--s-shadow);
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.collection-card:hover { transform: translateY(-2px); box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.collection-card__color { height: 6px; }
.collection-card__body  { padding: 18px; flex: 1; }
.collection-card__type  { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--s-muted); margin-bottom: 6px; }
.collection-card__name  { font-size: 1rem; font-weight: 600; color: #1e1b2e; margin-bottom: 4px; }
.collection-card__items { font-size: .8rem; color: var(--s-muted); }
.collection-card__footer { padding: 12px 18px; border-top: 1px solid #f0eeff; display: flex; align-items: center; justify-content: space-between; }
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 600; }
.badge--borrador  { background: #f1f5f9; color: #64748b; }
.badge--listo     { background: #fef9c3; color: #854d0e; }
.badge--publicado { background: #dcfce7; color: #166534; }

/* ── Empty state ────────────────────────────────────── */
.empty-state { text-align: center; padding: 64px 32px; }
.empty-state__icon { font-size: 3rem; margin-bottom: 16px; opacity: .3; }
.empty-state__title { font-size: 1.1rem; font-weight: 600; color: #1e1b2e; margin-bottom: 8px; }
.empty-state__text  { font-size: .875rem; color: #6b6883; margin-bottom: 24px; }

/* ── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: #3b3852; margin-bottom: 6px; }
.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d4d2e3;
    border-radius: 8px;
    font-size: .875rem;
    color: #1e1b2e;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus { border-color: var(--s-accent); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
.form-control.is-invalid { border-color: #dc2626; }
.form-text  { font-size: .75rem; color: #6b6883; margin-top: 4px; }
.form-error { font-size: .75rem; color: #dc2626; margin-top: 4px; }

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6883' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Flash ──────────────────────────────────────────── */
.studio-flash { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-radius: 8px; font-size: .875rem; margin-bottom: 16px; }
.studio-flash--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.studio-flash--error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.studio-flash__close   { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: inherit; opacity: .6; }

/* ── Login page ─────────────────────────────────────── */
.studio-login-page {
    min-height: 100vh;
    background: var(--s-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.studio-login-card {
    background: var(--s-sidebar);
    border: 1px solid var(--s-border);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.studio-login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.studio-login-logo h1 { font-size: 1.5rem; font-weight: 800; color: var(--s-text); letter-spacing: -.5px; }
.studio-login-logo h1 span { color: var(--s-accent); }
.studio-login-logo p  { font-size: .8rem; color: var(--s-muted); margin-top: 4px; }

.studio-login-card .form-label  { color: #9d9bb8; }
.studio-login-card .form-control { background: #1e1c2a; border-color: var(--s-border); color: var(--s-text); }
.studio-login-card .form-control:focus { border-color: var(--s-accent); background: #22202e; }
.studio-login-card .form-control::placeholder { color: #4a4866; }

.studio-login-card .btn--primary { width: 100%; justify-content: center; padding: 11px; font-size: .95rem; }

/* ── Wizard steps ───────────────────────────────────── */
.wizard-steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 32px;
    background: var(--s-white);
    border: 1px solid #e5e3f0;
    border-radius: var(--s-radius);
    padding: 0;
    overflow: hidden;
}
.wizard-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    font-size: .8rem;
    font-weight: 500;
    color: #9d9bb8;
    border-right: 1px solid #e5e3f0;
    position: relative;
}
.wizard-step:last-child { border-right: none; }
.wizard-step__num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e5e3f0;
    color: #9d9bb8;
    font-size: .75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wizard-step.active { color: var(--s-accent); background: #faf8ff; }
.wizard-step.active .wizard-step__num { background: var(--s-accent); color: #fff; }
.wizard-step.done { color: #059669; }
.wizard-step.done .wizard-step__num { background: #dcfce7; color: #059669; }

/* ── Form layout (2 cols) ───────────────────────────── */
.studio-form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.studio-form-main {}
.studio-form-side {}

/* ── Color picker ───────────────────────────────────── */
.color-picker-row { display: flex; align-items: center; gap: 10px; }
.color-picker-row .form-control { flex: 1; font-family: monospace; }

/* ── Properties list ───────────────────────────────── */
.prop-list { display: flex; flex-direction: column; gap: 2px; }
.prop-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    background: #faf8ff;
    border: 1px solid #e5e3f0;
    gap: 12px;
}
.prop-row__info    { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; flex-wrap: wrap; }
.prop-row__name    { font-size: .875rem; font-weight: 600; color: #1e1b2e; }
.prop-row__actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.btn-icon {
    width: 28px; height: 28px;
    border: 1px solid #e5e3f0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: .8rem;
    color: #6b6883;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.btn-icon:hover { background: #f0eeff; color: var(--s-accent); border-color: var(--s-accent); }
.btn-icon--danger:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* ── Overlay mobile ─────────────────────────────────── */
.studio-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 99; }

@media (max-width: 768px) {
    .studio-sidebar { left: calc(-1 * var(--s-sidebar-w)); transition: left .25s; }
    .studio-sidebar.open { left: 0; }
    .studio-overlay.active { display: block; }
    .studio-main { margin-left: 0; }
    .studio-content { padding: 20px 16px; }
    .studio-topbar { padding: 0 16px; }
}
