/* =====================================================
   Alianzared Admin Panel — Estilos
   ===================================================== */
:root {
  --sidebar-w: 240px;
  --admin-bg:  #F0F4F8;
}

/* ---- LOGIN ---- */
.login-page { background: linear-gradient(135deg, #0a2240 0%, #1565C0 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; }
.login-wrap  { width: 100%; max-width: 420px; }
.login-box   { background: #fff; border-radius: 16px; padding: 2.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo  { text-align: center; margin-bottom: 2rem; }
.login-logo  { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.login-logo svg { display: block; margin: 0 auto; }
.login-logo span { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.login-logo small { font-size: .78rem; color: var(--text-muted); }

/* ---- ADMIN LAYOUT ---- */
.admin-page { display: flex; min-height: 100vh; background: var(--admin-bg); }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: var(--blue-dark); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; transition: transform .25s ease; overflow-y: auto; }
.sidebar__logo { display: flex; align-items: center; gap: .75rem; padding: 1.5rem 1.25rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar__name { display: block; color: #fff; font-size: 1rem; font-weight: 800; line-height: 1.2; }
.sidebar__role { display: block; color: rgba(255,255,255,.5); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }
.sidebar__nav  { padding: 1rem .75rem; display: flex; flex-direction: column; gap: .15rem; }
.sidebar__link { display: flex; align-items: center; gap: .65rem; padding: .6rem .85rem; border-radius: 8px; color: rgba(255,255,255,.65); font-size: .875rem; font-weight: 500; transition: all .2s; text-decoration: none; }
.sidebar__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar__link.active { color: #fff; background: rgba(66,165,245,.2); }
.sidebar__link svg { flex-shrink: 0; }
.sidebar__divider { height: 1px; background: rgba(255,255,255,.08); margin: .6rem 0; }
.badge { background: #ef4444; color: #fff; font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 100px; margin-left: auto; }

/* MAIN */
.admin-main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.admin-header { background: #fff; border-bottom: 1px solid var(--border); padding: 0 1.5rem; height: 60px; display: flex; align-items: center; gap: 1rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.admin-header__title { font-size: 1.05rem; font-weight: 700; flex: 1; }
.admin-header__user  { display: flex; align-items: center; gap: .5rem; font-size: .875rem; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-light)); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .75rem; font-weight: 700; }
.admin-content { padding: 2rem 1.5rem; max-width: 1200px; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: .25rem; }

/* STATS */
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.dash-stat  { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.dash-stat__label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.dash-stat__value { font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; }
.dash-stat__sub   { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }

/* TABLE */
.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.admin-table thead th { background: var(--admin-bg); padding: .75rem 1rem; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table tbody td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: #fafbfc; }
.status-badge { display: inline-block; padding: .2rem .65rem; border-radius: 100px; font-size: .72rem; font-weight: 700; }
.status-badge.published { background: #dcfce7; color: #166534; }
.status-badge.draft      { background: #fef9c3; color: #854d0e; }
.tbl-actions { display: flex; gap: .5rem; justify-content: flex-end; }
.tbl-btn { padding: .3rem .65rem; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; font-size: .78rem; font-weight: 600; color: var(--text); transition: all .2s; text-decoration: none; }
.tbl-btn:hover { border-color: var(--blue); color: var(--blue); }
.tbl-btn.danger:hover { border-color: #dc2626; color: #dc2626; }

/* SEARCH */
.admin-search { position: relative; }
.admin-search input { padding: .45rem .85rem .45rem 2.1rem; border: 1.5px solid var(--border); border-radius: 8px; font-size: .875rem; width: 220px; }
.admin-search input:focus { outline: none; border-color: var(--blue); }
.admin-search svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 1.75rem; max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin-bottom: .5rem; }
.modal p  { color: var(--text-muted); font-size: .9rem; }

/* EDITOR LAYOUT */
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.editor-main   { display: flex; flex-direction: column; gap: .25rem; }
.editor-sidebar { display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 76px; }
.editor-panel  { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.editor-panel h4 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.featured-img-preview { height: 140px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: .875rem; overflow: hidden; background: var(--admin-bg); }
.featured-img-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Quill customization */
.ql-toolbar.ql-snow { border: 1.5px solid var(--border); border-radius: 8px 8px 0 0; background: var(--admin-bg); }
.ql-container.ql-snow { border: 1.5px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; font-size: 1rem; font-family: 'Segoe UI', system-ui, sans-serif; }
.ql-editor { min-height: 380px; padding: 1rem; line-height: 1.7; }
.ql-editor h2 { font-size: 1.5rem; }
.ql-editor h3 { font-size: 1.25rem; }

/* RESPONSIVE ADMIN */
@media (max-width: 1024px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { position: static; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .admin-search input { width: 160px; }
}
@media (max-width: 480px) {
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .admin-content { padding: 1.25rem 1rem; }
}
