/* TWIY Admin — panou intern, aceleași token-uri de brand, ton utilitar */
:root {
  --bg: #08070a;
  --surface: #121016;
  --surface-2: #17141c;
  --ink: #f5f3f7;
  --muted: #8f8a96;
  --line: #24212b;
  --accent: #ff2f7b;
  --accent-glow: #ff5fa8;
  --accent-ink: #08070a;
  --ok: #6ee7a8;
  --font-tech: "Chakra Petch", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --radius: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ---------- Form primitives ---------- */
.afield { margin-bottom: 1rem; }
.afield label {
  display: block;
  font-family: var(--font-tech);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  margin-bottom: .5em;
}
.afield input, .afield select, .afield textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .7em .9em;
  transition: border-color .25s, box-shadow .25s;
}
.afield textarea { resize: vertical; }
.afield input:focus, .afield textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,47,123,.15);
}
.afield--split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.afield--check { display: flex; align-items: end; padding-bottom: .4em; }
.afield--check label {
  display: flex; align-items: center; gap: .6em;
  text-transform: none; letter-spacing: 0;
  font-size: .9rem; color: var(--ink); font-family: var(--font-body);
}
.afield--check input { width: auto; accent-color: var(--accent); }
.afield input[type="file"] { padding: .5em; font-size: .85rem; }

.abtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  font-family: var(--font-tech);
  font-weight: 700;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .85em 1.6em;
  border-radius: 999px;
  transition: background .3s var(--ease), box-shadow .3s, color .3s, border-color .3s, transform .2s;
}
.abtn--solid { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 18px rgba(255,47,123,.3); }
.abtn--solid:hover { background: var(--accent-glow); box-shadow: 0 0 30px rgba(255,47,123,.5); }
.abtn--ghost { border: 1px solid var(--line); color: var(--ink); }
.abtn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.abtn--wide { width: 100%; }
.abtn--danger { border: 1px solid var(--line); color: var(--muted); }
.abtn--danger:hover { border-color: #ff4d4d; color: #ff4d4d; }
.abtn:disabled { opacity: .5; cursor: wait; }

.form-status { font-size: .85rem; color: var(--accent); min-height: 1.3em; margin-top: .6em; }
.form-status--ok { color: var(--ok); }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255,47,123,.14), transparent 60%),
    var(--bg);
}
.login__card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2.5rem 2.2rem;
}
.login__logo { width: 180px; margin: 0 auto .6rem; }
.login__sub {
  text-align: center;
  font-family: var(--font-tech);
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: var(--muted);
  margin-bottom: 2rem;
}
.login__error { color: #ff4d4d; font-size: .85rem; text-align: center; min-height: 1.3em; margin-top: .8em; }

/* ---------- App layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line);
  padding: 1.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
}
.sidebar__logo { width: 130px; }
.sidebar__nav { display: grid; gap: .3rem; flex: 1; }
.sidebar__link {
  display: flex;
  align-items: center;
  gap: .6em;
  text-align: left;
  font-family: var(--font-tech);
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: .8em 1em;
  border-radius: 10px;
  transition: background .25s, color .25s;
}
.sidebar__link:hover { color: var(--ink); background: var(--surface-2); }
.sidebar__link.is-active { color: var(--accent); background: rgba(255,47,123,.08); }
.badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .7rem;
  padding: .1em .6em;
  border-radius: 999px;
}
.sidebar__foot {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: grid;
  gap: .4rem;
}
.sidebar__user { font-weight: 700; font-size: .9rem; }
.sidebar__logout {
  text-align: left;
  color: var(--muted);
  font-size: .82rem;
  transition: color .25s;
}
.sidebar__logout:hover { color: var(--accent); }

.main { padding: 2.4rem clamp(1.4rem, 4vw, 3.5rem); max-width: 1100px; }
.view__title { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.view__sub { color: var(--muted); margin-bottom: 2rem; }
.view__head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Dashboard ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.stat__value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.stat__value.accent { color: var(--accent); }
.stat__label {
  font-family: var(--font-tech);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  margin-top: .4em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.panel--form { max-width: 460px; }
.panel__title {
  font-family: var(--font-tech);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

/* ---------- Mesaje ---------- */
.msg-list { display: grid; gap: .8rem; }
.msg {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  transition: border-color .25s;
}
.msg--unread { border-left: 3px solid var(--accent); }
.msg__head {
  display: flex;
  align-items: baseline;
  gap: .8em;
  flex-wrap: wrap;
  margin-bottom: .5em;
}
.msg__name { font-weight: 800; }
.msg__contact { color: var(--muted); font-size: .85rem; }
.msg__contact a { color: var(--accent); text-decoration: none; }
.msg__date { margin-left: auto; color: var(--muted); font-size: .78rem; }
.msg__budget {
  display: inline-block;
  font-family: var(--font-tech);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  border: 1px solid rgba(255,47,123,.35);
  border-radius: 999px;
  padding: .15em .8em;
  margin-bottom: .6em;
}
.msg__body { color: var(--ink); white-space: pre-wrap; }
.msg__actions { display: flex; gap: .6rem; margin-top: .9rem; }
.msg__actions button {
  font-family: var(--font-tech);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  padding: .4em .9em;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .25s, border-color .25s;
}
.msg__actions button:hover { color: var(--accent); border-color: var(--accent); }
.msg__actions button.danger:hover { color: #ff4d4d; border-color: #ff4d4d; }
.empty { color: var(--muted); padding: 1.5rem; text-align: center; }

/* ---------- Proiecte ---------- */
.project-list { display: grid; gap: .8rem; margin-top: 1.5rem; }
.project {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 1.2rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.project__thumb {
  width: 110px; height: 74px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.project__title { font-weight: 800; }
.project__meta { color: var(--muted); font-size: .82rem; }
.project__status {
  display: inline-block;
  font-family: var(--font-tech);
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .2em .8em;
  border-radius: 999px;
  margin-top: .3em;
}
.project__status--on { color: var(--ok); border: 1px solid rgba(110,231,168,.4); }
.project__status--off { color: var(--muted); border: 1px solid var(--line); }
.project__actions { display: flex; gap: .5rem; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.5rem; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(5,4,7,.75); backdrop-filter: blur(6px); }
.modal__card {
  position: relative;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 2rem;
}
.modal__title { font-size: 1.3rem; font-weight: 800; margin-bottom: 1.4rem; }
.modal__preview { margin-top: .8rem; border-radius: 8px; max-height: 180px; border: 1px solid var(--line); }
.modal__actions { display: flex; justify-content: flex-end; gap: .8rem; margin-top: 1.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .sidebar__nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; }
  .sidebar__foot { border: 0; padding: 0; margin-left: auto; grid-auto-flow: column; align-items: center; gap: 1rem; }
  .project { grid-template-columns: 80px 1fr; }
  .project__actions { grid-column: 1 / -1; }
}
