/* VARIABLES */

:root {
  --accent: #4da3ff;
  --danger: #d9534f;

  --bg-main: #000000;
  --bg-card: #111111;

  --text-main: #ffffff;
  --text-muted: #888888;

  --border-subtle: rgba(255,255,255,0.08);
}



/* PAGE LAYOUT */

.page {
  padding-top: calc(56px + env(safe-area-inset-top));
  padding-bottom: calc(60px + env(safe-area-inset-bottom));
  color: var(--text-main);
}



/* HEADER / NAV IOS */

.nav-ios {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(10, 10, 10, 0.96);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
}

.nav-left,
.nav-center,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-left {
  flex: 0 0 auto;
}

.nav-center {
  flex: 1 1 auto;
  flex-direction: column;
  text-align: center;
  overflow: hidden;
}

.nav-right {
  flex: 0 0 auto;
  justify-content: flex-end;
}

#focus-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 14px;
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-open-btn {
  border: none;
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}



/* TABBAR IOS */

.tabbar-ios {
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  left: 0;
  right: 0;
  height: 60px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: rgba(10, 10, 10, 0.96);
  border-top: 1px solid var(--border-subtle);
  z-index: 1000;
}

.tabbar-ios button {
  flex: 1 1 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tabbar-ios button.active {
  color: var(--accent);
}



/* FOCUSBAR */

.focusbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
}

.focusbar-inner {
  display: flex;
  gap: 8px;
}

.focus-pill {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  white-space: nowrap;
}

.focus-pill.active {
  border-color: var(--accent);
  color: var(--accent);
}



/* CARDS */

.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
}

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

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-item {
  background: #101010;
  border-radius: 12px;
  padding: 8px;
  font-size: 12px;
}



/* QUICK ACTIONS */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.quick-action {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  border: 1px solid var(--border-subtle);
}



/* BUTTONS */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: var(--danger);
  color: #ffffff;
  font-size: 13px;
}



/* MODULE GRID (v4) */

.module-container {
  padding: 16px;
}

.module-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
}

.module-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.module-item {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

.module-item-icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.module-item-title {
  font-size: 13px;
  color: var(--text-muted);
}

.module-item-value {
  font-size: 16px;
  margin-top: 4px;
  font-weight: 600;
  color: var(--text-main);
}



/* MODULE ERROR */

.module-error {
  background: #330000;
  color: #ffcccc;
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}



/* ISLAND */

#island {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2000;
}

#island.show {
  opacity: 1;
}
