/* Albume — stiluri de bază și componente comune */
:root {
  --ink: #1c2130;        /* bara de sus, texte puternice */
  --ink-2: #2b3245;
  --ink-soft: #3b4460;
  --bg: #f3f1ed;         /* zona de lucru */
  --panel: #ffffff;
  --panel-2: #faf9f7;
  --line: #e2ded6;
  --line-2: #d1ccc2;
  --text: #22252e;
  --muted: #6c7180;
  --accent: #5146e0;     /* acțiuni, selecție */
  --accent-2: #4037c4;
  --accent-soft: #ecebfd;
  --ok: #1f9d55;
  --warn: #c77700;
  --danger: #d23f3f;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(20, 24, 40, 0.16), 0 2px 6px rgba(20, 24, 40, 0.08);
  --shadow-sm: 0 1px 3px rgba(20, 24, 40, 0.12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Playfair Display 400", Georgia, serif;
  --topbar-h: 52px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.ic { flex: none; display: block; }
#app { height: 100%; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.scroll { overflow: auto; }

/* butoane */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--text); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: #bdb7ab; }
.btn:focus-visible, .inp:focus-visible, .menu-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b93333; border-color: #b93333; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: rgba(20, 24, 40, .06); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

/* câmpuri */
.inp { height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; width: 100%; min-width: 0; }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; }
select.inp { padding-right: 6px; }
.inp-num { width: 64px; text-align: right; padding: 0 6px; height: 30px; }
.inp-hex { width: 84px; height: 30px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field > small { color: var(--muted); font-size: 12px; }
.slider { display: flex; align-items: center; gap: 8px; }
.slider input[type=range] { accent-color: var(--accent); }
.slider .unit { color: var(--muted); font-size: 12px; }
.color-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-pick { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line-2); border-radius: 7px; background: none; cursor: pointer; }
.swatches { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); padding: 0; }
.seg { align-self: flex-start; display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-right: 1px solid var(--line); background: transparent; font-size: 13px; }
.seg-btn:last-child { border-right: 0; }
.seg-btn.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 36px; height: 20px; border-radius: 20px; background: #c9c5bc; position: relative; transition: background .15s; flex: none; }
.toggle-ui::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dialog */
.overlay { position: fixed; inset: 0; background: rgba(18, 21, 32, .5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.dlg { background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px 22px; }
.dlg-head h2 { font-size: 18px; }
.dlg-x { border: 0; background: transparent; color: var(--muted); padding: 6px; border-radius: 6px; }
.dlg-x:hover { background: rgba(0, 0, 0, .06); color: var(--text); }
.dlg-body { padding: 10px 22px 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px 18px; }
.dlg-text { margin: 0; color: var(--ink-soft); }
.dlg.busy .dlg-body { opacity: .6; pointer-events: none; }

/* popover + meniu */
.pop { position: fixed; z-index: 1100; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; max-width: min(420px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; }
.pop.pad { padding: 14px; }
.menu { display: flex; flex-direction: column; min-width: 190px; }
.menu-item { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: 7px; text-align: left; width: 100%; }
.menu-item:hover:not(:disabled) { background: rgba(20, 24, 40, .06); }
.menu-item:disabled { opacity: .45; cursor: default; }
.menu-item.danger { color: var(--danger); }
.menu-ic { width: 16px; display: inline-flex; color: var(--accent); }
.menu-label { flex: 1; }
.menu-hint { color: var(--muted); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-head { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }

/* notificări */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1300; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); animation: toast-in .2s ease-out; }
.toast-error { background: #9f2a2a; }
.toast-ok { background: #17713f; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .22s; }
.toast-act { border: 0; background: rgba(255, 255, 255, .16); color: #fff; padding: 4px 10px; border-radius: 6px; font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* tragere */
.drag-ghost { position: fixed; z-index: 1400; pointer-events: none; transform: translate(-50%, -50%); opacity: .88; box-shadow: var(--shadow); border-radius: 6px; overflow: hidden; }
body.dragging { cursor: grabbing; user-select: none; }
body.dragging * { cursor: grabbing !important; }

/* bara de sus */
.topbar { height: var(--topbar-h); flex: none; background: var(--ink); color: #e9ebf3; display: flex; align-items: center; gap: 4px; padding: 0 10px; }
.topbar .sep { width: 1px; height: 22px; background: rgba(255, 255, 255, .14); margin: 0 6px; }
.topbar .tb { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 9px; border: 0; border-radius: 7px; background: transparent; color: inherit; font-size: 13px; }
.topbar .tb:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.topbar .tb:disabled { opacity: .35; cursor: default; }
.topbar .tb.on { background: rgba(255, 255, 255, .16); }
.topbar .tb-primary { background: var(--accent); color: #fff; font-weight: 600; padding: 0 13px; }
.topbar .tb-primary:hover:not(:disabled) { background: #6258ee; }
.topbar .title { font-weight: 600; font-size: 14px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.topbar .brand { font-family: var(--display); font-size: 19px; letter-spacing: .01em; padding: 0 10px 0 6px; color: #fff; text-decoration: none; }
.topbar .save-state { font-size: 12px; color: #a9afc4; padding: 0 8px; white-space: nowrap; }
.topbar .save-state.error { color: #ffb4a8; }
.topbar .pages { display: inline-flex; align-items: center; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: 8px; padding: 2px; }
.topbar .pages input { width: 44px; height: 28px; border: 0; border-radius: 6px; background: #fff; color: var(--text); text-align: center; font-weight: 600; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #6d74f0; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }

/* pagini simple */
.page { flex: 1; overflow: auto; }
.page-inner { max-width: 1180px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-weight: 400; font-size: 30px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.section-title .count { background: #e4e0d8; color: var(--ink-soft); border-radius: 20px; padding: 1px 8px; font-size: 12px; letter-spacing: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; position: relative; }
a.card:hover, .card.clickable:hover { box-shadow: var(--shadow); border-color: var(--line-2); transform: translateY(-1px); }
.card-thumb { aspect-ratio: 3 / 2; background: #e7e3db; display: flex; align-items: center; justify-content: center; color: #a8a295; overflow: hidden; }
.card-thumb img, .card-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-thumb.contain canvas, .card-thumb.contain img { object-fit: contain; }
.card-body { padding: 11px 13px 12px; display: flex; align-items: flex-start; gap: 8px; }
.card-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 12.5px; }
.card-more { margin: -4px -6px 0 auto; }
.card-add { border: 1.5px dashed var(--line-2); background: transparent; align-items: center; justify-content: center; gap: 8px; min-height: 150px; color: var(--ink-soft); font-weight: 600; cursor: pointer; }
.card-add:hover { border-color: var(--accent); color: var(--accent-2); background: var(--accent-soft); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #e4e0d8; color: var(--ink-soft); }
.badge.ok { background: #dcf3e5; color: #17713f; }
.badge.warn { background: #fbecd0; color: #8a5300; }
.badge.accent { background: var(--accent-soft); color: var(--accent-2); }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }

/* autentificare */
.login { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, #1c2130 0%, #2c3350 100%); }
.login-box { width: min(380px, 100%); background: var(--panel); border-radius: 16px; padding: 30px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-family: var(--display); font-weight: 400; font-size: 32px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* încărcare poze */
.drop { border: 2px dashed var(--line-2); border-radius: 14px; background: var(--panel); padding: 44px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-soft); transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop h2 { font-size: 20px; }
.drop .link { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.specs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; }
.spec { display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.spec + .spec { border-left: 1px solid var(--line); }
.spec .dot { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); display: flex; align-items: center; justify-content: center; flex: none; }
.spec b { display: block; font-size: 13.5px; }
.spec small { color: var(--muted); }
.progress { height: 8px; background: #e4e0d8; border-radius: 8px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.choice { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); }
.choice.off > .choice-body { display: none; }
.choice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.choice-head b { font-size: 15px; }
.choice-body { display: flex; flex-direction: column; gap: 12px; }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper input { width: 60px; text-align: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: #fff; font-size: 13px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #d9d5cc; border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .specs { grid-template-columns: 1fr; }
  .spec + .spec { border-left: 0; border-top: 1px solid var(--line); }
  .page-inner { padding: 18px 14px 50px; }
}
