/* =============================================
   ADMIN PANEL STYLES
   ============================================= */

body.admin-page {
    font-family: var(--font);
    background: var(--c-bg);
    color: var(--c-text);
    display: flex;
    min-height: 100vh;
    margin: 0;
    transition: background .3s, color .3s;
}

/* Sidebar */
.a-sidebar {
    width: 260px;
    background: var(--c-surface);
    border-right: 1px solid var(--c-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100; overflow-y: auto;
    transition: transform .3s;
}
.a-sidebar-head {
    padding: 18px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid var(--c-border);
}
.a-sidebar-head .logo-icon {
    width: 38px; height: 38px; border-radius: 8px;
    background: var(--c-gradient); display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1rem;
}
.a-sidebar-head h2 {
    font-size: 1rem; font-weight: 800;
    background: var(--c-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.a-sidebar-head small { font-size: .68rem; color: var(--c-text3); display: block; -webkit-text-fill-color: var(--c-text3); }
.a-nav { padding: 12px 8px; }
.a-nav-label {
    padding: 8px 14px; font-size: .68rem; text-transform: uppercase;
    letter-spacing: .8px; color: var(--c-text3); font-weight: 600;
}
.a-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; border-radius: 8px; font-size: .88rem;
    font-weight: 500; color: var(--c-text2); margin-bottom: 2px;
    transition: background .2s, color .2s;
}
.a-nav a:hover { background: var(--c-accent-bg); color: var(--c-accent); }
.a-nav a.on { background: var(--c-gradient); color: #fff; box-shadow: 0 3px 12px rgba(79,110,247,.3); }
.a-nav a i { width: 18px; text-align: center; }

/* Main */
.a-main { flex: 1; margin-left: 260px; min-height: 100vh; }

/* Header */
.a-header {
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.a-header h1 { font-size: 1.2rem; font-weight: 700; }
.a-header-r { display: flex; align-items: center; gap: 10px; }
.a-user {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 12px; border-radius: 8px; background: var(--c-surface2);
}
.a-user-av {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--c-gradient); display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: .88rem;
}
.a-user span { font-weight: 600; font-size: .84rem; }
.a-user small { font-size: .68rem; color: var(--c-text3); display: block; }

/* Content area */
.a-content { padding: 28px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat {
    background: var(--c-surface); border-radius: 14px; padding: 22px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--c-border2); box-shadow: var(--shadow-s);
    transition: transform .2s, box-shadow .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.stat-ic {
    width: 52px; height: 52px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
}
.stat h3 { font-size: 1.6rem; font-weight: 800; line-height: 1; margin-bottom: 2px; }
.stat p { font-size: .82rem; color: var(--c-text3); }

/* Table */
.a-tbl-wrap {
    background: var(--c-surface); border-radius: 14px; overflow: hidden;
    border: 1px solid var(--c-border2); box-shadow: var(--shadow-s);
}
.a-tbl-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px; border-bottom: 1px solid var(--c-border2);
    flex-wrap: wrap; gap: 12px;
}
.a-tbl-head h2 { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.a-tbl { width: 100%; border-collapse: collapse; }
.a-tbl th {
    text-align: left; padding: 12px 18px; font-size: .76rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .4px; color: var(--c-text3);
    background: var(--c-surface2); border-bottom: 1px solid var(--c-border2);
}
.a-tbl td {
    padding: 12px 18px; border-bottom: 1px solid var(--c-border2);
    font-size: .88rem; vertical-align: middle;
}
.a-tbl tr:hover { background: rgba(79,110,247,.02); }
.a-tbl .thumb {
    width: 56px; height: 42px; border-radius: 6px; object-fit: cover;
}
.a-tbl .thumb-ph {
    width: 56px; height: 42px; border-radius: 6px;
    background: var(--c-surface2); display: flex; align-items: center; justify-content: center;
    color: var(--c-text4); font-size: .9rem;
}
.a-tbl .title-cell { max-width: 280px; }
.a-tbl .title-cell h4 {
    font-size: .88rem; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.st-badge {
    padding: 3px 10px; border-radius: 16px; font-size: .72rem; font-weight: 600;
}
.st-published { background: rgba(34,197,94,.1); color: #22c55e; }
.st-draft     { background: rgba(245,158,11,.1); color: #f59e0b; }
.st-archived  { background: rgba(139,146,165,.1); color: #8b92a5; }
.act-btns { display: flex; gap: 5px; }
.act-btn {
    width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; font-size: .82rem; border: 1px solid var(--c-border);
    color: var(--c-text2); background: var(--c-surface); cursor: pointer;
    transition: border-color .2s, color .2s;
}
.act-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.act-btn.del:hover { border-color: var(--c-red); color: var(--c-red); }

/* Form */
.a-form {
    background: var(--c-surface); border-radius: 14px; padding: 28px;
    border: 1px solid var(--c-border2); box-shadow: var(--shadow-s);
}
.a-form .form-group { margin-bottom: 18px; }
.a-form label {
    display: block; margin-bottom: 6px; font-weight: 600;
    font-size: .88rem; color: var(--c-text);
}
.a-form .form-input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--c-border); border-radius: 8px;
    background: var(--c-bg); color: var(--c-text);
    font-size: .92rem; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.a-form .form-input:focus {
    border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.a-form select.form-input { cursor: pointer; }
.a-form textarea.form-input { min-height: 140px; resize: vertical; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--c-border); margin-bottom: 18px; }
.tab {
    padding: 9px 18px; font-weight: 600; font-size: .88rem;
    color: var(--c-text3); cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -2px; transition: color .2s, border-color .2s;
}
.tab.on { color: var(--c-accent); border-color: var(--c-accent); }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* File upload */
.file-drop {
    border: 2px dashed var(--c-border); border-radius: 10px;
    padding: 28px; text-align: center; cursor: pointer;
    position: relative; transition: border-color .2s;
}
.file-drop:hover { border-color: var(--c-accent); }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop i { font-size: 1.8rem; color: var(--c-text4); margin-bottom: 8px; display: block; }
.file-drop p { color: var(--c-text3); font-size: .88rem; }
.img-preview { margin-top: 12px; max-width: 280px; border-radius: 8px; overflow: hidden; }
.img-preview img { width: 100%; }

.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--c-accent); }

.form-acts {
    display: flex; gap: 10px; padding-top: 18px;
    border-top: 1px solid var(--c-border2); margin-top: 18px;
}

/* Login */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--c-bg);
}
.login-card {
    background: var(--c-surface); border-radius: 18px; padding: 36px;
    width: 100%; max-width: 400px; box-shadow: var(--shadow-l);
    border: 1px solid var(--c-border2);
}
.login-card .logo { justify-content: center; margin-bottom: 24px; font-size: 1.4rem; }
.login-card h1 { text-align: center; margin-bottom: 24px; font-size: 1.15rem; }
.login-card .btn-primary { width: 100%; justify-content: center; }
.login-err {
    background: rgba(239,68,68,.1); color: var(--c-red);
    padding: 10px 14px; border-radius: 8px; margin-bottom: 16px;
    font-size: .88rem; display: flex; align-items: center; gap: 6px;
}

/* Responsive */
@media (max-width: 900px) {
    .a-sidebar { transform: translateX(-100%); }
    .a-sidebar.open { transform: translateX(0); }
    .a-main { margin-left: 0; }
    .a-content { padding: 18px 14px; }
    .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .stats { grid-template-columns: 1fr; }
    .a-tbl { display: block; overflow-x: auto; }
}