/* ========================================================
   ADMIN EDITORIAL BACK-OFFICE STYLESHEET (admin.css)
   Clean, modern, responsive administrative panel
   ======================================================== */

:root {
    --primary: #c51a1a;
    --primary-dark: #991313;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #334155;
    --sidebar-text: #94a3b8;
    --topbar-bg: #ffffff;
    --bg-page: #f1f5f9;
    --border-color: #e2e8f0;
    --text-dark: #0f172a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.admin-body {
    font-family: 'Mukta', 'Noto Sans Devanagari', sans-serif;
    background: var(--bg-page);
    color: var(--text-dark);
    font-size: 15px;
}

.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid #1e293b;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
}

.logo-text {
    font-family: 'Rozha One', serif;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.logo-badge {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: #64748b;
    padding: 12px 10px 4px;
    letter-spacing: 0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.menu-item.active {
    background: var(--primary);
    color: #fff;
}

.menu-item.logout {
    color: #f87171;
}

.menu-item.logout:hover {
    background: #450a0a;
    color: #fca5a5;
}

.sidebar-divider {
    height: 1px;
    background: #1e293b;
    margin: 12px 0;
}

/* Main Content Area */
.admin-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Topbar */
.admin-topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    margin: 4px 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
}

.user-avatar {
    font-size: 18px;
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
}

.user-role {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
}

/* Alerts */
.admin-alerts-container {
    padding: 16px 24px 0;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

.alert-icon { font-weight: 800; font-size: 16px; }

/* Main Body */
.admin-main-body {
    padding: 24px;
    flex: 1;
}

.admin-page-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-row h2 {
    font-size: 24px;
    font-weight: 800;
}

.page-header-row p {
    color: #64748b;
    font-size: 14px;
}

/* Cards & Panels */
.card, .panel-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 14px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.panel-link {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

/* Stats Row */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.bg-blue { background: #e0f2fe; }
.bg-purple { background: #f3e8ff; }
.bg-green { background: #dcfce7; }
.bg-orange { background: #ffedd5; }

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* Workflow Banner */
.workflow-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.workflow-box {
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.workflow-header h3 {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.workflow-header p {
    font-size: 13px;
    color: #64748b;
}

/* Dashboard Tables Grid */
.dashboard-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    text-align: left;
    background: #f8fafc;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.table-thumb {
    width: 60px;
    height: 45px;
    border-radius: 4px;
    object-fit: cover;
}

.no-thumb {
    font-size: 11px;
    color: #94a3b8;
}

.table-title-link {
    font-weight: 700;
    color: var(--text-dark);
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    background: #e2e8f0;
    color: #334155;
    display: inline-block;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #92400e; }

.status-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    display: inline-block;
}

.status-published { background: #dcfce7; color: #166534; }
.status-draft { background: #f1f5f9; color: #64748b; }
.status-archived { background: #fee2e2; color: #991b1b; }

.tag-breaking {
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

.tag-featured {
    background: #d97706;
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 4px;
}

.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.btn-action {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.btn-action:hover {
    background: #e2e8f0;
}

.btn-action.delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 6px;
}

.form-group label.required::after {
    content: " *";
    color: var(--primary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #fff;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(197, 26, 26, 0.1);
}

.form-control-lg {
    font-size: 18px;
    padding: 10px 14px;
    font-weight: 700;
}

.font-hindi {
    font-family: 'Noto Sans Devanagari', 'Mukta', sans-serif;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    cursor: pointer;
}

.img-preview-thumb {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-top: 8px;
}

.reporter-avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 24px;
}

/* Login Card */
.login-page {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 6px;
}

.login-title {
    font-family: 'Rozha One', serif;
    font-size: 26px;
    color: #000;
}

.login-subtitle {
    font-size: 13px;
    color: #64748b;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #64748b;
}

.login-footer code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .workflow-banner { grid-template-columns: 1fr; }
    .dashboard-tables-grid { grid-template-columns: 1fr; }
    .editor-layout { grid-template-columns: 1fr; }
    .epaper-page-tabs { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .admin-sidebar { position: fixed; left: -260px; height: 100vh; z-index: 2000; }
    .admin-sidebar.open { transform: translateX(260px); }
    .sidebar-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr; }
    .epaper-page-tabs { grid-template-columns: repeat(2, 1fr); }
}
