:root {
  --ocean-deep: #0a3d5c;
  --ocean-mid:  #1a6b8a;
  --ocean-light:#2eb8c7;
  --wave:       #4dd9e8;
  --foam:       #e8f9fb;
  --sand:       #f5e6c8;
  --sand-dark:  #d4b896;
  --sunset:     #f07d3a;
  --coral:      #e84a5f;
  --white:      #ffffff;
  --text-dark:  #0d2b3e;
  --text-mid:   #3a6680;
  --text-light: #7aa8bf;
  --border:     rgba(46,184,199,0.2);
  --glass:      rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.15);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--ocean-deep); min-height: 100vh; color: var(--white); overflow-x: hidden; }

/* ====== WAVE BG ====== */
.wave-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, #0a3d5c 0%, #0d5070 40%, #1a6b8a 70%, #0f3d52 100%);
}
.wave-bg svg { position: absolute; bottom: 0; left: 0; width: 200%; animation: wavemove 12s linear infinite; opacity: 0.18; }
.wave-bg svg:nth-child(2) { animation-duration: 18s; animation-direction: reverse; opacity: 0.1; bottom: -10px; }
.wave-bg svg:nth-child(3) { animation-duration: 24s; opacity: 0.07; bottom: -20px; }
@keyframes wavemove { from{transform:translateX(0)} to{transform:translateX(-50%)} }
.bubble { position: fixed; border-radius: 50%; background: rgba(78,217,232,0.12); animation: rise linear infinite; pointer-events: none; }
@keyframes rise { 0%{transform:translateY(0) scale(1);opacity:0.6} 100%{transform:translateY(-100vh) scale(0.5);opacity:0} }

/* ====== LAYOUT ====== */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ====== SIDEBAR ====== */
.sidebar {
  width: 240px; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh;
  background: rgba(10,30,50,0.75); backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex; flex-direction: column; padding: 1.5rem 1rem;
}
.logo-area { padding: 0.5rem 0.75rem 1.5rem; border-bottom: 1px solid var(--glass-border); margin-bottom: 1rem; }
.logo-icon-wrap { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--ocean-light), var(--wave)); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.logo-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; color: var(--white); letter-spacing: 0.3px; }
.logo-sub { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-radius: 10px; cursor: pointer; font-size: 14px; color: rgba(255,255,255,0.6);
  transition: all 0.2s; margin-bottom: 4px; border: 1px solid transparent;
}
.nav-item:hover { background: var(--glass); color: var(--white); border-color: var(--glass-border); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(46,184,199,0.25), rgba(78,217,232,0.1));
  color: var(--wave); border-color: rgba(46,184,199,0.4); font-weight: 500;
}
.nav-icon-box { width: 32px; height: 32px; border-radius: 8px; background: var(--glass); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.nav-item.active .nav-icon-box { background: rgba(46,184,199,0.2); }
.nav-spacer { flex: 1; }
.nav-item.logout { color: rgba(232,74,95,0.7); }
.nav-item.logout:hover { background: rgba(232,74,95,0.1); color: var(--coral); border-color: rgba(232,74,95,0.3); }

/* ====== MAIN ====== */
.main { flex: 1; margin-left: 240px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: rgba(10,30,50,0.6); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 1.75rem; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.page-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 600; color: var(--white); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }
.status-txt { font-size: 12px; color: rgba(255,255,255,0.5); }
.avatar-wrap { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--ocean-light), var(--wave)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ocean-deep); border: 2px solid rgba(78,217,232,0.4); }
.avatar-name { font-size: 13px; color: rgba(255,255,255,0.7); font-weight: 500; }
.content { flex: 1; padding: 1.75rem; }
.page { display: none; }
.page.active { display: block; animation: fadein 0.25s ease; }
@keyframes fadein { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* ====== STATS ====== */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: rgba(255,255,255,0.06); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: 14px; padding: 1.25rem;
  position: relative; overflow: hidden;
}
.stat-card::before { content:''; position:absolute; top:-30px; right:-20px; width:80px; height:80px; border-radius:50%; background: rgba(46,184,199,0.1); }
.stat-icon { font-size: 22px; margin-bottom: 10px; }
.stat-label { font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.stat-val { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 700; color: var(--white); }
.stat-sub { font-size: 11px; color: var(--ocean-light); margin-top: 4px; }

/* ====== GLASS CARD ====== */
.card {
  background: rgba(255,255,255,0.06); backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border); border-radius: 16px; padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-title { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 600; color: var(--white); margin-bottom: 1.25rem; display: flex; align-items: center; gap: 8px; }
.card-title-icon { width: 28px; height: 28px; border-radius: 7px; background: rgba(46,184,199,0.2); display: flex; align-items: center; justify-content: center; font-size: 14px; }

/* ====== FORM (dashboard) ====== */
.form-row { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 12px; color: var(--text-light); font-weight: 500; letter-spacing: 0.3px; text-transform: uppercase; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--white); outline: none; transition: all 0.2s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(255,255,255,0.3); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--ocean-light); background: rgba(46,184,199,0.08);
  box-shadow: 0 0 0 3px rgba(46,184,199,0.12);
}
.form-group select option { background: #0a3d5c; color: #fff; }
.form-group textarea { resize: vertical; min-height: 95px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 0.5rem; }
.btn-primary {
  padding: 10px 20px; background: linear-gradient(135deg, var(--ocean-light), var(--wave));
  color: var(--ocean-deep); border: none; border-radius: 10px; font-size: 14px;
  font-weight: 700; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
  letter-spacing: 0.2px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(46,184,199,0.35); }
.btn-ghost {
  padding: 10px 20px; background: var(--glass); color: var(--white);
  border: 1px solid var(--glass-border); border-radius: 10px; font-size: 14px;
  font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }

/* ====== TABLE ====== */
.filter-row { display: flex; gap: 10px; margin-bottom: 1.25rem; }
.filter-row input, .filter-row select {
  padding: 9px 14px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
  font-size: 13px; color: var(--white); outline: none; font-family: 'Inter', sans-serif;
  transition: border 0.2s;
}
.filter-row input { flex: 1; }
.filter-row input::placeholder { color: rgba(255,255,255,0.3); }
.filter-row input:focus, .filter-row select:focus { border-color: var(--ocean-light); }
.filter-row select option { background: #0a3d5c; }
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; font-weight: 600; color: var(--text-light);
  padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.08);
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
}
td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }
.badge {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-on { background: rgba(74,222,128,0.15); color: #4ade80; border: 1px solid rgba(74,222,128,0.3); }
.badge-off { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.1); }
.btn-sm {
  padding: 5px 12px; border-radius: 7px; font-size: 12px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: rgba(255,255,255,0.6); transition: all 0.15s; font-family: 'Inter', sans-serif;
  margin-right: 5px;
}
.btn-sm:hover { background: rgba(255,255,255,0.12); color: var(--white); }
.btn-sm.del:hover { background: rgba(232,74,95,0.15); border-color: rgba(232,74,95,0.4); color: var(--coral); }
.empty-state { text-align: center; padding: 3rem; color: var(--text-light); font-size: 14px; }
.empty-icon { font-size: 36px; margin-bottom: 0.75rem; opacity: 0.4; }

/* ====== LOG GRID ====== */
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.log-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;
}
.log-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.log-img {
  width: 100%; height: 145px; background: linear-gradient(135deg, #0d5070, #1a6b8a);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.violation-label {
  position: absolute; top: 10px; left: 10px;
  background: linear-gradient(135deg, #e24b4a, #c0392b);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 5px; letter-spacing: 0.5px;
}
.handled-label {
  position: absolute; top: 10px; right: 10px;
  background: linear-gradient(135deg, #1D9E75, #0F6E56);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 10px; border-radius: 5px;
}
.log-info { padding: 14px; }
.log-time { font-size: 11px; color: var(--text-light); display: flex; align-items: center; gap: 5px; }
.log-loc { font-size: 12px; color: var(--ocean-light); margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* ====== LOGIN ====== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; padding: 2rem 1rem;
}
.login-card {
  width: 380px; background: rgba(10,30,50,0.85); backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 2.5rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo-icon {
  width: 64px; height: 64px; border-radius: 18px;
  background: linear-gradient(135deg, var(--ocean-light), var(--wave));
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
  box-shadow: 0 8px 25px rgba(46,184,199,0.35);
}
.login-title { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; color: var(--white); }
.login-sub { font-size: 13px; color: var(--text-light); margin-top: 6px; }
.login-field { margin-bottom: 1rem; }
.login-field label { display: block; font-size: 11px; color: var(--text-light); font-weight: 600; margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.5px; }
.login-field input,
.login-field select {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 11px; font-size: 14px; color: var(--white); outline: none;
  transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.login-field input::placeholder { color: rgba(255,255,255,0.25); }
.login-field input:focus,
.login-field select:focus { border-color: var(--ocean-light); background: rgba(46,184,199,0.08); box-shadow: 0 0 0 3px rgba(46,184,199,0.12); }
.login-field select option { background: #0a3d5c; color: #fff; }
.login-err { font-size: 12px; color: var(--coral); margin-bottom: 0.75rem; display: none; padding: 8px 12px; background: rgba(232,74,95,0.1); border-radius: 8px; border: 1px solid rgba(232,74,95,0.2); }
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--ocean-light), var(--wave));
  color: var(--ocean-deep); border: none; border-radius: 11px; font-size: 15px;
  font-weight: 700; cursor: pointer; transition: all 0.2s;
  font-family: 'Syne', sans-serif; letter-spacing: 0.3px;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(46,184,199,0.4); }
.login-hint { font-size: 12px; color: rgba(255,255,255,0.25); text-align: center; margin-top: 1.25rem; }
.reg-link { color: var(--wave); cursor: pointer; text-decoration: none; }
.reg-link:hover { text-decoration: underline; }

/* ====== LOGIN ROLE BADGE ====== */
.login-role-badge {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 10px; margin-bottom: 1.25rem;
  background: rgba(46,184,199,0.1); border: 1px solid rgba(46,184,199,0.25);
  font-size: 13px; font-weight: 600; color: var(--wave);
  transition: all 0.3s;
}
.login-role-badge.admin-mode {
  background: rgba(99,102,241,0.1); border-color: rgba(99,102,241,0.3); color: #818cf8;
}

/* ====== REGISTER CARD ====== */
.reg-card {
  width: 460px;
  background: rgba(10,30,50,0.85); backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 20px; padding: 2.25rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  animation: fadein 0.35s ease;
}

/* Grid dua kolom untuk nama depan/belakang & field samping */
.reg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reg-form-grid .login-field { margin-bottom: 0; }

/* Tab role */
.role-tabs {
  display: flex; background: rgba(255,255,255,0.05);
  border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.1);
}
.role-tab {
  flex: 1; padding: 9px; text-align: center; border-radius: 7px;
  font-size: 13px; cursor: pointer; color: rgba(255,255,255,0.45);
  transition: all 0.2s; border: 1px solid transparent;
}
.role-tab.active {
  background: linear-gradient(135deg, rgba(46,184,199,0.25), rgba(78,217,232,0.12));
  color: var(--wave); border-color: rgba(46,184,199,0.4); font-weight: 600;
}
.role-tab:not(.active):hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.7); }

/* Password toggle */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 16px; padding: 0; line-height: 1;
}
.pass-toggle:hover { color: rgba(255,255,255,0.7); }

/* Strength bar */
.strength-bar {
  height: 3px; border-radius: 99px; background: rgba(255,255,255,0.1);
  margin-top: 8px; overflow: hidden;
}
.strength-fill { height: 100%; border-radius: 99px; transition: all 0.3s ease; width: 0%; }
.strength-label { display: block; font-size: 11px; color: rgba(255,255,255,0.3); margin-top: 5px; transition: color 0.3s; }

/* Divider dalam form registrasi */
.reg-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 0.75rem 0 1rem; }

/* Alert boxes registrasi */
.reg-err {
  font-size: 12px; color: var(--coral); margin-bottom: 0.75rem;
  padding: 9px 13px; background: rgba(232,74,95,0.1); border-radius: 8px;
  border: 1px solid rgba(232,74,95,0.22); display: none;
}
.reg-success {
  font-size: 12px; color: #4ade80; margin-bottom: 0.75rem;
  padding: 9px 13px; background: rgba(74,222,128,0.08); border-radius: 8px;
  border: 1px solid rgba(74,222,128,0.25); display: none;
}

/* Hint kecil di bawah input */
.field-hint { font-size: 11px; color: rgba(255,255,255,0.28); margin-top: 5px; display: block; }

/* ====== TOAST ====== */
.toast {
  position: fixed; bottom: 1.75rem; right: 1.75rem;
  background: rgba(10,30,50,0.9); backdrop-filter: blur(20px);
  color: var(--white); padding: 12px 20px; border-radius: 12px; font-size: 14px;
  z-index: 9999; border: 1px solid var(--glass-border);
  transform: translateY(20px); opacity: 0; transition: all 0.3s; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ====== BADGE ROLE ====== */
.badge-admin {
  background: rgba(99,102,241,0.15); color: #818cf8;
  border: 1px solid rgba(99,102,241,0.3);
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-petugas {
  background: rgba(251,191,36,0.12); color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.req { color: #e84a5f; }

/* ====== DIVIDER ====== */
.section-sep { height: 1px; background: linear-gradient(90deg, transparent, rgba(46,184,199,0.3), transparent); margin: 1.5rem 0; }