/* ממשק ניהול — שלום ואורי הפקות */
:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --ink: #221c14;
  --ink-dim: #7d7466;
  --gold: #b08a3e;
  --gold-deep: #8a6a2b;
  --gold-soft: #f3e9d4;
  --line: #e6dfd2;
  --danger: #c0453e;
  --ok: #3e8a52;
  --serif: 'Frank Ruhl Libre', Georgia, serif;
  --sans: 'Assistant', system-ui, sans-serif;
  --shadow: 0 2px 14px rgba(60, 45, 20, 0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; }
button { font-family: var(--sans); }
a { text-decoration: none; color: inherit; }

/* ---------- login ---------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 30%, #241d13, #12100c);
  padding: 1rem;
}
.login-card {
  background: var(--card); border-radius: 14px; padding: 2.6rem 2.4rem;
  width: min(400px, 100%); text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: login-in 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes login-in { from { opacity: 0; transform: translateY(24px); } }
.login-logo { max-height: 74px; max-width: 85%; width: auto; margin-inline: auto; display: block; }
.login-card h1 { font-family: var(--serif); font-size: 1.5rem; margin-top: 0.4rem; }
.login-sub { color: var(--ink-dim); font-size: 0.9rem; margin-bottom: 1.8rem; }
.login-error { color: var(--danger); font-size: 0.88rem; margin-top: 0.9rem; min-height: 1.2em; }

/* ---------- fields & buttons ---------- */
.afield { text-align: start; margin-bottom: 1rem; }
.afield label { display: block; font-size: 0.82rem; font-weight: 500; color: var(--ink-dim); margin-bottom: 0.3rem; }
.afield input, .afield select, .afield textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  padding: 0.65rem 0.8rem; font-family: var(--sans); font-size: 0.95rem;
  background: #fbfaf7; transition: border-color 0.25s, box-shadow 0.25s;
}
.afield input:focus, .afield select:focus, .afield textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(176, 138, 62, 0.15);
}
.afield textarea { resize: vertical; }
.abtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  border: none; border-radius: 8px; padding: 0.6rem 1.3rem;
  font-size: 0.92rem; font-weight: 500; cursor: pointer; transition: all 0.25s;
}
.abtn-gold { background: linear-gradient(135deg, #d3ac60, var(--gold)); color: #fff; box-shadow: 0 4px 14px rgba(176, 138, 62, 0.35); }
.abtn-gold:hover { filter: brightness(1.06); transform: translateY(-1px); }
.abtn-ghost { background: none; border: 1px solid var(--line); color: var(--ink); }
.abtn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.abtn-danger { background: #fdf0ef; color: var(--danger); border: 1px solid #f0d4d2; }
.abtn-danger:hover { background: var(--danger); color: #fff; }
.abtn-block { width: 100%; }
.abtn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.app[hidden] { display: none; }
[hidden] { display: none !important; }
.sidebar {
  width: 235px; flex-shrink: 0; background: #1c160e; color: #efe8da;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-brand {
  padding: 1.4rem 1.4rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex; align-items: center; gap: 0.6rem;
}
.side-logo { max-height: 34px; max-width: 150px; width: auto; }
.side-brand small { font-family: var(--sans); font-size: 0.7rem; font-weight: 300; color: #a99c86; letter-spacing: 0.2em; }
.side-nav { flex: 1; padding: 0.9rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; overflow-y: auto; }
.side-nav button {
  background: none; border: none; color: #c9bda9; text-align: start;
  padding: 0.62rem 0.8rem; border-radius: 8px; font-size: 0.93rem; cursor: pointer;
  transition: background 0.2s, color 0.2s; display: flex; align-items: center; gap: 0.5rem;
}
.side-nav button:hover { background: rgba(211, 172, 96, 0.1); color: #fff; }
.side-nav button.active { background: rgba(211, 172, 96, 0.18); color: #e8cf9b; font-weight: 500; }
.badge {
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700;
  border-radius: 999px; padding: 0.05rem 0.5rem; margin-inline-start: auto;
}
.side-foot { padding: 1rem 0.9rem; border-top: 1px solid rgba(255, 255, 255, 0.07); display: grid; gap: 0.5rem; }
.side-foot .abtn-ghost { border-color: rgba(255, 255, 255, 0.15); color: #c9bda9; }
.side-foot .abtn-ghost:hover { border-color: #d3ac60; color: #e8cf9b; }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.1rem 1.8rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-family: var(--serif); font-size: 1.35rem; }
.admin-name { margin-inline-start: auto; color: var(--ink-dim); font-size: 0.88rem; }
.side-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; }
.view { padding: 1.8rem; max-width: 1100px; }

/* ---------- cards / grids ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.6rem; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.3rem 1.4rem; box-shadow: var(--shadow);
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.kpi:nth-child(2) { animation-delay: 0.07s; } .kpi:nth-child(3) { animation-delay: 0.14s; } .kpi:nth-child(4) { animation-delay: 0.21s; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
.kpi-value { font-family: var(--serif); font-size: 2.1rem; font-weight: 900; color: var(--gold-deep); line-height: 1.1; }
.kpi-label { color: var(--ink-dim); font-size: 0.85rem; margin-top: 0.2rem; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.5rem; box-shadow: var(--shadow); margin-bottom: 1.4rem;
  animation: card-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.panel h3 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.hint { color: var(--ink-dim); font-size: 0.83rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: start; color: var(--ink-dim); font-weight: 500; font-size: 0.8rem; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: 0.65rem 0.6rem; border-bottom: 1px solid #f0ece3; vertical-align: middle; }
.tbl tr:hover td { background: #fbf8f2; }

/* lead status */
.status-chip { border-radius: 999px; padding: 0.15rem 0.7rem; font-size: 0.78rem; font-weight: 500; }
.status-new { background: #fdeeda; color: #a5701c; }
.status-contacted { background: #e3edfb; color: #2d5fa8; }
.status-closed { background: #e2f2e5; color: var(--ok); }
.status-lost { background: #f3f0ea; color: var(--ink-dim); }

/* ---------- gallery admin ---------- */
.gadmin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gadmin-item {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card);
  box-shadow: var(--shadow); animation: card-in 0.4s backwards;
}
.gadmin-item img { width: 100%; aspect-ratio: 9/7; object-fit: cover; display: block; }
.gadmin-item .gmeta { padding: 0.6rem 0.7rem; }
.gadmin-item .gmeta strong { font-size: 0.85rem; display: block; }
.gadmin-item .gmeta small { color: var(--ink-dim); font-size: 0.75rem; }
.gadmin-actions { display: flex; gap: 0.35rem; padding: 0 0.7rem 0.7rem; }
.gadmin-actions .abtn { padding: 0.3rem 0.6rem; font-size: 0.78rem; flex: 1; }

.dropzone {
  border: 2px dashed var(--line); border-radius: 12px; padding: 2rem;
  text-align: center; color: var(--ink-dim); cursor: pointer;
  transition: border-color 0.25s, background 0.25s; margin-bottom: 1.2rem;
}
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.dropzone input { display: none; }

.logo-preview { max-height: 70px; margin-top: 0.6rem; background: #241d13; padding: 8px 16px; border-radius: 8px; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 15, 8, 0.55); z-index: 50;
  display: grid; place-items: center; padding: 1rem; animation: fade 0.25s;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--card); border-radius: 14px; padding: 1.8rem;
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  animation: login-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal h3 { font-family: var(--serif); margin-bottom: 1.2rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.2rem; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 1.5rem; inset-inline-start: 50%; transform: translateX(50%);
  background: #241d13; color: #f2ead9; border-radius: 999px; padding: 0.7rem 1.6rem;
  font-size: 0.9rem; z-index: 99; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
[dir="ltr"] .toast { transform: translateX(-50%); }
.toast.err { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateX(50%) translateY(16px); } }

.empty { text-align: center; color: var(--ink-dim); padding: 2.4rem 1rem; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; inset-inline-start: 0; z-index: 40;
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  }
  [dir="ltr"] .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .side-toggle { display: block; }
  .view { padding: 1.1rem; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .tbl { font-size: 0.82rem; }
  .tbl .hide-m { display: none; }
}
