/* ============ Bhauu Blogs - Admin Styles ============ */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f3f4f6;
    --card: #ffffff;
    --border: #e5e7eb;
    --sidebar: #111827;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
code { background: #eef2ff; padding: 2px 6px; border-radius: 4px; font-size: .85em; }

/* ---------- Layout ---------- */
.admin-body { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px;
    background: var(--sidebar);
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
}
.admin-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px;
    font-weight: 800; color: #fff; font-size: 1.05rem;
    border-bottom: 1px solid #1f2937;
}
.brand-mark {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: #fff; border-radius: 9px;
    display: grid; place-items: center;
    font-weight: 800;
    flex-shrink: 0;
}
.admin-nav { display: flex; flex-direction: column; padding: 12px 0; flex: 1; overflow-y: auto; }
.admin-nav a {
    color: #9ca3af;
    padding: 11px 20px;
    display: flex; align-items: center; gap: 8px;
    font-size: .93rem;
    border-left: 3px solid transparent;
}
.admin-nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.admin-nav a.active { color: #fff; background: rgba(79,70,229,.18); border-left-color: var(--primary); }
.pill {
    background: #dc2626; color: #fff;
    font-size: .7rem; font-weight: 700;
    padding: 1px 8px; border-radius: 999px;
    margin-left: auto;
}
.pill-gold { background: #d97706; margin-left: 6px; }
.admin-sidebar-footer { padding: 14px 20px; border-top: 1px solid #1f2937; display: flex; flex-direction: column; gap: 8px; }
.admin-sidebar-footer a { color: #9ca3af; font-size: .9rem; }
.admin-sidebar-footer a:hover { color: #fff; }

.admin-content { flex: 1; margin-left: 240px; display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 1.25rem; flex: 1; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }
.topbar-user { font-size: .9rem; color: var(--text-light); }
.role-tag {
    background: #eef2ff; color: var(--primary-dark);
    font-size: .72rem; font-weight: 700; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px;
}
.admin-main { padding: 28px; }

/* ---------- Panels & stats ---------- */
.panel { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h3 { font-size: 1.05rem; }
.panel-title { font-size: 1.02rem; margin-bottom: 16px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 18px;
    display: flex; align-items: center; gap: 14px;
    box-shadow: var(--shadow);
}
.stat-icon { font-size: 1.7rem; }
.stat-card strong { font-size: 1.45rem; display: block; line-height: 1.2; }
.stat-card span:last-child { color: var(--text-light); font-size: .82rem; }

.dash-columns { display: grid; grid-template-columns: 3fr 2fr; gap: 24px; align-items: start; }
.dash-comments { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.dash-comments li { border-bottom: 1px dashed var(--border); padding-bottom: 12px; font-size: .9rem; }
.dash-comments p { color: var(--text-light); margin-top: 4px; }

.two-col { display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: start; }

/* ---------- Tables ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg);
    color: var(--text-light);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:hover td { background: #fafafa; }
.comment-cell { max-width: 320px; }
.actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.actions a, .actions button { font-size: 1rem; }
.inline-form { display: inline; }
.inline-form button { background: none; border: none; cursor: pointer; padding: 2px; }

.status { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status-published, .status-approved { background: #dcfce7; color: #166534; }
.status-draft, .status-pending { background: #fef3c7; color: #92400e; }
.status-spam { background: #fee2e2; color: #991b1b; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field small { font-weight: 400; color: var(--text-light); }
input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], input[type=search], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }
textarea { resize: vertical; }
input[type=file] { font-size: .88rem; margin-top: 6px; }
.check-field { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: .92rem; cursor: pointer; }
.check-field input { width: auto; }
.hint { color: var(--text-light); font-size: .82rem; display: block; margin-top: 6px; }
.char-count { display: block; margin-top: 4px; font-size: .78rem; }

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 8px;
    font: inherit; font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: #eef2ff; }

.filter-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { width: auto; }

.tab-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-bar a { padding: 7px 14px; border-radius: 8px; color: var(--text-light); font-size: .9rem; font-weight: 500; }
.tab-bar a.active, .tab-bar a:hover { background: #eef2ff; color: var(--primary-dark); }

/* ---------- Post editor ---------- */
.editor-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
#editor { min-height: 320px; background: #fff; border-radius: 0 0 8px 8px; font-size: 1rem; }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; border-color: var(--border); }
.ql-container.ql-snow { border-color: var(--border); border-radius: 0 0 8px 8px; }
.thumb-preview { border-radius: 8px; margin-bottom: 10px; }
.view-link { display: block; text-align: center; margin-top: 10px; font-size: .9rem; }

.serp-preview {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    background: #fafafa;
    margin-top: 8px;
}
.serp-label { font-size: .75rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; display: block; margin-bottom: 6px; }
.serp-title { color: #1a0dab; font-size: 1.1rem; line-height: 1.3; }
.serp-url { color: #006621; font-size: .82rem; margin: 2px 0; }
.serp-desc { color: #545454; font-size: .86rem; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.empty-note { color: var(--text-light); padding: 16px 0; }

/* ---------- Login page ---------- */
.login-body {
    display: grid; place-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 20px;
}
.login-card {
    background: var(--card);
    border-radius: 16px;
    padding: 36px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand .brand-mark { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 14px; margin: 0 auto 12px; }
.login-brand h1 { font-size: 1.4rem; }
.login-brand p { color: var(--text-light); font-size: .9rem; }
.login-card label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }
.login-card input { margin-top: 6px; }
.back-link { display: block; text-align: center; margin-top: 18px; font-size: .88rem; color: var(--text-light); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-columns, .two-col, .editor-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .admin-sidebar { transform: translateX(-100%); transition: transform .25s; }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-content { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .admin-main { padding: 18px; }
    .data-table { display: block; overflow-x: auto; }
}
