/* Voltfriq Ocean shared design system */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --yellow: #ffb800;
  --yellow-light: rgba(255, 184, 0, 0.14);
  --yellow-dark: #f0aa00;
  --dark: #08111f;
  --dark2: #0d1829;
  --mid: #9bacbf;
  --light: #111f33;
  --white: #f7fbff;
  --green: #26c281;
  --green-light: rgba(38, 194, 129, 0.15);
  --red: #ef5a5a;
  --red-light: rgba(239, 90, 90, 0.14);
  --blue: #5ba7ff;
  --blue-light: rgba(91, 167, 255, 0.14);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 12px 36px rgba(0, 0, 0, 0.26);
  --app-max: 1200px;
  --content-max: 960px;
  --compact-max: 720px;
  --shell-pad-x: 20px;

  --app-bg: #040b16;
  --app-bg-strong: #02070f;
  --surface-base: rgba(7, 16, 29, 0.98);
  --surface-elevated: rgba(12, 24, 41, 0.96);
  --surface-muted: rgba(255, 255, 255, 0.045);
  --surface-soft: rgba(255, 255, 255, 0.03);
  --surface-highlight: rgba(255, 184, 0, 0.1);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #f7fbff;
  --text-secondary: #afbdd0;
  --text-tertiary: #7f92aa;
  --focus-ring: 0 0 0 3px rgba(255, 184, 0, 0.2);
}

html, body {
  height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 184, 0, 0.1), transparent 25%),
    radial-gradient(circle at 18% 10%, rgba(91, 167, 255, 0.08), transparent 24%),
    linear-gradient(180deg, var(--app-bg) 0%, #07101d 46%, var(--app-bg-strong) 100%);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; }

.screen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(7, 16, 29, 0.98) 0%, rgba(4, 11, 22, 0.98) 100%);
  color: var(--text-primary);
  transform: translateX(105%);
  transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 1;
  border-radius: 0;
  box-shadow: none;
}
.screen.active { transform: translateX(0); z-index: 2; }
.screen.prev { transform: translateX(-30%); z-index: 1; }

.screen-body {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 20px var(--shell-pad-x) 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen-header {
  width: 100%;
  margin: 0 auto;
  padding: 52px 20px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(6, 14, 25, 0.98), rgba(6, 14, 25, 0.88));
  backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.screen-header-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  color: var(--text-primary);
}

.app-shell,
.portal-shell,
.admin-body,
.admin-detail-body,
.elec-reg-body,
.elec-dash-scroll,
.elec-job-scroll,
.elec-assess-scroll,
.elec-confirm-scroll,
.elec-profile-scroll,
.elec-history-scroll {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--yellow);
  color: #07111f;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 16px 24px;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 10px 28px rgba(255, 184, 0, 0.28);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--yellow-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 10px 28px rgba(255, 184, 0, 0.28), var(--focus-ring); }
.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-tertiary);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-large {
  width: 100%;
  padding: 18px 24px;
  font-size: 17px;
  border-radius: 16px;
}
.btn-full { width: 100%; padding: 17px 24px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-muted);
  color: var(--text-primary);
  border: 1.5px solid var(--border-strong);
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 14px 20px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-secondary:hover {
  border-color: rgba(255, 184, 0, 0.45);
  background: rgba(255, 184, 0, 0.12);
}
.btn-secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-ghost {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: underline;
  text-align: center;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  cursor: pointer;
  color: var(--text-primary);
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
}
.btn-icon:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-danger { background: var(--red); color: var(--white); box-shadow: none; }
.btn-danger:hover { background: #dc4c4c; }

.btn-success { background: var(--green); color: #04110d; box-shadow: none; }
.btn-success:hover { background: #20ae74; }

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

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border-subtle);
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.form-input:focus,
.form-select:focus {
  border-color: rgba(255, 184, 0, 0.55);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--focus-ring);
}

.form-input::placeholder { color: var(--text-tertiary); }
textarea.form-input { resize: none; line-height: 1.55; }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239BACBF' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

.optional { font-weight: 400; color: var(--text-tertiary); }

.card {
  background: linear-gradient(180deg, rgba(12, 24, 41, 0.94) 0%, rgba(9, 18, 32, 0.96) 100%);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
}

.card-dark {
  background: linear-gradient(180deg, rgba(5, 11, 21, 0.98) 0%, rgba(3, 8, 16, 0.98) 100%);
  color: var(--text-primary);
  border-color: rgba(255, 184, 0, 0.14);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
}
.badge-green { background: var(--green-light); color: #9ff0c8; border-color: rgba(38, 194, 129, 0.18); }
.badge-yellow { background: var(--yellow-light); color: #ffd978; border-color: rgba(255, 184, 0, 0.18); }
.badge-red { background: var(--red-light); color: #ffb0b0; border-color: rgba(239, 90, 90, 0.18); }
.badge-blue { background: var(--blue-light); color: #b3d8ff; border-color: rgba(91, 167, 255, 0.18); }
.badge-gray { background: var(--surface-muted); color: var(--text-secondary); border-color: var(--border-subtle); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover,
.chip.active {
  border-color: rgba(255, 184, 0, 0.48);
  background: rgba(255, 184, 0, 0.12);
}
.chip.active { box-shadow: var(--focus-ring); }

.dot-live {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.dot-sep { color: rgba(255, 255, 255, 0.24); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 15px; font-weight: 500; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.tab {
  flex: 1;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(5, 11, 21, 0.96);
  border-top: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-item.active { color: var(--yellow); }
.nav-icon { font-size: 20px; }
.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--surface-base);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:hover { background: rgba(255, 255, 255, 0.04); }
.list-item:last-child { border-bottom: none; }

.list-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 184, 0, 0.14);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.list-info { flex: 1; min-width: 0; }
.list-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.list-sub {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-meta { text-align: right; flex-shrink: 0; }
.list-time { font-size: 12px; color: var(--text-tertiary); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0;
}

.stat-card {
  background: linear-gradient(180deg, rgba(13, 24, 41, 0.96) 0%, rgba(9, 18, 32, 0.98) 100%);
  border-radius: 14px;
  padding: 16px;
  border: 1.5px solid var(--border-subtle);
}
.stat-value { font-size: 24px; font-weight: 800; margin-bottom: 2px; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(0.9); }
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 4px; }

@media (min-width: 640px) {
  body { background:
    radial-gradient(circle at 82% 16%, rgba(255, 184, 0, 0.12), transparent 25%),
    radial-gradient(circle at 18% 10%, rgba(91, 167, 255, 0.08), transparent 24%),
    linear-gradient(180deg, var(--app-bg) 0%, #07101d 46%, var(--app-bg-strong) 100%); }
  :root { --shell-pad-x: 24px; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .screen-header,
  .screen-body,
  .admin-detail-body,
  .elec-reg-body {
    max-width: var(--compact-max);
  }
}

@media (min-width: 1024px) {
  :root { --shell-pad-x: 32px; }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .screen-header,
  .screen-body,
  .admin-detail-body {
    max-width: var(--content-max);
  }
  .admin-body,
  .elec-dash-scroll,
  .elec-job-scroll,
  .elec-assess-scroll,
  .elec-confirm-scroll,
  .elec-profile-scroll,
  .elec-history-scroll {
    max-width: var(--app-max);
  }
}
