/* ==========================================================================
   FMIPA Admin Dashboard Styles
   ========================================================================== */

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active-bg: rgba(2, 132, 199, 0.15);
  --sidebar-active-text: #38bdf8;
  --header-height: 70px;
}

body.admin-body {
  background-color: #f8fafc;
  color: #0f172a;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h2 {
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
}

.sidebar-menu {
  list-style: none;
  padding: 1.25rem 0.75rem;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.menu-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  padding: 0.75rem 0.75rem 0.25rem;
  letter-spacing: 0.05em;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left: 3px solid #38bdf8;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Main Content Area */
.admin-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.admin-content {
  padding: 2rem;
  flex: 1;
}

/* Metrics Dashboard Cards */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

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

.icon-blue { background: #e0f2fe; color: #0284c7; }
.icon-green { background: #dcfce7; color: #16a34a; }
.icon-purple { background: #f3e8ff; color: #9333ea; }
.icon-amber { background: #fef3c7; color: #d97706; }
.icon-rose { background: #ffe4e6; color: #e11d48; }

.metric-data h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.metric-data p {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 600;
}

/* Data Table Card */
.admin-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  margin-bottom: 2rem;
}

.admin-card-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.table-search-box {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.table-search-input {
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 0.88rem;
  min-width: 240px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.admin-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

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

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

.action-btns {
  display: flex;
  gap: 0.4rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #f1f5f9;
}

.btn-icon.delete:hover {
  background: #fee2e2;
  border-color: #f87171;
  color: #b91c1c;
}

/* Tab contents */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* Auth Login Modal / Overlay */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: #09122c;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* ==================== DRAG & DROP MENU BUILDER STYLES ==================== */
.menu-builder-container {
  padding: 1.5rem;
}

.menu-drag-tree {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 150px;
}

.menu-drag-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
  user-select: none;
}

.menu-drag-item.dragging {
  opacity: 0.45;
  border: 2px dashed #0284c7;
  transform: scale(0.98);
}

.menu-drag-item.drag-over-top {
  border-top: 3px solid #0284c7;
}

.menu-drag-item.drag-over-bottom {
  border-bottom: 3px solid #0284c7;
}

.menu-drag-item.drag-over-inside {
  background: #f0f9ff;
  border: 2px solid #38bdf8;
}

.menu-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  gap: 1rem;
}

.menu-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}

.drag-handle {
  cursor: grab;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 4px;
}

.drag-handle:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.drag-handle:active {
  cursor: grabbing;
}

.menu-level-indent {
  display: inline-flex;
  align-items: center;
  color: #cbd5e1;
  font-weight: 700;
  font-size: 1rem;
}

.menu-item-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.95rem;
}

.menu-item-link {
  font-size: 0.8rem;
  color: #64748b;
  font-family: monospace;
  background: #f8fafc;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.sub-menu-container {
  margin-left: 2rem;
  padding-left: 1rem;
  border-left: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  padding-top: 0.25rem;
}

@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .sub-menu-container {
    margin-left: 1rem;
  }
}

/* ==================== PAGINATION BAR ==================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 0;
}

.pg-info {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.pg-buttons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 0.6rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}

.pg-btn:hover:not(:disabled) {
  background: var(--primary, #0ea5e9);
  border-color: var(--primary, #0ea5e9);
  color: #fff;
}

.pg-btn.active {
  background: var(--primary, #0ea5e9);
  border-color: var(--primary, #0ea5e9);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(14,165,233,0.35);
}

.pg-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pg-ellipsis {
  padding: 0 0.25rem;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 34px;
}

/* ==================== CKEDITOR 5 CUSTOM STYLES ==================== */
.ck-editor__editable_inline {
  min-height: 250px !important;
  max-height: 480px !important;
  font-family: 'Plus Jakarta Sans', sans-serif !important;
  font-size: 0.92rem !important;
  line-height: 1.65 !important;
  color: #0f172a !important;
}

.modal-box .ck.ck-editor {
  width: 100% !important;
  margin-top: 0.25rem;
}

.modal-box .ck-toolbar {
  border-radius: 8px 8px 0 0 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

.modal-box .ck-content {
  border-radius: 0 0 8px 8px !important;
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

.modal-box .ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Increase modal width for rich text editor editing */
.modal-box {
  max-width: 800px !important;
  width: 95% !important;
}


