.admin-body { background: #eef3f5; color: var(--text); }
.admin-shell { width: min(1240px, calc(100% - 32px)); margin-inline: auto; }
.admin-header { background: var(--ink); color: #fff; }
.admin-header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.admin-brand span { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--ink); font-weight: 900; }
.admin-header nav { display: flex; gap: 10px; }
.admin-header nav a { color: #deebf0; text-decoration: none; font-size: .9rem; font-weight: 700; padding: 8px 10px; border-radius: 8px; }
.admin-header nav a:hover { background: rgba(255,255,255,.1); }
.admin-main { padding: 44px 0 80px; }
.admin-title-row { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.admin-title-row h1 { color: var(--ink); font-size: clamp(2rem,4vw,3rem); margin: 3px 0; line-height: 1.1; }
.admin-title-row p { margin: 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 22px; }
.stat-card, .admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 28px rgba(11,36,56,.06); }
.stat-card { padding: 22px; }
.stat-card strong { display: block; color: var(--ink); font-size: 2rem; line-height: 1; }
.stat-card span { color: var(--muted); font-size: .88rem; }
.admin-panel { padding: 24px; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 800px; }
.admin-table th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 12px 13px; }
.admin-table td { padding: 15px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table-article { display: flex; align-items: center; gap: 12px; }
.table-article img, .mini-placeholder { width: 54px; height: 42px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.mini-placeholder { display: grid; place-items: center; background: var(--ink); color: var(--accent); font-weight: 900; }
.table-article strong, .table-article small { display: block; }
.table-article strong { color: var(--ink); }
.table-article small { color: var(--muted); margin-top: 2px; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 9px; font-size: .75rem; font-weight: 900; }
.status-published { background: #e4f5ea; color: #176339; }
.status-scheduled { background: #e8f2fb; color: #1b5d8a; }
.status-draft { background: #f0f1f2; color: #5e6870; }
.actions { white-space: nowrap; }
.actions a { display: inline-grid; place-items: center; width: 36px; height: 36px; text-decoration: none; border-radius: 9px; background: var(--soft); margin-right: 4px; }
.actions a:hover { background: var(--sky); }
.actions .danger-link:hover { background: #ffeded; }
.auth-wrap { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 45px 0; }
.auth-card { width: min(520px,100%); background: #fff; padding: 38px; border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.auth-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 18px; background: var(--sky); font-size: 1.7rem; margin-bottom: 18px; }
.auth-card h1 { color: var(--ink); margin: 4px 0 7px; }
.auth-card > p { color: var(--muted); }
.stack-form { display: grid; gap: 17px; margin-top: 25px; }
label { display: grid; gap: 7px; font-size: .88rem; font-weight: 800; color: var(--ink); }
input, textarea, select { width: 100%; border: 1px solid #cbd8de; border-radius: 11px; padding: 12px 13px; color: var(--text); background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,117,154,.11); }
.form-error { background: #fff0f0; border: 1px solid #efc0c0; color: #8f2929; padding: 13px 15px; border-radius: 12px; margin: 16px 0; }
.form-error ul { margin-bottom: 0; }
.empty-admin { text-align: center; padding: 45px 20px; }
.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 22px; align-items: start; }
.editor-main { padding: 28px; }
.editor-sidebar { display: grid; gap: 18px; position: sticky; top: 18px; }
.side-panel { padding: 20px; }
.side-panel h2 { margin: 0 0 16px; color: var(--ink); font-size: 1.05rem; }
.side-panel label + label { margin-top: 14px; }
.title-input { font-size: 1.45rem; font-weight: 800; padding: 15px; }
.field-label { margin: 0 0 8px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 22px 0; }
.editor-toolbar { display: flex; gap: 5px; flex-wrap: wrap; padding: 9px; border: 1px solid #cbd8de; border-bottom: 0; border-radius: 12px 12px 0 0; background: #f5f8f9; }
.editor-toolbar button { border: 1px solid #d6e0e4; background: #fff; border-radius: 7px; padding: 7px 9px; cursor: pointer; font-size: .82rem; }
.editor-toolbar button:hover { background: var(--sky); }
.rich-editor { min-height: 460px; padding: 20px; border: 1px solid #cbd8de; border-radius: 0 0 12px 12px; background: #fff; outline: none; font-family: Georgia, serif; font-size: 1.07rem; line-height: 1.75; }
.rich-editor:empty::before { content: attr(data-placeholder); color: #91a0a8; }
.rich-editor:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,117,154,.11); }
.help-text { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.full { width: 100%; margin-top: 18px; }
.upload-box { border: 1px dashed #9db3bd; border-radius: 12px; padding: 14px; text-align: center; background: var(--soft); cursor: pointer; }
.upload-box input { padding: 7px 0 0; border: 0; box-shadow: none; font-size: .8rem; }
.current-image { width: 100%; max-height: 190px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.check-label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--danger); margin-bottom: 12px; }
.check-label input, .admin-gallery input { width: auto; }
.admin-gallery { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 12px; }
.admin-gallery label { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.admin-gallery img { width: 100%; height: 80px; object-fit: cover; }
.admin-gallery span { display: flex; align-items: center; gap: 5px; padding: 5px 7px; font-size: .72rem; color: var(--danger); }
.button-danger { background: var(--danger); color: #fff; box-shadow: none; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2,1fr); }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { position: static; grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 680px) {
  .admin-shell { width: min(100% - 20px,1240px); }
  .admin-header-inner { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .admin-header nav { flex-wrap: wrap; }
  .admin-title-row { align-items: stretch; flex-direction: column; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .two-fields, .editor-sidebar { grid-template-columns: 1fr; }
  .admin-panel, .auth-card { padding: 18px; }
  .rich-editor { min-height: 360px; }
}
