:root {
  --red: #c8102e; --sidebar-bg: #0f172a; --sidebar-w: 220px;
  --font-sans: 'Pretendard',-apple-system,BlinkMacSystemFont,'Apple SD Gothic Neo',sans-serif;
  --radius: 6px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body { font-family: var(--font-sans); background: #f1f5f9; color: #1e293b; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.logo-red { color: var(--red); font-weight: 900; }
.logo-black { color: #fff; font-weight: 400; margin-left: .2rem; }

/* LOGIN */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar-bg); }
.login-card { background: #fff; width: 360px; border-radius: 12px; padding: 2.5rem 2rem; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo { font-size: 1.4rem; margin-bottom: .75rem; }
.login-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1.25rem; color: #1e293b; }
.login-form { display: flex; flex-direction: column; gap: .75rem; }
.field-input { border: 1.5px solid #cbd5e1; padding: .6rem .8rem; font-size: .9rem; font-family: inherit; border-radius: var(--radius); width: 100%; transition: border-color .15s; }
.field-input:focus { outline: none; border-color: var(--red); }
.login-error { background: #fff0f0; color: var(--red); padding: .5rem .75rem; border-radius: var(--radius); font-size: .8rem; }

/* LAYOUT */
#screen-admin { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.sidebar__logo { padding: 1.25rem 1rem .75rem; font-size: 1.1rem; font-weight: 900; border-bottom: 1px solid #1e293b; color: #fff; }
.sidebar-nav { flex: 1; padding: .5rem 0; }
.sidebar-nav__item { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .65rem 1rem; color: #94a3b8; font-size: .83rem; font-weight: 500; transition: all .15s; border-left: 2px solid transparent; }
.sidebar-nav__item:hover { color: #fff; background: #1e293b; }
.sidebar-nav__item.is-active { color: #fff; background: #1e293b; border-left-color: var(--red); }
.sidebar-nav__icon { font-size: 1rem; }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: .65rem; padding: .1rem .4rem; border-radius: 10px; min-width: 18px; text-align: center; }
.sidebar__footer { padding: 1rem; border-top: 1px solid #1e293b; }
.sidebar__user { display: block; font-size: .75rem; color: #64748b; margin-bottom: .4rem; }
.sidebar__logout { color: #64748b; font-size: .78rem; text-decoration: underline; }
.sidebar__logout:hover { color: #fff; }

.admin-main { flex: 1; overflow-y: auto; padding: 1.5rem 1.75rem; }
.admin-tab { max-width: 1000px; }
.admin-tab__header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.admin-tab__header h2 { font-size: 1.1rem; font-weight: 800; flex: 1; }
.tab-filters { display: flex; gap: .5rem; flex-wrap: wrap; }
.tab-actions { display: flex; gap: .5rem; }
.filter-select { border: 1px solid #cbd5e1; padding: .35rem .6rem; font-size: .8rem; border-radius: 4px; font-family: inherit; }

/* BTNS */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .5rem 1.2rem; font-family: inherit; font-size: .85rem; font-weight: 700; border-radius: var(--radius); cursor: pointer; border: 2px solid transparent; transition: all .15s; }
.btn--primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn--primary:hover { opacity: .88; }
.btn--outline { border-color: #cbd5e1; color: #1e293b; }
.btn--outline:hover { border-color: #1e293b; }
.btn--ghost { color: #475569; border-color: #e2e8f0; }
.btn--ghost:hover { background: #f1f5f9; }
.btn--approve { background: #16a34a; color: #fff; border-color: #16a34a; }
.btn--approve:hover { opacity: .88; }
.btn--reject { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn--reject:hover { opacity: .88; }
.btn--sm { padding: .35rem .75rem; font-size: .78rem; }
.btn--full { width: 100%; }

/* ARTICLES */
.admin-articles { display: flex; flex-direction: column; gap: .6rem; }
.admin-article { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: .9rem 1.1rem; display: flex; gap: 1rem; align-items: flex-start; }
.admin-article__thumb { width: 90px; height: 60px; border-radius: 4px; overflow: hidden; flex-shrink: 0; background: #f1f5f9; }
.admin-article__thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-article__body { flex: 1; min-width: 0; }
.admin-article__title { font-size: .9rem; font-weight: 700; margin-bottom: .3rem; line-height: 1.4; }
.admin-article__meta { display: flex; gap: .5rem; font-size: .72rem; color: #64748b; flex-wrap: wrap; align-items: center; }
.admin-article__actions { display: flex; gap: .4rem; flex-shrink: 0; align-items: flex-start; }
.status-badge { display: inline-flex; padding: .12rem .45rem; border-radius: 8px; font-size: .67rem; font-weight: 700; }
.status-badge--pending { background: #fef3c7; color: #d97706; }
.status-badge--approved { background: #dcfce7; color: #16a34a; }
.status-badge--rejected { background: #fee2e2; color: #dc2626; }

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: 1.25rem; }
.stat-card__value { font-size: 2rem; font-weight: 800; color: var(--red); }
.stat-card__label { font-size: .8rem; color: #64748b; margin-top: .25rem; }

/* USERS */
.users-list { display: flex; flex-direction: column; gap: .5rem; }
.user-row { background: #fff; border: 1px solid #e2e8f0; border-radius: var(--radius); padding: .75rem 1rem; display: flex; align-items: center; gap: 1rem; }
.user-row__info { flex: 1; }
.user-row__name { font-size: .9rem; font-weight: 700; }
.user-row__meta { font-size: .75rem; color: #64748b; }
.user-tag { background: #f1f5f9; color: #475569; font-size: .68rem; padding: .1rem .4rem; border-radius: 3px; font-weight: 600; }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.modal__panel { position: relative; background: #fff; border-radius: 10px; max-width: 720px; width: 100%; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal__header { padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: space-between; }
.modal__header h3 { font-size: 1rem; font-weight: 700; }
.modal__close { color: #64748b; font-size: 1.1rem; padding: .25rem; }
.modal__body { flex: 1; overflow-y: auto; padding: 1.25rem; font-size: .88rem; line-height: 1.75; }
.modal__body img { max-width: 100%; height: auto; object-fit: unset; margin: .5rem 0; }
.modal__footer { padding: .75rem 1.25rem; border-top: 1px solid #e2e8f0; display: flex; justify-content: flex-end; gap: .5rem; }

/* TOAST */
.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(80px); background: #0f172a; color: #fff; padding: .55rem 1.4rem; font-size: .82rem; border-radius: 6px; transition: transform .3s, opacity .3s; opacity: 0; z-index: 9000; }
.toast--show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast--error { background: var(--red); }
.toast--success { background: #16a34a; }
.empty-state { text-align: center; padding: 2.5rem 1rem; color: #94a3b8; font-size: .88rem; }
.load-more-wrap { text-align: center; padding: 1.25rem 0; }

@media (max-width: 768px) {
  #screen-admin { flex-direction: column; height: auto; }
  .sidebar { width: 100%; flex-direction: row; overflow-x: auto; }
  .sidebar-nav { display: flex; flex-direction: row; padding: 0; }
  .sidebar-nav__item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-nav__item.is-active { border-bottom-color: var(--red); }
  .admin-main { padding: 1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
