/* ================================================
   CEN Personal – Admin Panel
   Responsive, modern, matches main site design
   ================================================ */

/* ---- LOGIN SCREEN ---- */
#login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0A0E27 0%, #152040 55%, #2d4a6e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

#login-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, #0A0E27, #D4961E, #5B7C99);
}

.login-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login-logo img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
}

.login-logo-text {
  color: white;
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  font-family: 'Inter', system-ui, sans-serif;
}

.login-logo-sub {
  color: rgba(255,255,255,0.4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-top: 1px;
}

.login-title {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.02em;
}

.login-subtitle {
  color: rgba(255,255,255,0.45);
  font-size: 0.875rem;
  margin-bottom: 2rem;
  font-family: 'Inter', system-ui, sans-serif;
}

.login-field {
  margin-bottom: 1.125rem;
}

.login-field label {
  display: block;
  color: rgba(255,255,255,0.65);
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.01em;
}

.login-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 0.625rem;
  color: white;
  font-size: 0.9375rem;
  font-family: 'Inter', system-ui, sans-serif;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.login-field input::placeholder {
  color: rgba(255,255,255,0.25);
}

.login-field input:focus {
  border-color: #D4961E;
  background: rgba(255,255,255,0.1);
}

.login-error {
  display: none;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
  font-size: 0.8125rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-family: 'Inter', system-ui, sans-serif;
}

.login-error.visible { display: block; }

.login-btn {
  width: 100%;
  padding: 0.8125rem 1.5rem;
  background: #D4961E;
  color: white;
  border: none;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: 0.01em;
  margin-top: 0.5rem;
}

.login-btn:hover {
  background: #f0ab28;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212,150,30,0.35);
}

.login-btn:active { transform: translateY(0); }

.login-footer {
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 0.75rem;
  margin-top: 1.5rem;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ---- ADMIN PANEL WRAPPER (hidden until login) ---- */
#admin-panel {
  display: none;
  min-height: 100vh;
  background: #F1F3F7;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

#admin-panel.visible { display: flex; }

/* ---- SIDEBAR ---- */
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #0A0E27;
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.375rem;
  flex-shrink: 0;
}

.sidebar-brand-text .brand-name {
  color: white;
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
}

.sidebar-brand-text .brand-sub {
  color: rgba(255,255,255,0.35);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.sidebar-section {
  padding: 1.25rem 0.75rem 0.5rem;
  flex: 1;
}

.sidebar-label {
  padding: 0 0.75rem;
  color: rgba(255,255,255,0.25);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6875rem 0.875rem;
  border-radius: 0.625rem;
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
  margin-bottom: 0.125rem;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}

.sidebar-nav-item.active {
  background: rgba(212,150,30,0.15);
  color: #F0AB28;
  border-left: 3px solid #D4961E;
}

.sidebar-nav-item .nav-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* ---- MAIN CONTENT ---- */
.admin-main {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOP BAR ---- */
.admin-topbar {
  background: white;
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
  gap: 1rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: #374151;
  font-size: 1.25rem;
}

.topbar-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0A0E27;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4375rem 0.875rem;
  border-radius: 0.5rem;
  border: 1.5px solid #E5E7EB;
  background: white;
  color: #374151;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-admin:hover {
  border-color: #0A0E27;
  color: #0A0E27;
  background: #F9FAFB;
}

.btn-admin-primary {
  background: #0A0E27;
  border-color: #0A0E27;
  color: white;
}

.btn-admin-primary:hover {
  background: #D4961E;
  border-color: #D4961E;
  color: white;
}

.btn-admin-danger {
  border-color: #FEE2E2;
  color: #EF4444;
  background: #FFF5F5;
}

.btn-admin-danger:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4375rem 0.875rem;
  background: rgba(239,68,68,0.08);
  border: 1.5px solid rgba(239,68,68,0.2);
  color: #EF4444;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.logout-btn:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
}

/* ---- PAGE CONTENT ---- */
.admin-content {
  padding: 1.75rem;
  flex: 1;
}

/* ---- TAB CONTENT ---- */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- SECTION HEADER ---- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-header h2 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0A0E27;
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---- FORM CARD ---- */
.form-card {
  background: white;
  border-radius: 0.875rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #E5E7EB;
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #F3F4F6;
}

.form-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0A0E27;
  margin: 0;
  letter-spacing: -0.01em;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 0; }

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #374151;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #FAFAFA;
  color: #0A0E27;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #D4961E;
  background: white;
  box-shadow: 0 0 0 3px rgba(212,150,30,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  grid-column: 1 / -1;
}

.form-group select {
  cursor: pointer;
}

.form-footer {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---- LIST CARD ---- */
.list-card {
  background: white;
  border-radius: 0.875rem;
  border: 1px solid #E5E7EB;
  overflow: hidden;
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #FAFAFA;
  border-bottom: 1px solid #F3F4F6;
  gap: 1rem;
  flex-wrap: wrap;
}

.list-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0A0E27;
  margin: 0;
}

.list-search {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  position: relative;
}

.list-search input {
  width: 100%;
  padding: 0.5rem 0.875rem 0.5rem 2.25rem;
  border: 1.5px solid #E5E7EB;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-family: inherit;
  background: white;
  transition: border-color 0.2s;
}

.list-search input:focus {
  outline: none;
  border-color: #D4961E;
}

.list-search::before {
  content: '🔍';
  position: absolute;
  left: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  pointer-events: none;
}

.list-items {
  max-height: 520px;
  overflow-y: auto;
}

.list-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  color: #9CA3AF;
  font-size: 0.875rem;
}

/* ---- JOB ITEM ---- */
.job-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F9FAFB;
  gap: 1rem;
  transition: background 0.15s;
}

.job-item:last-child { border-bottom: none; }
.job-item:hover { background: #FAFAFA; }

.job-item-info { flex: 1; min-width: 0; }

.job-item-title {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0A0E27;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.job-item-meta {
  font-size: 0.8125rem;
  color: #9CA3AF;
  margin: 0;
}

.job-item-actions {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1.5px solid #E5E7EB;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
  color: #6B7280;
  font-family: inherit;
}

.btn-icon:hover {
  border-color: #0A0E27;
  color: #0A0E27;
  background: #F9FAFB;
}

.btn-icon.btn-danger {
  border-color: #FEE2E2;
  color: #EF4444;
}

.btn-icon.btn-danger:hover {
  background: #EF4444;
  border-color: #EF4444;
  color: white;
}

/* ---- CATEGORY ITEM ---- */
.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #F9FAFB;
  gap: 1rem;
  transition: background 0.15s;
}

.category-item:last-child { border-bottom: none; }
.category-item:hover { background: #FAFAFA; }

.category-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.category-dot {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.category-name {
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0A0E27;
  margin: 0 0 0.125rem;
}

.category-id {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin: 0;
}

/* ---- SETTINGS ---- */
.settings-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #F3F4F6;
}

.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0A0E27;
  margin: 0 0 0.5rem;
}

.settings-section p {
  color: #6B7280;
  font-size: 0.875rem;
  margin: 0 0 1rem;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.875rem;
}

.info-label { color: #9CA3AF; font-weight: 600; }
.info-value { color: #374151; }

/* ---- NOTIFICATION ---- */
.notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.625rem;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.3s ease-out;
  font-family: 'Inter', system-ui, sans-serif;
}

.notification-success { background: #10b981; }
.notification-error   { background: #EF4444; }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---- MOBILE OVERLAY ---- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .sidebar-overlay.visible {
    display: block;
  }
}

@media (max-width: 640px) {
  .admin-content {
    padding: 1rem;
  }

  .topbar-actions {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    flex-direction: column;
  }

  .form-footer .btn-admin {
    width: 100%;
    justify-content: center;
  }

  .list-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .list-search {
    max-width: 100%;
    width: 100%;
  }

  .job-item-title {
    white-space: normal;
  }

  .notification {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
}
