/* ================================================================
   JOFRANNET — Admin Panel Stylesheet
   ================================================================ */
:root {
  --sb-w:     240px;
  --sb-bg:    #0f172a;
  --gold:     #c8960c;
  --gold-lt:  rgba(200,150,12,.12);
  --accent:   #c8960c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────────── */
.admin-wrap { display: flex; min-height: 100vh; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sb-w); background: var(--sb-bg);
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 200; display: flex; flex-direction: column;
  flex-shrink: 0;
}
.sb-head {
  padding: 1.2rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.07);
}
.sb-logo { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.sb-logo img  { width: 34px; height: 34px; border-radius: 6px; }
.sb-logo span { color: #fff; font-weight: 700; font-size: 1rem; }
.sb-logo small { display: block; color: rgba(255,255,255,.35); font-size: .68rem; margin-top: 1px; }

.sb-label {
  padding: 1.1rem 1.25rem .4rem;
  color: rgba(255,255,255,.32); font-size: .68rem;
  text-transform: uppercase; letter-spacing: 1px;
}
.sb-nav { list-style: none; padding: .25rem 0; flex: 1; }
.sb-nav li a {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem 1.25rem;
  color: rgba(255,255,255,.6); font-size: .88rem;
  text-decoration: none; transition: all .18s;
}
.sb-nav li a:hover, .sb-nav li a.on {
  color: #fff; background: rgba(200,150,12,.15);
}
.sb-nav li a.on { color: var(--gold); border-right: 3px solid var(--gold); }
.sb-nav .ico { font-style: normal; width: 18px; text-align: center; font-size: .95rem; }
.sb-foot {
  padding: .9rem 1.25rem; border-top: 1px solid rgba(255,255,255,.07);
}
.sb-foot a {
  display: flex; align-items: center; gap: .6rem;
  color: rgba(255,255,255,.4); font-size: .82rem; text-decoration: none;
  transition: color .18s;
}
.sb-foot a:hover { color: rgba(255,255,255,.8); }

/* ── Main area ────────────────────────────────────────────────── */
.main-area {
  margin-left: var(--sb-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  background: #fff; padding: .9rem 1.75rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.05rem; font-weight: 600; color: #1e293b; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-view {
  font-size: .78rem; color: #64748b; text-decoration: none;
  border: 1px solid #e2e8f0; padding: .33rem .75rem;
  border-radius: 5px; transition: all .15s;
}
.topbar-view:hover { border-color: var(--accent); color: var(--accent); }
.topbar-user { font-size: .82rem; color: #94a3b8; }

.content { padding: 1.75rem; flex: 1; }

/* ── Stats ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 1.1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: #fff; border-radius: 10px; padding: 1.25rem;
  border: 1px solid #e2e8f0; display: flex; align-items: center; gap: .9rem;
}
.stat-ico {
  width: 44px; height: 44px; border-radius: 9px;
  background: var(--gold-lt); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.stat-n { font-size: 1.7rem; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-l { font-size: .75rem; color: #94a3b8; margin-top: 2px; }

/* ── Table ─────────────────────────────────────────────────── */
.panel {
  background: #fff; border-radius: 10px;
  border: 1px solid #e2e8f0; overflow: hidden; margin-bottom: 1.5rem;
}
.panel-head {
  padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-head h2 { font-size: .95rem; font-weight: 600; }

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th {
  background: #f8fafc; padding: .65rem 1rem;
  text-align: left; font-weight: 600; color: #64748b;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid #e2e8f0;
}
td { padding: .8rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.thumb { width: 46px; height: 34px; border-radius: 4px; object-fit: cover; }
.badge {
  display: inline-block; padding: .18rem .6rem;
  border-radius: 50px; font-size: .72rem; font-weight: 600;
}
.badge-pub { background: #dcfce7; color: #166534; }
.badge-draft { background: #f1f5f9; color: #64748b; }
.row-actions { display: flex; gap: .45rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .48rem 1.1rem;
  border-radius: 6px; font-weight: 500; font-size: .82rem;
  cursor: pointer; border: 1px solid transparent;
  text-decoration: none; transition: all .16s; line-height: 1;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn-primary:hover { background: #a87a09; border-color: #a87a09; color: #fff; }
.btn-ghost  { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-ghost:hover { background: #f9fafb; color: #1e293b; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; color: #dc2626; }
.btn-sm { padding: .3rem .7rem; font-size: .78rem; }

/* ── Form ─────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.25rem; align-items: start; }
.form-section { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: .3rem; }
label.lbl { font-size: .82rem; font-weight: 600; color: #374151; }
.hint { font-size: .74rem; color: #94a3b8; }

input[type=text], input[type=url], input[type=password],
select, textarea {
  width: 100%; padding: .55rem .8rem;
  border: 1px solid #d1d5db; border-radius: 6px;
  font-size: .88rem; font-family: inherit; color: #1e293b;
  background: #fff; transition: border .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,150,12,.1);
}
textarea { resize: vertical; min-height: 220px; font-family: 'Courier New', monospace; font-size: .82rem; }
.content-editor { min-height: 340px; }

.form-actions {
  display: flex; gap: .65rem; flex-wrap: wrap;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0; background: #f8fafc;
  border-radius: 0 0 10px 10px;
}

/* ── Image preview ─────────────────────────────────────────── */
.img-preview {
  width: 100%; border-radius: 7px; border: 1px solid #e2e8f0;
  margin-bottom: .5rem; object-fit: cover; max-height: 180px;
}
.img-placeholder {
  width: 100%; height: 130px;
  background: #f8fafc; border: 2px dashed #cbd5e1;
  border-radius: 7px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: #94a3b8; font-size: .82rem; margin-bottom: .5rem;
  gap: .3rem;
  transition: all 0.2s ease;
}

.dragover {
  background-color: var(--gold-lt) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  border-radius: 8px;
}
.dragover .img-placeholder {
  border-color: var(--accent);
  background: transparent;
}

/* ── Gallery ─────────────────────────────────────────────────── */
.gal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: .8rem;
}
.gal-item { border-radius: 8px; overflow: hidden; position: relative; border: 1px solid #e2e8f0; }
.gal-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.gal-item-over {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); opacity: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .18s;
}
.gal-item:hover .gal-item-over { opacity: 1; }

/* ── Login ──────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; background: #f1f5f9;
}
.login-card {
  background: #fff; border-radius: 14px; padding: 2.5rem;
  width: 100%; max-width: 400px; box-shadow: 0 4px 28px rgba(0,0,0,.09);
}
.login-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.75rem; gap: .5rem; }
.login-logo img { width: 58px; height: 58px; border-radius: 10px; }
.login-logo h1 { font-size: 1.3rem; }
.login-logo p  { color: #64748b; font-size: .88rem; }
.login-err {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #dc2626; padding: .65rem .9rem;
  border-radius: 6px; font-size: .84rem; margin-bottom: 1rem;
}
.login-btn { width: 100%; padding: .7rem; font-size: .95rem; margin-top: .4rem; justify-content: center; }

/* ── Upload area ─────────────────────────────────────────────── */
.upload-drop {
  border: 2px dashed #cbd5e1; border-radius: 8px;
  padding: 2rem 1.5rem; text-align: center;
  color: #64748b; font-size: .88rem; cursor: pointer;
  transition: border .18s;
}
.upload-drop:hover { border-color: var(--accent); }
.upload-drop input { display: none; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-area  { margin-left: 0; }
  .form-grid  { grid-template-columns: 1fr; }
}
