/* =========================================================
   Quequén Casa Editora — Panel de administración
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --c-bg:       #F5F5F5;
  --c-white:    #FFFFFF;
  --c-text:     #1A1A1A;
  --c-muted:    #6B6B6B;
  --c-accent:   #2D5A3D;
  --c-accent2:  #B8935A;
  --c-border:   #E0E0E0;
  --c-danger:   #C0392B;
  --c-danger-bg:#fdecea;
  --c-success:  #1e4029;
  --c-success-bg:#e8f4ec;
  --sidebar-w:  240px;
  --radius:     6px;
  --shadow:     0 1px 4px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', system-ui, sans-serif; font-size: .9rem; color: var(--c-text); background: var(--c-bg); min-height: 100vh; display: flex; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
ul { list-style: none; }

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-white);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
  z-index: 50;
}
.sidebar__brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  font-weight: 600;
  color: var(--c-accent);
  font-size: 1rem;
  line-height: 1.3;
}
.sidebar__brand small { display: block; font-weight: 300; font-size: .75rem; color: var(--c-muted); }

.sidebar__nav { padding: 1rem 0; flex: 1; }
.nav-section { padding: .5rem 1.25rem .25rem; font-size: .7rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
.sidebar__nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem 1.25rem;
  color: var(--c-text);
  font-size: .88rem;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar__nav a:hover { background: var(--c-bg); text-decoration: none; }
.sidebar__nav a.active { background: #ebf5ef; color: var(--c-accent); border-left-color: var(--c-accent); font-weight: 500; }

.sidebar__footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--c-border);
  font-size: .82rem;
  color: var(--c-muted);
}
.sidebar__footer a { color: var(--c-muted); }

/* ----- Main ----- */
.panel-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.panel-topbar {
  background: var(--c-white);
  border-bottom: 1px solid var(--c-border);
  padding: .75rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 40;
}
.panel-topbar h1 { font-size: 1.1rem; font-weight: 500; }
.panel-topbar__actions { display: flex; gap: .75rem; align-items: center; }

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

/* ----- Cards & Stats ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.stat-card__value { font-size: 2rem; font-weight: 300; color: var(--c-accent); }
.stat-card__label { font-size: .82rem; color: var(--c-muted); margin-top: .25rem; }

/* ----- Table ----- */
.table-wrap { overflow-x: auto; background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--c-bg); text-align: left; padding: .75rem 1rem; font-size: .78rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); border-bottom: 1px solid var(--c-border); }
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--c-bg); }

.table-thumb { width: 44px; height: 60px; object-fit: cover; border-radius: 2px; background: var(--c-bg); }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px; font-size: .75rem; }
.badge-ok  { background: var(--c-success-bg); color: var(--c-success); }
.badge-off { background: #f0f0f0; color: var(--c-muted); }

/* ----- Forms ----- */
.form-card { background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.75rem; max-width: 780px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group--full { grid-column: 1 / -1; }
label { display: block; font-size: .82rem; font-weight: 500; margin-bottom: .35rem; }
input[type=text], input[type=url], input[type=email], input[type=password],
input[type=number], select, textarea {
  width: 100%; padding: .55rem .8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-family: inherit; font-size: .9rem;
  color: var(--c-text); background: var(--c-white);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-accent); }
textarea { resize: vertical; min-height: 110px; }
.input-hint { font-size: .78rem; color: var(--c-muted); margin-top: .3rem; }

/* Checkbox ----- */
.check-label { display: flex; align-items: center; gap: .5rem; font-size: .88rem; cursor: pointer; }
.check-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--c-accent); }

/* Image preview ----- */
.img-preview { margin-top: .5rem; display: flex; align-items: center; gap: .75rem; }
.img-preview img { max-height: 90px; border-radius: var(--radius); border: 1px solid var(--c-border); }
.img-preview .remove-img { font-size: .8rem; color: var(--c-danger); cursor: pointer; }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; border-radius: var(--radius); font-size: .88rem; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s; font-family: inherit; }
.btn-primary { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.btn-primary:hover { background: #1e3f2b; border-color: #1e3f2b; text-decoration: none; }
.btn-secondary { background: var(--c-white); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); text-decoration: none; }
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-danger:hover { background: #a93226; text-decoration: none; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }

/* ----- Alerts ----- */
.alert { padding: .8rem 1rem; border-radius: var(--radius); font-size: .88rem; margin-bottom: 1.25rem; }
.alert-success { background: var(--c-success-bg); color: var(--c-success); border: 1px solid #b2d8bc; }
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger);  border: 1px solid #f2b4b0; }
.alert-info    { background: #e8f0fd; color: #1a3a6b; border: 1px solid #b0c8f5; }

/* ----- Notice blog ----- */
.notice-blog {
  background: #fef9ec; border: 1px solid #f0d78a;
  border-radius: var(--radius); padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.75rem; font-size: .88rem; color: #6b4f00;
}

/* ----- Confirm delete page ----- */
.confirm-box { max-width: 480px; background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 2rem; text-align: center; margin-inline: auto; margin-top: 2rem; }
.confirm-box h2 { margin-bottom: 1rem; }
.confirm-box p { color: var(--c-muted); margin-bottom: 1.75rem; }
.confirm-box .btn-group { display: flex; gap: 1rem; justify-content: center; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .panel-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .panel-content { padding: 1rem; }
}
