/* ============================================================
   Zada Karya — Admin Panel Stylesheet
   ============================================================ */

@import url('style.css');

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #1a0808;
  --sidebar-active: rgba(200,150,62,.18);
  --sidebar-text: rgba(255,255,255,.7);
  --sidebar-text-active: #fff;
  --top-h: 60px;
}

/* --- Layout --- */
body.admin-body {
  background: var(--bg-soft);
  font-size: 14px;
}

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

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.sidebar-logo .logo-text span { color: var(--accent); }
.sidebar-logo .admin-badge {
  font-size: .7rem;
  background: rgba(200,150,62,.2);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 100px;
  margin-top: 2px;
}

.sidebar-nav { padding: 16px 12px; flex: 1; }
.sidebar-section-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
  padding: 0 8px;
  margin: 16px 0 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 2px;
}
.sidebar-link:hover,
.sidebar-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
}
.sidebar-link.active {
  color: var(--accent);
}
.sidebar-link .icon { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-link .badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  padding: 2px 7px;
  border-radius: 100px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  color: var(--sidebar-text);
}
.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: .9rem;
  flex-shrink: 0;
}
.user-info .name  { color: #fff; font-weight: 600; font-size: .9rem; }
.user-info .role  { font-size: .75rem; color: rgba(255,255,255,.45); }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Topbar --- */
.topbar {
  height: var(--top-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-weight: 600; color: var(--text); font-size: 1rem; }
.topbar-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); }
.topbar-breadcrumb a { color: var(--primary); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-btn-logout {
  padding: 7px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: .875rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.topbar-btn-logout:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
.hamburger-toggle {
  display: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
}
.hamburger-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* --- Page Content --- */
.page-content { padding: 28px 24px; flex: 1; }
.page-header-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-bar h1 {
  font-size: 1.5rem;
  color: var(--primary);
  font-family: var(--font-serif);
}
.page-header-bar p { color: var(--text-muted); font-size: .875rem; margin-top: 4px; }

/* --- Stat Cards --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.amber  { background: #fffbeb; }
.stat-icon.green  { background: #ecfdf5; }
.stat-icon.purple { background: #f5f3ff; }
.stat-icon.red    { background: #fef2f2; }
.stat-num  { font-size: 1.75rem; font-weight: 700; color: var(--text); font-family: var(--font-serif); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* --- Tables --- */
.table-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.table-header h2 {
  font-size: 1rem;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text);
}
.table-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  width: 220px;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,26,26,.1);
}
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .875rem;
  background: var(--bg);
  cursor: pointer;
  font-family: var(--font-sans);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg-soft); }

.table-actions { display: flex; gap: 8px; align-items: center; }
.action-btn {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: .8rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  font-weight: 500;
}
.action-btn:hover { background: var(--bg-soft); }
.action-btn.edit:hover  { border-color: var(--primary); color: var(--primary); }
.action-btn.delete:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.action-btn.view:hover  { border-color: var(--accent); color: var(--accent); }

/* --- Status Badges --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-baru     { background: #eff6ff; color: #1d4ed8; }
.badge-diproses { background: #fffbeb; color: #b45309; }
.badge-selesai  { background: #ecfdf5; color: #065f46; }
.badge-draft    { background: #f3f4f6; color: #6b7280; }
.badge-publish  { background: #ecfdf5; color: #065f46; }
.badge-pesanan  { background: #eff6ff; color: #1d4ed8; }
.badge-active   { background: #fef3c7; color: #92400e; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.96);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; color: var(--primary); }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-soft);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--border); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--bg-dark);
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInToast .25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
}
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* --- Confirm Dialog --- */
.confirm-dialog { max-width: 400px; }
.confirm-dialog .modal-body { text-align: center; padding: 32px 24px; }
.confirm-dialog .icon { font-size: 2.5rem; margin-bottom: 12px; }
.confirm-dialog h3 { color: var(--text); margin-bottom: 8px; }
.confirm-dialog p  { color: var(--text-muted); font-size: .9rem; }

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 20px;
}
.login-card {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo h1 {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 4px;
}
.login-logo h1 span { color: var(--accent); }
.login-logo p { color: var(--text-muted); font-size: .9rem; }

/* --- Textarea for artikel isi --- */
.isi-editor {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: .9rem;
  min-height: 320px;
  resize: vertical;
  transition: var(--transition);
  color: var(--text);
}
.isi-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,26,26,.1);
}

/* --- Responsive Admin --- */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content { margin-left: 0; }
  .hamburger-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-content { padding: 20px 16px; }
  .data-table { display: block; overflow-x: auto; }
  .modal { margin: 0; border-radius: var(--radius); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 32px 24px; }
}
