/* Life OS Universal Common Styles */
:root {
  --bg-main: #f7f5f0;
  --bg-card: #ffffff;
  --bg-card-elevated: #faf9f6;
  --bg-subcard: #fcfbf8;
  --bg-input: #ffffff;
  --border-subtle: #e7e2d8;
  --border-highlight: #cfc7b8;
  --text-primary: #2d3436;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --accent-emerald: #2f9e77;
  --accent-emerald-soft: rgba(47, 158, 119, 0.10);
  --accent-amber: #d98a1c;
  --accent-amber-soft: rgba(217, 138, 28, 0.10);
  --accent-indigo: #6c7ae0;
  --accent-indigo-soft: rgba(108, 122, 224, 0.10);
  --accent-rose: #e05d6f;
  --accent-rose-soft: rgba(224, 93, 111, 0.10);
  --radius-lg: 16px;
  --radius-md: 11px;
  --radius-sm: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(167, 216, 196, 0.35), transparent 35%),
    radial-gradient(circle at 92% 6%, rgba(196, 204, 245, 0.35), transparent 38%),
    radial-gradient(circle at 50% 100%, rgba(250, 221, 190, 0.30), transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.48;
  padding: 0;
  margin: 0;
}

/* Main Application Shell - Split View Layout for Pixel Fold & Desktop */
.app-shell.app-layout-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  padding: 8px 10px;
  gap: 10px;
  box-sizing: border-box;
  overflow: hidden;
}


/* =========================================================================
   1. MAIN VIEWPORT & TAB CONTENT STAGE
   ========================================================================= */
.main-viewport {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.active-tab-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.active-tab-headline h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.topbar-sep {
  color: var(--border-highlight);
  font-size: 0.85rem;
}

.topbar-subtitle {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.btn-toggle-hl {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-elevated);
  cursor: pointer;
  color: var(--text-secondary);
}
.btn-toggle-hl:hover {
  background: #ffffff;
  color: var(--text-primary);
}

#btn-install-pwa {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(47, 158, 119, 0.45);
  background: var(--accent-emerald-soft);
  cursor: pointer;
  color: var(--accent-emerald);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
#btn-install-pwa:hover {
  background: rgba(47, 158, 119, 0.22);
}
#btn-install-pwa.hidden {
  display: none !important;
}

.tab-content-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-right: 2px;
}

/* Custom Scrollbar for sleek Pixel Fold & desktop feel */
.tab-content-stage::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.tab-content-stage::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.tab-content-stage::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(100, 100, 100, 0.18);
  border-radius: 999px;
}
.tab-content-stage::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 100, 100, 0.35);
}

/* Tab Panels */
.tab-panel {
  display: none !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tab-panel.active {
  display: flex !important;
  flex-direction: column;
  min-height: min-content;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tab-panel.panel-card,
.tab-panel.time-logger-card,
.tab-panel.planner-master-card {
  margin-bottom: 0;
}

/* Top Title Bar with Multi-Level Highlights */
.topbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: 0 4px 18px rgba(80, 70, 50, 0.05);
  flex-shrink: 0;
}

.topbar-upper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(47, 158, 119, 0.25);
}

.brand-group h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-led-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 1px;
}

.status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 6px rgba(47, 158, 119, 0.5);
}

.sys-code {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
  color: var(--accent-emerald);
  font-weight: 600;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-workout {
  background: var(--accent-amber-soft);
  border: 1px solid rgba(217, 138, 28, 0.35);
  color: #b8710f;
  padding: 6px 12px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.btn-workout:hover {
  background: rgba(217, 138, 28, 0.18);
}

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

.hl-level-card {
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hl-level-card:hover {
  border-color: var(--accent-indigo);
}

.hl-level-card.active {
  border-color: var(--accent-indigo);
  background: linear-gradient(135deg, rgba(108, 122, 224, 0.08), rgba(47, 158, 119, 0.05));
}

.hl-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.hl-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-indigo);
  letter-spacing: 0.04em;
}

.hl-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.hl-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.hl-metrics-row strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.accent-amber, .text-amber { color: #c27a12 !important; }
.accent-emerald, .text-emerald { color: #2f9e77 !important; }
.accent-indigo, .text-indigo { color: #5866c9 !important; }

.gdrive-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gdrive-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.gdrive-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3b7dd8;
}

.gdrive-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.toast-banner {
  background: #e9f6f0;
  border: 1px solid var(--accent-emerald);
  color: #1f5f4a;
  padding: 9px 15px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 0.84rem;
}

.toast-banner.warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: var(--accent-amber);
  color: #7a4b07;
}

.hidden {
  display: none !important;
}

/* Common Buttons & Forms */
.add-claim-form {
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

button {
  font-family: var(--font-sans);
  cursor: pointer;
}

.btn-primary {
  background: var(--accent-emerald);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.btn-accent {
  background: var(--accent-indigo);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.81rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #3b7dd8;
  color: #3b7dd8;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-sm,
.btn-xs {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.btn-xs {
  padding: 3px 8px;
  font-size: 0.68rem;
}

.btn-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 4px;
}

.btn-del:hover {
  color: var(--accent-rose);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #ef4444;
  padding: 6px 14px;
  border-radius: var(--radius-sm, 7px);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #dc2626;
  transform: translateY(-1px);
}


