/**
 * Admin & Penulis Dashboard Stylesheet
 * Portal Berita Poso Raya
 */

:root {
  --admin-primary: #8b0000;
  --admin-dark: #650000;
  --admin-navy: #0f172a;
  --admin-sidebar-bg: #1e293b;
  --admin-body-bg: #f1f5f9;
  --admin-card-bg: #ffffff;
  --admin-border: #e2e8f0;
  --admin-text: #1e293b;
  --admin-muted: #64748b;
  --font-family: Arial, Helvetica, sans-serif;
  --font-size-base: 12pt;
}

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--admin-body-bg);
  color: var(--admin-text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Sidebar */
.admin-sidebar {
  width: 250px;
  background-color: var(--admin-sidebar-bg);
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.admin-sidebar-brand {
  padding: 20px 18px;
  background: linear-gradient(135deg, var(--admin-dark), var(--admin-primary));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-brand h2 {
  font-size: 13pt;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.5px;
}

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

.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--admin-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12pt;
}

.admin-user-info {
  line-height: 1.2;
}

.admin-user-name {
  font-size: 9.5pt;
  font-weight: 700;
  color: #ffffff;
}

.admin-user-role {
  font-size: 7.5pt;
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 600;
  color: #ffd700;
}

.admin-menu {
  list-style: none;
  padding: 12px 0;
  flex-grow: 1;
}

.admin-menu-header {
  padding: 10px 18px 4px;
  font-size: 7.5pt;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.8px;
  font-weight: bold;
}

.admin-menu-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  font-size: 9.5pt;
  color: #cbd5e1;
  font-weight: 600;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.admin-menu-item a:hover,
.admin-menu-item.active a {
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border-left-color: var(--admin-primary);
}

.admin-menu-item svg {
  width: 18px;
  height: 18px;
}

/* Main Content Area */
.admin-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

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

.admin-topbar-title {
  font-size: 13pt;
  font-weight: 800;
  color: var(--admin-navy);
}

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

.btn-view-site {
  background-color: #f1f5f9;
  color: var(--admin-navy);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 9pt;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--admin-border);
}

.btn-view-site:hover {
  background-color: #e2e8f0;
}

.admin-body {
  padding: 24px;
  flex-grow: 1;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.stat-info h3 {
  font-size: 8.5pt;
  color: var(--admin-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-info .stat-number {
  font-size: 20pt;
  font-weight: 900;
  color: var(--admin-navy);
  margin-top: 4px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background-color: #fee2e2;
  color: var(--admin-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Cards & Tables */
.admin-card {
  background-color: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--admin-border);
}

.admin-card-title {
  font-size: 12pt;
  font-weight: 800;
  color: var(--admin-navy);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9.5pt;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.admin-table th {
  background-color: #f8fafc;
  color: var(--admin-navy);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 8pt;
  letter-spacing: 0.5px;
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-primary { background: #e0e7ff; color: #3730a3; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 9pt;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--admin-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--admin-dark);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: var(--admin-navy);
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 8pt;
}

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

.form-label {
  display: block;
  font-size: 9.5pt;
  font-weight: 700;
  color: var(--admin-navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 10pt;
  outline: none;
  background-color: #ffffff;
}

.form-control:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.form-help {
  font-size: 8pt;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 9.5pt;
  margin-bottom: 20px;
}

.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.alert-danger  { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }

/* Responsive */
@media (max-width: 768px) {
  .admin-wrapper {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
  }
}

/* WYSIWYG Editor & Formatting Toolbar (Arial 12pt) */
.editor-wrapper {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  margin-top: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.editor-toolbar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.editor-btn-group {
  display: inline-flex;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  background: #ffffff;
}

.editor-btn {
  background: transparent;
  border: none;
  border-right: 1px solid #e2e8f0;
  padding: 6px 10px;
  font-size: 9.5pt;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  transition: all 0.15s ease;
  user-select: none;
}

.editor-btn:last-child {
  border-right: none;
}

.editor-btn:hover {
  background: #e2e8f0;
  color: var(--admin-primary);
}

.editor-btn.active {
  background: #fee2e2;
  color: var(--admin-primary);
}

.editor-select {
  height: 32px;
  padding: 4px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 9pt;
  font-family: var(--font-family);
  background: #ffffff;
  color: #334155;
  outline: none;
}

.editor-content-area {
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 12pt !important;
  line-height: 1.8 !important;
  min-height: 380px;
  max-height: 700px;
  overflow-y: auto;
  padding: 18px 20px;
  color: #1e293b;
  outline: none;
  background: #ffffff;
}

.editor-content-area:focus {
  box-shadow: inset 0 0 0 2px rgba(139, 0, 0, 0.08);
}

.editor-content-area p {
  margin-bottom: 1.2em;
}

.editor-content-area h2,
.editor-content-area h3,
.editor-content-area h4 {
  color: var(--admin-navy);
  margin: 1.2em 0 0.5em;
  font-weight: bold;
}

.editor-content-area blockquote {
  border-left: 4px solid var(--admin-primary);
  background: #f8fafc;
  padding: 10px 16px;
  margin: 1em 0;
  color: #475569;
  font-style: italic;
}

/* Quick Title Toolbar */
.title-tools-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 8.5pt;
  color: var(--admin-muted);
}

.title-actions {
  display: flex;
  gap: 6px;
}

.title-action-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 8pt;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.title-action-btn:hover {
  background: #e2e8f0;
  color: var(--admin-navy);
}

