/* BlmSoft Admin Panel CSS */
:root {
    --blue: #0ea5e9;
    --blue-dark: #0284c7;
    --green: #10b981;
    --black: #0f172a;
    --dark: #1e293b;
    --dark2: #334155;
    --gray: #64748b;
    --light: #f1f5f9;
    --white: #ffffff;
    --sidebar-w: 260px;
    --gradient: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    --radius: 10px;
    --shadow: 0 4px 20px rgba(0,0,0,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', sans-serif; background: #0a0f1e; color: var(--white); min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }

/* ===== SIDEBAR ===== */
.admin-sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--black);
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px; height: 38px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.logo-text { font-size: 1.2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.logo-sub { font-size: 0.62rem; color: var(--gray); text-transform: uppercase; letter-spacing: 0.08em; display: block; margin-top: 1px; }

.sidebar-admin-info {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
}

.admin-info-text { flex: 1; min-width: 0; }
.admin-info-text strong { font-size: 0.82rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-info-text span { font-size: 0.7rem; color: var(--green); display: flex; align-items: center; gap: 4px; }
.online-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.4} }

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray); padding: 8px 20px 4px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.25s;
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }

.nav-item.active {
    color: white;
    background: rgba(14,165,233,0.12);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--gradient);
    border-radius: 0 3px 3px 0;
}

.nav-item .icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: rgba(255,255,255,0.05);
    flex-shrink: 0;
    transition: all 0.25s;
}

.nav-item.active .icon { background: rgba(14,165,233,0.2); color: var(--blue); }
.nav-item:hover .icon { background: rgba(255,255,255,0.1); }

.nav-badge {
    margin-left: auto;
    background: var(--blue);
    color: white;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    min-width: 20px;
    text-align: center;
}
.nav-badge.red { background: #ef4444; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-topbar {
    background: var(--black);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 1.1rem; font-weight: 700; }
.breadcrumb { font-size: 0.78rem; color: var(--gray); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--blue); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.topbar-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}
.topbar-btn:hover { background: rgba(255,255,255,0.08); color: white; }
.topbar-btn.primary { background: var(--gradient); color: white; border: none; }
.topbar-btn.primary:hover { opacity: 0.9; transform: translateY(-1px); }

.admin-content { padding: 28px; flex: 1; }

/* ===== CARDS ===== */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 28px; }

.stat-card {
    background: var(--dark);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    transform: translate(20px,-20px);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-num { font-size: 1.8rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 0.78rem; color: var(--gray); }
.stat-change { font-size: 0.72rem; margin-top: 4px; }

/* ===== DATA TABLE ===== */
.admin-table-wrap { background: var(--dark); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); overflow: hidden; }
.table-header { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.06); gap: 12px; flex-wrap: wrap; }
.table-header h3 { font-size: 0.95rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
thead th { padding: 12px 18px; text-align: left; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray); white-space: nowrap; }
tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.2s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody td { padding: 13px 18px; vertical-align: middle; color: rgba(255,255,255,0.8); }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
}
.badge-published { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-draft { background: rgba(100,116,139,0.1); color: var(--gray); border: 1px solid rgba(100,116,139,0.2); }
.badge-featured { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.2); }
.badge-active { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.badge-inactive { background: rgba(239,68,68,0.1); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

.action-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.btn-edit { color: var(--blue); border-color: rgba(14,165,233,0.3); background: rgba(14,165,233,0.08); }
.btn-edit:hover { background: rgba(14,165,233,0.2); color: var(--blue); }
.btn-delete { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.08); }
.btn-delete:hover { background: rgba(239,68,68,0.2); color: #ef4444; }
.btn-view { color: var(--green); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.btn-view:hover { background: rgba(16,185,129,0.2); color: var(--green); }

/* ===== FORMS ===== */
.admin-form { background: var(--dark); border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 28px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.7); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--black);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    font-size: 0.88rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}
.form-group select option { background: var(--dark); }
.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-group .hint { font-size: 0.72rem; color: var(--gray); margin-top: 5px; }

.toggle-wrap { display: flex; align-items: center; gap: 12px; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--dark2); border-radius: 24px; cursor: pointer; transition: all 0.3s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: var(--gray); border-radius: 50%; transition: all 0.3s; }
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); background: white; }

.image-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; margin-top: 10px; display: none; }

/* ===== ALERTS ===== */
.alert { padding: 12px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #ef4444; }
.alert-info { background: rgba(14,165,233,0.1); border: 1px solid rgba(14,165,233,0.3); color: var(--blue); }

/* ===== SEARCH ===== */
.search-input {
    padding: 9px 14px;
    background: var(--black);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: white;
    font-size: 0.85rem;
    outline: none;
    min-width: 240px;
    transition: border-color 0.3s;
}
.search-input:focus { border-color: var(--blue); }

/* ===== SECTION HEADER ===== */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 1.2rem; }

/* ===== QUILL ===== */
.ql-toolbar { background: var(--dark2); border-color: rgba(255,255,255,0.1) !important; border-radius: 8px 8px 0 0; }
.ql-toolbar .ql-stroke { stroke: var(--gray) !important; }
.ql-toolbar .ql-fill { fill: var(--gray) !important; }
.ql-toolbar button:hover .ql-stroke { stroke: var(--blue) !important; }
.ql-container { background: var(--black); border-color: rgba(255,255,255,0.08) !important; border-radius: 0 0 8px 8px; min-height: 300px; }
.ql-editor { color: rgba(255,255,255,0.85); font-size: 0.92rem; line-height: 1.8; min-height: 300px; }
.ql-editor.ql-blank::before { color: var(--gray) !important; }

/* ===== MOBILE ===== */
.mobile-toggle { display: none; cursor: pointer; padding: 8px; }

@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr; }
    .admin-content { padding: 16px; }
}

/* ===== SIDEBAR OVERLAY ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.show { display: block; }
