/*
  Kantor SMART Design System — Landak Monumental & SuperApp Standard
  Inspired by Kantor Bupati Landak (White Grand Pillars, Sweeping Canopy, Neon Night Accents)
  Gojek & Grab Class UI/UX: Squircle cards, bottom sheets, tactile feedback, floating summary bar.
*/

:root {
  /* Dark Theme Palette (Default) */
  --bg-primary: #0a0f18;
  --bg-surface: #111a28;
  --bg-card: #182335;
  --bg-elevated: #1e2c42;
  --border-subtle: #24354f;
  --border-focus: #38bdf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --color-green-primary: #10b981;
  --color-green-accent: #22c55e;
  --color-gold: #f59e0b;
  --color-gold-light: #fef3c7;
  --color-rose: #f43f5e;
  --color-blue: #0ea5e9;
  --color-purple: #8b5cf6;

  --pillar-color: #f1f5f9;
  --neon-glow: 0 0 15px rgba(56, 189, 248, 0.4);
  --shadow-card: 0 8px 24px -4px rgba(0, 0, 0, 0.3);
  --radius-squircle: 20px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --pillar-color: #e2e8f0;
  --neon-glow: 0 0 10px rgba(16, 185, 129, 0.2);
  --shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================================================
   1. Header Bar & Monumental Brand
   ========================================================================= */
.app-header {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border-subtle);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-crest {
  font-size: 32px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3f2b, #2e9e5b);
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(46, 158, 91, 0.3);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-green-accent);
  background: rgba(34, 197, 94, 0.1);
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-green-accent);
}

.pulse {
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.9); opacity: 1; }
}

/* =========================================================================
   2. SuperApp Floating Summary Bar ("GoPay / OVO" Pattern)
   ========================================================================= */
.quick-summary-container {
  max-width: 1280px;
  margin: -10px auto 20px auto;
  padding: 0 20px;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.summary-metric {
  display: flex;
  align-items: center;
  gap: 12px;
}

.metric-icon {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
}

.metric-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.metric-divider {
  width: 1px;
  height: 36px;
  background-color: var(--border-subtle);
}

/* =========================================================================
   3. Navigation Tabs
   ========================================================================= */
.tab-nav {
  display: flex;
  gap: 8px;
  max-width: 1280px;
  margin: 0 auto 20px auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.tab-btn.active {
  background: linear-gradient(135deg, #1e3f2b, #2e9e5b);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(46, 158, 91, 0.25);
}

/* =========================================================================
   4. Content Panes & Cards
   ========================================================================= */
.main-content {
  max-width: 1280px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.squircle {
  border-radius: var(--radius-squircle);
}

.squircle-top {
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .grid-2col {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   5. Monumental Isometric Virtual Office 2.5D
   ========================================================================= */
.section-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-left h2 {
  font-size: 22px;
  font-weight: 800;
}

.hero-left p {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 700px;
}

.legend-row {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 600;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.isometric-office-viewport {
  background: radial-gradient(circle at 50% 30%, #1e293b, #090d16);
  border: 2px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  margin-bottom: 24px;
}

.office-canopy-banner {
  background: linear-gradient(90deg, #1e3f2b, #0f172a, #1e3f2b);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #38bdf8;
}

.isometric-canvas-wrapper {
  width: 100%;
  height: auto;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.isometric-svg {
  width: 100%;
  height: auto;
  max-height: 600px;
  display: block;
}

.interactive-hint {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

/* Persona Node Styling in SVG */
.workstation-group {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.workstation-group:hover {
  filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.8));
}

.persona-avatar-circle {
  transition: r 0.2s ease;
}

.workstation-group:hover .persona-avatar-circle {
  r: 26;
}

/* =========================================================================
   6. Persona Cards Grid
   ========================================================================= */
.persona-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.persona-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-squircle);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}

.persona-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
}

.persona-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.persona-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
}

.persona-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.persona-role-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  display: inline-block;
  margin-top: 2px;
}

.persona-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
}

/* =========================================================================
   7. Tables & Forms
   ========================================================================= */
.table-container {
  overflow-x: auto;
}

.superapp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.superapp-table th {
  background: var(--bg-elevated);
  padding: 12px 16px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-subtle);
}

.superapp-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.superapp-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* =========================================================================
   8. Buttons & Tactile Interactivity
   ========================================================================= */
.tactile-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

.tactile-btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-block {
  width: 100%;
}

.icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-main);
}

/* =========================================================================
   9. Badges & Chips
   ========================================================================= */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
}

.badge-success { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.badge-warning { background: rgba(234, 179, 8, 0.2); color: #facc15; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.badge-info { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }

/* =========================================================================
   10. IoT & Rooms Grids
   ========================================================================= */
.iot-devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.iot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.iot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.iot-toggle-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

/* =========================================================================
   11. Financial ROI KPI Grid (Margareta)
   ========================================================================= */
.roi-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

.roi-metric-tile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
}

.tile-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  display: block;
}

.tile-val {
  font-size: 20px;
  font-weight: 800;
  margin-top: 4px;
  display: block;
}

.text-green { color: #22c55e; }
.text-gold { color: #f59e0b; }

.roi-summary-note {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-main);
}

/* =========================================================================
   12. Bottom Sheet Drawer (Mobile / Touch Standard)
   ========================================================================= */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet-backdrop.open {
  display: flex;
}

.bottom-sheet-drawer {
  background: var(--bg-surface);
  width: 100%;
  max-width: 540px;
  border-top: 2px solid var(--border-focus);
  padding: 16px 24px 32px 24px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.bottom-sheet-handle {
  width: 48px;
  height: 5px;
  background: var(--border-subtle);
  border-radius: 9999px;
  margin: 0 auto 16px auto;
}

/* =========================================================================
   13. Toast Notification
   ========================================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: slideToast 0.25s ease-out;
}

@keyframes slideToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================================
   14. Workflows Action Bar & Result Box
   ========================================================================= */
.workflow-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.wf-result-box {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 18px;
  font-family: monospace;
  font-size: 13px;
  color: #38bdf8;
  max-height: 280px;
  overflow-y: auto;
}

.wf-placeholder {
  color: #64748b;
  font-style: italic;
}
