/* ==========================================================
   Salsabila Karya Properti – Admin Panel Stylesheet
   Modern Dark & Gold UI
   ========================================================== */

:root {
  --bg-dark: #0f1117;
  --bg-sidebar: #161922;
  --bg-card: #1c202d;
  --bg-input: #12141c;
  --border: #282e3f;
  --border-focus: #B5EB14;
  --gold: #B5EB14;
  --gold-hover: #c4f522;
  --text-main: #f0f3f8;
  --text-muted: #8e96aa;
  --danger: #e63946;
  --danger-hover: #ff4d5a;
  --success: #2ec4b6;
  --sidebar-w: 260px;
  --header-h: 68px;
  --radius: 10px;
  --transition: all .25s ease;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* ================= LOGIN PAGE ================= */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1e2436 0%, #0c0e14 70%);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 20px 40px rgba(0,0,0,.6);
}
.login-header {
  text-align: center;
  margin-bottom: 26px;
}
.login-logo {
  height: 56px;
  margin: 0 auto 14px;
}
.login-header h2 {
  margin: 0;
  font-size: 24px;
  color: var(--gold);
  font-weight: 700;
}
.login-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}
.login-form .form-group {
  margin-bottom: 18px;
}
.login-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  font-size: 13px;
}
.login-hint {
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.login-hint code {
  background: #11141c;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold);
}
.back-link {
  color: var(--text-muted);
  transition: var(--transition);
}
.back-link:hover { color: #fff; }

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

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform .3s ease;
}
.sidebar-brand {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  height: 38px;
  width: auto;
}
.sidebar-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-text span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: .5px;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 10px;
}
.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px 6px;
  letter-spacing: .8px;
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
}
.nav-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
}
.nav-link:hover {
  background: rgba(196, 164, 27, 0.08);
  color: #fff;
}
.nav-link.active {
  background: var(--gold);
  color: #0f1117;
  font-weight: 600;
}
.nav-link.active svg {
  stroke: #0f1117;
}
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: #0f1117;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.user-meta {
  line-height: 1.2;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}
.btn-logout {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-logout:hover {
  color: var(--danger);
  background: rgba(230, 57, 70, 0.1);
}

/* Main Content Area */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.admin-topbar {
  height: var(--header-h);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mobile-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 6px;
}
.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-view-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}
.btn-view-site:hover {
  background: var(--gold);
  color: #0f1117;
}

/* Content */
.admin-content {
  flex: 1;
  padding: 28px;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= CARDS & GRIDS ================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform .2s ease, border-color .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(196, 164, 27, 0.12);
  color: var(--gold);
  display: grid;
  place-items: center;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ================= FORMS ================= */
.form-group {
  margin-bottom: 18px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 6px;
}
.label-help {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(196, 164, 27, 0.2);
}
textarea.form-control {
  resize: vertical;
  min-height: 85px;
}

/* File Upload Drop Area */
.upload-dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.upload-dropzone:hover {
  border-color: var(--gold);
  background: rgba(196, 164, 27, 0.04);
}
.upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--gold);
}
.dropzone-text {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}
.dropzone-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.image-preview {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  max-width: 180px;
  max-height: 120px;
  border: 1px solid var(--border);
  display: none;
}
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  transition: var(--transition);
}
.btn-primary {
  background: var(--gold);
  color: #0f1117;
}
.btn-primary:hover {
  background: var(--gold-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #2a3142;
  color: #fff;
}
.btn-secondary:hover {
  background: #353e54;
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-block {
  width: 100%;
}

/* ================= GALLERY & LIST ITEMS ================= */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.gallery-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: var(--transition);
}
.gallery-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.gallery-thumb {
  aspect-ratio: 16 / 10;
  background: #000;
  overflow: hidden;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-actions {
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
}
.gallery-badge {
  font-size: 11px;
  color: var(--text-muted);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}
.table-thumb {
  width: 64px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(196, 164, 27, 0.15);
  color: var(--gold);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: grid;
}
.modal-box {
  width: 100%;
  max-width: 540px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0,0,0,.7);
  overflow: hidden;
  animation: modalScale .2s ease;
}
@keyframes modalScale {
  from { opacity: 0; transform: scale(.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}
.btn-close-modal {
  background: none;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.btn-close-modal:hover { color: #fff; }
.modal-body {
  padding: 22px;
  max-height: 75vh;
  overflow-y: auto;
}
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Alerts and Toast */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-danger {
  background: rgba(230, 57, 70, 0.15);
  border: 1px solid rgba(230, 57, 70, 0.4);
  color: #ff6b76;
}
.alert-success {
  background: rgba(46, 196, 182, 0.15);
  border: 1px solid rgba(46, 196, 182, 0.4);
  color: #48e5d6;
}

#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all .3s cubic-bezier(0.16, 1, 0.3, 1);
}
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#toast.toast-success {
  background: #198754;
  border: 1px solid #20c997;
}
#toast.toast-error {
  background: #dc3545;
  border: 1px solid #f87171;
}

/* ================= SETTINGS TOOLBAR & SUBSECTIONS ================= */
.settings-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 22px;
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 80;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}
.settings-toolbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.settings-search-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.settings-search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.settings-search-input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  outline: none;
  font-size: 13px;
  transition: border-color .2s;
}
.settings-search-input:focus {
  border-color: var(--gold);
}
.settings-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sec-pill {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}
.sec-pill:hover {
  border-color: rgba(181, 235, 20, 0.45);
  color: #fff;
}
.sec-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #0f1117;
  font-weight: 700;
}
.sec-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(181, 235, 20, 0.16);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.settings-subhead {
  margin: 22px 0 14px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.stat-edit-box {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat-edit-box .stat-box-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.stat-edit-box .form-group:last-child {
  margin-bottom: 0;
}
.settings-empty-msg {
  display: none;
  text-align: center;
  padding: 32px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-main {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
  .admin-content {
    padding: 18px;
  }
  .settings-toolbar {
    position: static;
  }
}

