/* ========================================================
   ADMIN PANEL STYLESHEET - KARANG TARUNA PESANGGERAHAN
   Responsive on Desktop, iPad, and Mobile Handphone
   Smooth Micro-Interactions & Transitions
   ======================================================== */

:root {
  --bg: #f3f4ee;
  --panel: #ffffff;
  --ink: #191c1a;
  --ink-light: #3d433f;
  --muted: #6b726c;
  --muted-light: #9ea59f;
  --line: #e3e0d5;
  --line-light: #ece9e1;
  
  --green: #234734;
  --green-dark: #173324;
  --green-light: #e8f0ea;
  --green-text: #1d3e2d;
  
  --red: #b8412e;
  --red-dark: #983322;
  --red-light: #faecea;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(20,30,24,0.06), 0 1px 2px rgba(20,30,24,0.04);
  --shadow-md: 0 4px 16px -2px rgba(20,30,24,0.08), 0 2px 6px -1px rgba(20,30,24,0.04);
  --shadow-hover: 0 14px 28px -4px rgba(35,71,52,0.12), 0 4px 12px -2px rgba(35,71,52,0.06);

  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ========================================================
   ADMIN LAYOUT & SIDEBAR
   ======================================================== */

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

.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 99;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  position: relative;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--red-light);
  color: var(--red);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
}

.brand-text small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--muted);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
  margin-left: auto;
}

.sidebar-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--muted-light);
  padding: 0 12px;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-light);
  transition: all var(--transition-fast);
}

.sidebar-nav a:hover {
  background: var(--bg);
  color: var(--green);
  transform: translateX(3px);
}

.sidebar-nav a.active {
  background: var(--green-light);
  color: var(--green);
  font-weight: 700;
}

.nav-icon {
  font-size: 16px;
  line-height: 1;
}

.nav-text {
  flex: 1;
}

.nav-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-light);
  font-family: monospace;
}

.sidebar-footer {
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.view-site-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  transition: all var(--transition-fast);
}

.view-site-link:hover {
  background: var(--green);
  color: #fff;
  transform: translateY(-2px);
}

.admin-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta strong {
  display: block;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.logout-btn {
  font-size: 11px;
  font-weight: 700;
  color: var(--red);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--red-light);
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: var(--red);
  color: #fff;
}

.sidebar-backdrop {
  display: none;
}

/* ========================================================
   ADMIN MAIN & TOPBAR
   ======================================================== */

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  color: var(--ink);
}

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.crumb-separator {
  color: var(--line);
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 700;
}

.topbar-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.admin-content {
  padding: 32px;
  flex: 1;
}

.page-header-anim {
  margin-bottom: 28px;
  animation: fadeInDown 0.4s ease;
}

.admin-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 6px;
}

.admin-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.admin-footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 32px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #ffffff;
  flex-wrap: wrap;
  gap: 10px;
}

/* ========================================================
   STAT CARDS & PANELS
   ======================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #d1ccbe;
}

.stat-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: clamp(30px, 3.5vw, 40px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 10px 0 8px;
  color: var(--ink);
}

.stat-card small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.stat-badge {
  font-size: 11px;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  align-items: start;
}

.grid-2-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--ink);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-head h2 {
  margin: 0;
}

.panel-dark {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
  border: none;
}

.panel-dark h2 {
  color: #fff;
}

.panel-dark p {
  color: #d0dfd4;
  font-size: 13px;
  margin: 0 0 16px;
}

.big-number {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  margin: 12px 0 4px;
  color: var(--green);
}

.bar-row {
  margin-top: 14px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.bar {
  height: 8px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-baik {
  background: var(--green);
}

.bar-rusak-ringan {
  background: #d97706;
}

.bar-rusak-berat {
  background: #dc2626;
}

/* ========================================================
   BUTTONS, INPUTS, FORMS
   ======================================================== */

.btn-primary, .btn-danger, .btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: 0 2px 6px rgba(184, 65, 46, 0.2);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 65, 46, 0.3);
}

.btn-danger {
  background: #fff;
  color: var(--red);
  border: 1px solid var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-block {
  display: block;
  width: 100%;
  padding: 12px;
}

.btn-white {
  background: #ffffff;
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

.btn-white:hover {
  background: #f8faf8;
  transform: translateY(-2px);
}

.btn-link {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.link-arrow {
  color: var(--red);
  font-weight: 700;
  font-size: 13px;
}

.link-arrow:hover {
  transform: translateX(3px);
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-light);
}

label input,
label select,
label textarea,
form input[type="text"],
form input[type="date"],
form input[type="number"],
form select,
form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--ink);
  outline: none;
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

label input:focus,
label select:focus,
label textarea:focus,
form input:focus,
form select:focus,
form textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 65, 46, 0.12);
}

label textarea {
  resize: vertical;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-tabs a {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: var(--ink-light);
  transition: all var(--transition-fast);
}

.filter-tabs a:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-tabs a.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}

/* ========================================================
   BADGES & ALERTS
   ======================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.badge-ok {
  background: #e3ecdf;
  color: #245624;
}

.badge-warn {
  background: #faeedf;
  color: #a35a1f;
}

.badge-muted {
  background: #ece9e1;
  color: #555c56;
}

.badge-err {
  background: #fee2e2;
  color: #b91c1c;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeInUp 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.alert-ok {
  background: #e3ecdf;
  color: #1e4a1e;
  border-left: 4px solid #2e7d32;
}

.alert-err {
  background: #faeedf;
  color: #8c3b0f;
  border-left: 4px solid #d97706;
}

.alert-icon {
  font-size: 16px;
  font-weight: 800;
}

.alert-msg {
  flex: 1;
}

.alert-close {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}

/* ========================================================
   LISTS & TABLES
   ======================================================== */

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-light);
  gap: 14px;
  transition: all var(--transition-fast);
}

.list-row:last-child {
  border-bottom: none;
}

.list-row:hover {
  transform: translateX(4px);
}

.list-row-active {
  background: var(--red-light);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
}

.list-row strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.list-row small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.list-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: var(--bg);
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line-light);
  color: var(--ink);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #fbfaf6;
}

.table-row-active td {
  background: var(--red-light) !important;
}

/* Album & Photo Grid */
.album-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: #ffffff;
  transition: all var(--transition-fast);
}

.album-row:hover {
  border-color: var(--green);
  transform: translateX(3px);
}

.album-row.active {
  border-color: var(--green);
  background: var(--green-light);
}

.upload-box {
  background: var(--bg);
  border: 2px dashed #c8d0c0;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.foto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.foto-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eee;
  aspect-ratio: 4 / 3;
}

.foto-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.foto-item:hover img {
  transform: scale(1.05);
}

/* Pengurus Admin Box */
.pengurus-list-admin {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pengurus-item-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pengurus-fields {
  display: flex;
  gap: 10px;
  flex: 1;
}

.field-col {
  flex: 1;
}

.pengurus-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ========================================================
   LOGIN PAGE — MODERN SPLIT EDITORIAL & RESPONSIVE UI
   ======================================================== */

@keyframes loginFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(14px, -18px, 0) scale(1.04); }
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-page {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 12% 18%, #e5ede6 0%, #f3f4ee 48%, #ebe8dd 100%);
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow-x: clip;
}

.login-bg-shapes {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  opacity: 0.45;
  animation: loginFloat 12s ease-in-out infinite;
}

.login-blob-1 {
  width: 380px;
  height: 380px;
  top: -110px;
  left: -90px;
  background: #9ec5ab;
}

.login-blob-2 {
  width: 340px;
  height: 340px;
  right: -100px;
  bottom: -100px;
  background: #e9c4b8;
  animation-delay: -6s;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  background: #ffffff;
  border: 1px solid rgba(227, 224, 213, 0.9);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 64px -18px rgba(23, 51, 36, 0.2), 0 8px 20px -6px rgba(23, 51, 36, 0.08);
  animation: scaleIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Left Brand Showcase */
.login-aside {
  position: relative;
  background: linear-gradient(155deg, #234734 0%, #163223 65%, #11261b 100%);
  color: #ffffff;
  padding: 44px 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
}

.login-aside::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -90px;
  top: -90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.login-aside-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: #ffffff;
  transition: transform var(--transition-fast);
}

.login-aside-brand:hover {
  transform: translateY(-2px);
}

.login-crest {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.login-aside-brand strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
}

.login-aside-brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 700;
  margin-top: 2px;
}

.login-aside-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #b7e4c7;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.login-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.22);
}

.login-aside h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
  color: #ffffff;
}

.login-aside p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
}

.login-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.lf-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  color: #d8f3dc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.login-aside-foot {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

/* Right Form Card */
.login-card {
  padding: 44px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-crest-sm {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--green-light);
  padding: 4px;
}

.login-step-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--red);
  background: var(--red-light);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.login-header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: var(--ink);
}

.login-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 26px;
  line-height: 1.55;
}

.login-alert-shake {
  animation: loginShake 0.4s ease;
  margin-bottom: 20px;
}

.login-field-anim {
  animation: fadeInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.field-shake {
  animation: loginShake 0.36s ease;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-light);
  margin-bottom: 7px;
}

.login-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.login-label-row label {
  margin-bottom: 0;
}

.caps-badge {
  font-size: 11px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.login-input-wrap {
  display: flex;
  align-items: center;
  width: 100%;
  height: 50px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fafaf7;
  overflow: hidden;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.login-input-wrap:hover {
  border-color: #cfcbb9;
}

.login-input-wrap:focus-within {
  background: #ffffff;
  border-color: var(--green);
  box-shadow: 0 0 0 3.5px rgba(35, 71, 52, 0.12);
}

.login-input-prefix {
  width: 46px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  background: rgba(35, 71, 52, 0.035);
  border-right: 1px solid var(--line-light);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.login-input-wrap:focus-within .login-input-prefix {
  background: var(--green-light);
  color: var(--green);
  border-right-color: rgba(35, 71, 52, 0.16);
}

.login-form .login-input-wrap input.login-input,
.login-form .login-input-wrap input[type="text"].login-input,
.login-form .login-input-wrap input[type="password"].login-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}

.login-form .login-input-wrap input.login-input::placeholder {
  color: var(--muted-light);
  font-weight: 400;
}

.login-form .login-input-wrap input.login-input:focus {
  border: none;
  box-shadow: none;
  background: transparent;
}

.login-form .login-input-wrap input.login-input:-webkit-autofill,
.login-form .login-input-wrap input.login-input:-webkit-autofill:hover,
.login-form .login-input-wrap input.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  transition: background-color 5000s ease-in-out 0s;
}

.login-form .login-input-wrap input.login-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-toggle-pwd {
  width: 42px;
  height: 42px;
  margin-right: 4px;
  border-radius: 9px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-toggle-pwd:hover:not(:disabled) {
  background: var(--bg);
  color: var(--green);
}

.btn-toggle-pwd:active:not(:disabled) {
  transform: scale(0.94);
}

.btn-login {
  width: 100%;
  height: 50px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  transition: transform var(--transition-fast), box-shadow var(--transition), background var(--transition-fast);
}

.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -6px rgba(35, 71, 52, 0.34);
}

.btn-login:active:not(:disabled) {
  transform: scale(0.985);
}

.btn-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-login-arrow {
  transition: transform var(--transition-fast);
}

.btn-login:hover:not(:disabled) .btn-login-arrow {
  transform: translateX(4px);
}

.btn-login-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

.btn-login.is-loading .btn-login-arrow {
  display: none;
}

.btn-login.is-loading .btn-login-spinner {
  display: inline-block;
}

.login-footer {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-sec-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--bg);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  line-height: 1.35;
}

.login-sec-note svg {
  color: var(--green);
  flex-shrink: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.back-link:hover {
  color: var(--red);
  transform: translateX(-2px);
}

/* Login Responsive Breakpoints */
@media (max-width: 859px) {
  .login-shell {
    max-width: 460px;
    grid-template-columns: 1fr;
  }

  .login-aside {
    display: none;
  }

  .login-mobile-brand {
    display: inline-flex;
  }

  .login-card {
    padding: 36px 30px;
  }
}

@media (max-width: 600px) {
  .login-card {
    padding: 28px 20px;
  }

  .login-header h1 {
    font-size: 24px;
  }

  .login-sec-note {
    font-size: 11px;
    border-radius: 10px;
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-blob,
  .login-shell,
  .login-field-anim,
  .login-alert-shake,
  .field-shake {
    animation: none !important;
  }
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES (TABLET & MOBILE)
   ======================================================== */

@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .admin-content {
    padding: 24px;
  }
}

@media (max-width: 1024px) {
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-close-btn {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(265px, 72vw);
    height: 100vh;
    height: 100dvh;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-100%);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

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

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 15, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .admin-topbar {
    padding: 12px 20px;
  }

  .admin-footer {
    padding: 14px 20px;
    flex-direction: column;
    text-align: center;
  }

  .topbar-date {
    display: none;
  }
}

@media (max-width: 600px) {
  .admin-content {
    padding: 16px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .grid-2-inline {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 20px 16px;
  }

  .foto-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .upload-box {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-box button {
    width: 100%;
  }

  .pengurus-item-box {
    flex-direction: column;
    align-items: stretch;
  }

  .pengurus-fields {
    flex-direction: column;
  }

  .login-box {
    padding: 28px 20px;
  }
}


/* ========================================================
   CROSS-DEVICE RESPONSIVE BEST PRACTICES (ADMIN PANEL)
   Desktop · iPad · Android · iOS
   ======================================================== */

body {
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

a, button, input, select, textarea {
  touch-action: manipulation;
}

/* Prevent CSS Grid & Flex children from pushing tables/panels beyond viewport width */
.admin-main,
.admin-content,
.grid-2 > *,
.grid-2-inline > *,
.stat-grid > *,
.panel,
.list-row > *,
.album-row > * {
  min-width: 0;
}

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

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.sidebar {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.admin-topbar {
  padding-top: max(12px, env(safe-area-inset-top));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.admin-footer {
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.panel-head {
  flex-wrap: wrap;
  gap: 10px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* iPad Portrait, Android & iOS Mobile (<= 900px) */
@media (max-width: 900px) {
  /* Prevent iOS Safari involuntary auto-zoom on form inputs */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="date"],
  select,
  textarea,
  .login-form .login-input-wrap input.login-input {
    font-size: 16px;
  }

  .menu-toggle,
  .sidebar-close-btn {
    min-width: 44px;
    min-height: 44px;
  }

  .sidebar {
    max-width: 85vw;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .sidebar-nav a {
    min-height: 44px;
  }
}

/* Mobile Smartphones — Android & iOS (<= 600px) */
@media (max-width: 600px) {
  .admin-topbar {
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px 14px;
  }

  .stat-card strong {
    font-size: 26px;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs a {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .list-row,
  .album-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Override inline max-width on Urutan field in admin/profil.php when stacked */
  .pengurus-item-box .field-col {
    max-width: 100% !important;
    width: 100%;
  }

  .pengurus-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px dashed var(--line);
  }

  .btn-primary,
  .btn-danger {
    min-height: 44px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 12px;
  }
}

@media (max-width: 360px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================
   ADMIN PHOTO AVATAR THUMBNAILS & UPLOAD CONTROLS
   ======================================================== */

.admin-avatar-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1.5px var(--line);
}

.admin-avatar-thumb.admin-avatar-sm {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.admin-avatar-thumb.admin-avatar-lg {
  width: 72px;
  height: 72px;
  font-size: 26px;
}

.admin-avatar-thumb.has-photo {
  background: var(--bg);
}

.admin-avatar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.pengurus-item-with-photo {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.pengurus-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.pengurus-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.pengurus-photo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.admin-file-compact {
  font-size: 12px !important;
  max-width: 230px;
  padding: 4px !important;
  margin: 0 !important;
}

.admin-check-inline {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--red) !important;
  cursor: pointer;
}

.admin-check-inline input[type="checkbox"] {
  width: auto !important;
  margin: 0 !important;
  accent-color: var(--red);
}

.admin-photo-field {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .pengurus-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .pengurus-top-row .admin-avatar-thumb {
    align-self: flex-start;
  }

  .admin-photo-field {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-file-compact {
    max-width: 100%;
    width: 100%;
  }
}
