/* =========================================
   Indopoin Portal — Stylesheet
   Ekstraksi dari index.html inline <style>
   Tanggal: 2026-06-29
   ========================================= */

:root {
  color-scheme: dark;
  --bg: #070d1a;
  --card: #0f172a;
  --surface: #1b263b;
  --border: #23324b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.18);
  --danger: #ef4444;
  --shadow: 0 18px 44px rgba(2, 6, 23, 0.55);
  --accent-op: linear-gradient(135deg, #0ea5e9, #38bdf8);
  --accent-sp: linear-gradient(135deg, #0284c7, #0ea5e9);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: radial-gradient(circle at 20% 0%, #12213b 0%, #070d1a 42%, #050912 100%);
  color: var(--text);
  min-height: 100vh;
  padding: 16px;
}

/* ===== boot overlay ===== */
.app-boot-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 0%, #142744 0%, #0b1220 45%, #060b13 100%);
  transition: opacity .28s ease, visibility .28s ease;
}
.app-boot-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-boot-card {
  width: min(460px, 100%);
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 18px; padding: 28px 20px;
  background: rgba(8, 15, 29, 0.82);
  box-shadow: 0 20px 52px rgba(2, 6, 23, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-align: center; display: grid; gap: 14px; justify-items: center;
}
.app-boot-logo {
  width: 72px; height: 72px; border-radius: 18px; object-fit: cover;
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.45);
}
.app-boot-title { font-size: 20px; font-weight: 800; letter-spacing: .01em; color: #e2e8f0; line-height: 1.35; margin: 0; }
.app-boot-loader {
  width: min(280px, 82%); height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 50%, #0ea5e9 100%);
  background-size: 200% 100%;
  animation: app-boot-pulse 1.4s ease-in-out infinite;
}
@keyframes app-boot-pulse { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ===== layout shell ===== */
.shell {
  max-width: 1200px; margin: 0 auto;
  display: grid; gap: 16px;
}
.header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; gap: 12px; flex-wrap: wrap;
  background: rgba(11, 18, 32, 0.78);
  border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.logo span { font-weight: 800; letter-spacing: .01em; }
.page-title {
  font-size: 22px; font-weight: 800; color: #67e8f9;
  text-shadow: 0 0 16px rgba(56, 189, 248, .35);
}
.user-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.85); border: 1px solid var(--border);
  font-size: 13px; color: var(--text);
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #06121f; font-weight: 800; font-size: 12px;
}
.header-divider { width: 1px; align-self: stretch; background: rgba(148, 163, 184, .25); }
.badge {
  padding: 4px 10px; border-radius: 999px;
  background: rgba(56, 189, 248, .15); border: 1px solid rgba(56, 189, 248, .35);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: #67e8f9; font-weight: 700;
}

/* ===== card ===== */
.card {
  background: rgba(11, 18, 32, 0.78);
  border: 1px solid var(--border); border-radius: 18px;
  padding: 24px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.hidden { display: none !important; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.section-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hint { font-size: 12px; color: var(--muted); }
.error {
  font-size: 13px; color: #fecaca;
  background: rgba(220, 38, 38, .12); border: 1px solid rgba(220, 38, 38, .35);
  padding: 8px 12px; border-radius: 10px;
}
.error:empty { display: none; }

/* ===== login (2-tab) ===== */
.login-animated-wrap { position: relative; min-height: 560px; padding: 32px 8px; display: grid; place-items: center; overflow: hidden; }
.login-animated-ring {
  position: absolute; width: var(--ring-size, 540px); height: var(--ring-size, 540px);
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; animation: ring-spin 26s linear infinite;
  opacity: .35; pointer-events: none;
}
.login-animated-ring span {
  position: absolute; left: 50%; top: 0; width: 6px; height: 18px;
  background: linear-gradient(180deg, transparent, #38bdf8);
  transform-origin: 0 calc(var(--ring-size, 540px) / 2);
  transform: rotate(calc(var(--i) * 7.2deg)) translateX(0);
  border-radius: 4px;
}
@keyframes ring-spin { from { transform: translate(-50%, -50%) rotate(0); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.login-animated-box { position: relative; z-index: 2; width: min(420px, 100%); display: grid; gap: 14px; }
.login-animated-title { font-size: 36px; font-weight: 800; letter-spacing: -.01em; text-align: center; margin: 0; }
.login-animated-subtitle { text-align: center; color: var(--muted); margin: -6px 0 8px; font-size: 13px; }
.login-tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 4px; background: rgba(15, 23, 42, .85);
  border: 1px solid var(--border); border-radius: 14px;
}
.login-tab {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); padding: 10px 12px; border-radius: 10px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.login-tab.active { background: var(--accent-op); color: #06121f; box-shadow: 0 6px 18px rgba(14, 165, 233, .35); }
.login-pane.hidden { display: none; }
.login-fields { display: grid; gap: 12px; padding: 6px 4px; }
.animated-input-box {
  position: relative; display: grid; padding: 18px 14px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: rgba(11, 18, 32, .7);
}
.animated-input-box input {
  width: 100%; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 15px; font-weight: 600;
  font-family: inherit;
}
.animated-input-box label {
  position: absolute; top: 14px; left: 14px;
  color: var(--muted); font-size: 13px; pointer-events: none;
  transition: transform .18s ease, color .18s ease, font-size .18s ease;
  transform-origin: left top;
}
.animated-input-box input:focus + label,
.animated-input-box input:not(:placeholder-shown) + label {
  transform: translateY(-12px) scale(.82); color: #67e8f9;
}
.login-eye {
  position: absolute; right: 10px; bottom: 10px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer;
}
.login-eye:hover { background: rgba(56, 189, 248, .12); color: #67e8f9; }
.btn-login {
  appearance: none; border: 0; cursor: pointer;
  padding: 12px 16px; border-radius: 12px; font-weight: 800; font-size: 14px;
  color: #06121f; background: var(--accent-op);
  box-shadow: 0 12px 30px rgba(14, 165, 233, .35);
  position: relative; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-login::before {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transition: transform .6s ease;
}
.btn-login:hover { box-shadow: 0 18px 40px rgba(14, 165, 233, .45); }
.btn-login:hover::before { transform: translateX(180%); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { opacity: .55; cursor: not-allowed; }
.login-note { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.login-error {
  font-size: 13px; color: #fecaca;
  background: rgba(220, 38, 38, .12); border: 1px solid rgba(220, 38, 38, .35);
  padding: 8px 12px; border-radius: 10px; min-height: 0;
}
.login-error:empty { display: none; }

/* ===== OTP login extras ===== */
.btn-link {
  appearance: none; border: 0; background: transparent;
  color: #60a5fa; font-size: 12px; font-weight: 600; cursor: pointer;
  padding: 4px 8px; border-radius: 8px;
  transition: background .12s ease, color .12s ease;
}
.btn-link:hover { background: rgba(96, 165, 250, .12); color: #93c5fd; }
.otp-phone-display {
  text-align: center; font-size: 14px; color: #94a3b8; margin: 4px 0;
  padding: 10px; border-radius: 10px;
  background: rgba(15, 23, 42, .6); border: 1px solid var(--border);
}

/* ===== generic buttons ===== */
.btn {
  appearance: none; border: 1px solid var(--border);
  background: rgba(11, 18, 32, .85); color: var(--text);
  padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.btn:hover { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .45); color: #67e8f9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent-op); color: #06121f; border-color: transparent; }
.btn-primary:hover { color: #06121f; filter: brightness(1.05); }
.btn-add { background: #0ea5e9; color: #06121f; border-color: #0284c7; }
.btn-add:hover { background: #38bdf8; color: #06121f; }
.btn-logout { color: #fecaca; border-color: rgba(220, 38, 38, .45); }
.btn-logout:hover { background: rgba(220, 38, 38, .15); color: #fee2e2; }
.btn-icon svg { width: 16px; height: 16px; }

.input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: rgba(11, 18, 32, .85); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-family: inherit;
  outline: 0; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(56, 189, 248, .22); }

/* ===== apps grid ===== */
.apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.apps-empty {
  grid-column: 1 / -1; padding: 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: 14px;
  color: var(--muted); font-size: 14px;
}
.app-card {
  position: relative; display: grid; gap: 12px;
  padding: 18px; border-radius: 16px;
  background: rgba(11, 18, 32, .85); border: 1px solid var(--border);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  cursor: pointer; text-decoration: none; color: inherit;
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, .55);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .55), 0 0 0 1px rgba(56, 189, 248, .18);
}
.app-card.coming-soon { opacity: .55; cursor: not-allowed; }
.app-card.coming-soon:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }
.coming-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  background: rgba(15, 23, 42, .9); color: #94a3b8;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--border);
}
.app-card-head { display: flex; gap: 12px; align-items: flex-start; }
.app-icon-box {
  width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  color: var(--icon-color, #38bdf8);
}
.app-icon-box i { font-size: 26px; }
.app-name { font-size: 16px; font-weight: 800; margin: 0; }
.app-desc { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; line-height: 1.45; }
.user-count { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-action {
  flex: 1; text-align: center; padding: 9px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 700; text-decoration: none;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.app-action.primary {
  background: var(--accent-op); color: #06121f;
}
.app-action.primary:hover { filter: brightness(1.06); }
.app-action.outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.app-action.outline:hover { border-color: rgba(56, 189, 248, .55); color: #67e8f9; }
.app-action.disabled { background: rgba(15, 23, 42, .7); color: var(--muted); cursor: not-allowed; }

/* ===== admin ops panel ===== */
.ops-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ops-header-title { font-size: 16px; font-weight: 800; margin: 0; }
.ops-header-sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.ops-toolbar { display: flex; gap: 8px; }
.ops-list { display: grid; gap: 8px; margin-top: 10px; }
.operator-row {
  background: rgba(11, 18, 32, .7); border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden; transition: background .12s ease, border-color .12s ease;
}
.operator-row:hover { background: rgba(15, 23, 42, .9); border-color: rgba(56, 189, 248, .35); }
.operator-summary {
  width: 100%; appearance: none; border: 0; background: transparent;
  color: inherit; text-align: left; cursor: pointer;
  padding: 12px 14px; display: grid;
  grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center;
}
.op-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  color: #06121f; background: var(--av-grad, linear-gradient(135deg, #2563eb, #60a5fa));
}
.op-name { font-weight: 700; font-size: 14px; }
.op-phone { font-size: 12px; color: var(--muted); }
.op-preview { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; max-width: 320px; }
.op-chevron { color: var(--muted); font-size: 22px; line-height: 1; transition: transform .15s ease; }
.operator-row.expanded .op-chevron { transform: rotate(90deg); }
.operator-expand { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.operator-row.expanded .operator-expand { max-height: 1200px; border-top: 1px solid var(--border); }
.operator-expand-inner { padding: 14px; display: grid; gap: 10px; }
.op-id { font-size: 11px; color: var(--muted); }
.access-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.access-chip.readonly { opacity: .8; }
.device-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.device-row-label { color: var(--muted); }
.device-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.device-badge.single { background: rgba(14, 165, 233, .18); color: #67e8f9; border: 1px solid rgba(56, 189, 248, .35); }
.device-badge.multi { background: rgba(148, 163, 184, .12); color: #cbd5e1; border: 1px solid var(--border); }
.device-status.registered { color: #86efac; }
.device-status.empty { color: #94a3b8; }
.op-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-action {
  appearance: none; cursor: pointer;
  padding: 7px 11px; border-radius: 9px;
  background: rgba(15, 23, 42, .85); border: 1px solid var(--border);
  color: var(--text); font-weight: 700; font-size: 12px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.btn-action:hover { background: rgba(56, 189, 248, .12); border-color: rgba(56, 189, 248, .45); color: #67e8f9; }
.btn-action.primary { background: var(--accent-op); color: #06121f; border-color: transparent; }
.btn-action.danger { background: rgba(220, 38, 38, .15); border-color: rgba(239, 68, 68, .35); color: #fecaca; }
.btn-action.danger:hover { background: rgba(220, 38, 38, .25); color: #fee2e2; }

/* ===== modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(2, 6, 23, .75); backdrop-filter: blur(4px);
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(540px, 100%); max-height: 88vh; overflow: auto;
  background: rgba(11, 18, 32, .98); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; display: grid; gap: 12px; box-shadow: 0 30px 80px rgba(2, 6, 23, .8);
}
.modal h3 { margin: 0; font-size: 18px; font-weight: 800; }
.modal .row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 10px; align-items: center; }
.modal select {
  width: 100%; padding: 9px 10px; border-radius: 10px;
  background: rgba(11, 18, 32, .9); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; outline: 0;
}
.modal select:focus { border-color: var(--blue); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ===== toast ===== */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(14, 165, 233, .95); color: #06121f;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 30px rgba(2, 6, 23, .55);
  display: none;
}
.toast.show { display: block; animation: toast-in .18s ease; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== responsive ===== */
@media (max-width: 1024px) {
  .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .card { padding: 16px; }
  .login-animated-wrap { min-height: 480px; padding: 24px 10px; }
  .login-animated-ring { --ring-size: 360px; top: 82%; transform: translate(-50%, -50%); opacity: .35; }
  .login-animated-title { font-size: 30px; }
  .login-fields { padding: 0 12px; }
  .apps-empty { font-size: 13px; }
  .operator-summary { grid-template-columns: auto 1fr auto; }
  .op-preview { display: none; }
  .op-actions .btn-action { flex: 1 1 calc(50% - 4px); text-align: center; }
  .modal .row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .apps { grid-template-columns: 1fr; }
  .header { padding: 12px; }
  .page-title { font-size: 18px; }
}
