/* CiiSTRA Sync preview styles. Trace IDs are documented in docs/CODE_MAP.md. */

/* =========================================
   1. GLOBAL SETTINGS [UI-BASE]
========================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #030504;
  --text: #F2F7F9;
  --muted: #A3B2B1;
  --teal: #4EC2C5;
  --lime: #DCFF78;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.12);
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
}

/* =========================================
   2. FIXED AMBIENT BACKGROUND [UI-BACKGROUND]
========================================= */

.ambient-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  z-index: 0;
  background: #030504;
  pointer-events: none;
}

.glow-teal {
  position: absolute;
  width: 58vw;
  height: 72vh;
  top: -42%;
  left: -24%;
  border-radius: 50%;

  background: radial-gradient(
    ellipse at center,
    rgba(78, 194, 197, 0.96) 0%,
    rgba(39, 139, 141, 0.76) 22%,
    rgba(16, 75, 73, 0.42) 43%,
    rgba(7, 32, 30, 0.15) 61%,
    transparent 74%
  );

  filter: blur(48px);
}

.glow-green {
  position: absolute;
  width: 68vw;
  height: 85vh;
  right: -24%;
  bottom: -48%;
  border-radius: 50%;

  background: radial-gradient(
    ellipse at center,
    rgba(248, 255, 207, 1) 0%,
    rgba(220, 255, 120, 0.98) 13%,
    rgba(157, 229, 68, 0.78) 27%,
    rgba(80, 143, 45, 0.42) 44%,
    rgba(24, 55, 26, 0.12) 60%,
    transparent 75%
  );

  filter: blur(48px);
}

.center-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse 43% 43% at 50% 50%,
    #030504 0%,
    #030504 38%,
    rgba(3, 5, 4, 0.98) 53%,
    rgba(3, 5, 4, 0.88) 66%,
    rgba(3, 5, 4, 0.42) 82%,
    transparent 100%
  );
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.035;

  background-image: url("../assets/images/noise.svg");
}

/* =========================================
   3. WORKSPACE APP SHELL [UI-SHELL]
========================================= */

.app-shell {
  position: relative;
  z-index: 1;

  min-height: 100vh;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

/* =========================================
   4. LIQUID GLASS FOUNDATION [UI-GLASS]
========================================= */

.glass {
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.075),
      rgba(255, 255, 255, 0.018) 55%,
      rgba(255, 255, 255, 0.035)
    );

  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(255, 255, 255, 0.025),
    0 18px 55px rgba(0, 0, 0, 0.20);

  -webkit-backdrop-filter: blur(24px) saturate(135%);
  backdrop-filter: blur(24px) saturate(135%);
}

.glass-panel {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;

  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.055),
    transparent 28%,
    transparent 70%,
    rgba(255, 255, 255, 0.025)
  );
}

.glass-panel > * {
  position: relative;
}

/* =========================================
   5. SIDEBAR [UI-SIDEBAR]
========================================= */

.sidebar {
  height: calc(100vh - 36px);
  min-height: 650px;
  position: sticky;
  top: 18px;

  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  border-radius: 24px;
}

/* UI-SIDEBAR: the ambient background is already blurred. Avoid a second
   backdrop capture on this tall sticky surface, which can show repaint seams
   when nearby controls animate. Paint its reflection in the same background. */
.sidebar.glass {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background:
    linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.055),
      transparent 28%,
      transparent 70%,
      rgba(255, 255, 255, 0.025)
    ),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.075),
      rgba(255, 255, 255, 0.018) 55%,
      rgba(255, 255, 255, 0.035)
    );
}

.sidebar.glass-panel::before {
  content: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 28px;
}

.brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 13px;

  display: grid;
  place-items: center;

  color: #E8FFB5;
  font-size: 22px;
  font-weight: 500;

  background: linear-gradient(
    135deg,
    rgba(78, 194, 197, 0.22),
    rgba(220, 255, 120, 0.13)
  );

  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.brand-name {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.5px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
  letter-spacing: 1.6px;
}

.nav-label {
  color: #758783;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  padding: 8px 12px 12px;
}

.navigation {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;

  text-align: left;
  color: #AAB9B7;
  font-size: 13px;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: #FFFFFF;
}

.nav-item.active {
  color: #F3FFFF;
  background: linear-gradient(
    110deg,
    rgba(78, 194, 197, 0.15),
    rgba(255, 255, 255, 0.035)
  );

  border-color: rgba(78, 194, 197, 0.19);
  box-shadow: inset 2px 0 0 rgba(78, 194, 197, 0.9);
}

.nav-icon {
  width: 19px;
  text-align: center;
  font-size: 16px;
  opacity: 0.95;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 24px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 9px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;

  background: linear-gradient(
    135deg,
    rgba(78, 194, 197, 0.4),
    rgba(220, 255, 120, 0.24)
  );

  border: 1px solid rgba(255, 255, 255, 0.19);
  font-size: 12px;
}

.profile-name {
  font-size: 12px;
  font-weight: 600;
}

.profile-caption {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

/* =========================================
   6. MAIN WORKSPACE [UI-WORKSPACE]
========================================= */

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* =========================================
   7. TOP BAR [UI-TOPBAR]
========================================= */

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 23px;
  border-radius: 21px;
}

.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 7px;
}

.breadcrumb span {
  color: var(--teal);
}

.page-title {
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 550;
  letter-spacing: -0.7px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 9px 12px;
  border-radius: 50px;

  font-size: 11px;
  color: #D5E6DE;

  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.035);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #B8EF78;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(184, 239, 120, 0.7);
}

.icon-button {
  width: 39px;
  height: 39px;
  border-radius: 13px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: #EAF4F2;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.11);
}

/* =========================================
   8. WELCOME AREA [UI-WELCOME]
========================================= */

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  padding: 12px 4px 2px;
}

.eyebrow {
  color: #8EB8B4;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 11px;
}

.welcome h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: -1px;
}

.welcome p {
  color: #9EADAA;
  margin-top: 9px;
  font-size: 12px;
  line-height: 1.7;
}

.primary-button {
  border: 1px solid rgba(220, 255, 120, 0.30);
  border-radius: 13px;
  padding: 12px 16px;

  background: linear-gradient(
    135deg,
    rgba(220, 255, 120, 0.19),
    rgba(78, 194, 197, 0.12)
  );

  color: #F0FFD4;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: 180ms ease;
}

.primary-button:hover {
  background: rgba(220, 255, 120, 0.24);
}

/* =========================================
   9. STATISTIC CARDS [UI-STATS]
========================================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 19px;
  min-height: 135px;
  border-radius: 19px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stat-label {
  font-size: 11px;
  color: #AABAB6;
}

.stat-icon {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #DDF9B0;
  background: rgba(220, 255, 120, 0.09);
  border: 1px solid rgba(220, 255, 120, 0.12);
}

.stat-value {
  font-size: clamp(23px, 2.4vw, 31px);
  margin-top: 18px;
  font-weight: 550;
  letter-spacing: -1px;
}

.stat-note {
  margin-top: 8px;
  color: #91A59D;
  font-size: 10px;
}

.stat-note strong {
  color: #C9F59B;
  font-weight: 500;
}

/* =========================================
   10. MAIN CONTENT GRID [UI-CONTENT]
========================================= */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(270px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.panel {
  padding: 22px;
  border-radius: 22px;
  min-width: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 23px;
}

.panel-title {
  font-size: 14px;
  font-weight: 550;
}

.panel-subtitle {
  font-size: 10px;
  color: #91A39E;
  margin-top: 6px;
}

.text-button {
  background: transparent;
  border: none;
  color: #C2E8DC;
  font-size: 11px;
  cursor: pointer;
}

/* =========================================
   11. ACTIVITY CHART [UI-ACTIVITY]
========================================= */

.chart-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
}

.chart-total {
  font-size: 30px;
  font-weight: 550;
  letter-spacing: -1px;
}

.chart-caption {
  color: #9AABA6;
  font-size: 10px;
  margin-top: 6px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9FAFA9;
  font-size: 10px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.legend-dot.green {
  background: var(--lime);
}

.chart {
  height: 185px;
  display: flex;
  align-items: flex-end;
  gap: clamp(7px, 1.5vw, 16px);
  padding: 12px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);

  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 44px,
    rgba(255, 255, 255, 0.055) 45px,
    transparent 46px
  );
}

.chart-column {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.bar-pair {
  width: 100%;
  max-width: 35px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.bar {
  flex: 1;
  max-width: 15px;
  border-radius: 6px 6px 2px 2px;
  min-height: 8px;
}

.bar.teal {
  background: linear-gradient(
    to top,
    rgba(49, 149, 151, 0.30),
    rgba(78, 194, 197, 0.92)
  );
  box-shadow: 0 0 14px rgba(78, 194, 197, 0.10);
}

.bar.lime {
  background: linear-gradient(
    to top,
    rgba(109, 153, 62, 0.30),
    rgba(220, 255, 120, 0.86)
  );
}

.chart-day {
  color: #81938E;
  font-size: 9px;
  padding-bottom: 10px;
}

/* UI-ACTIVITY: original preview bar heights, moved from HTML style attributes. */
.chart-column--monday .bar.teal {
  height: 48%;
}

.chart-column--monday .bar.lime {
  height: 28%;
}

.chart-column--tuesday .bar.teal {
  height: 70%;
}

.chart-column--tuesday .bar.lime {
  height: 44%;
}

.chart-column--wednesday .bar.teal {
  height: 56%;
}

.chart-column--wednesday .bar.lime {
  height: 36%;
}

.chart-column--thursday .bar.teal {
  height: 86%;
}

.chart-column--thursday .bar.lime {
  height: 62%;
}

.chart-column--friday .bar.teal {
  height: 65%;
}

.chart-column--friday .bar.lime {
  height: 43%;
}

.chart-column--saturday .bar.teal {
  height: 94%;
}

.chart-column--saturday .bar.lime {
  height: 69%;
}

.chart-column--sunday .bar.teal {
  height: 52%;
}

.chart-column--sunday .bar.lime {
  height: 33%;
}

/* =========================================
   12. RIGHT SIDE WORKSPACE [UI-PROGRESS]
========================================= */

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-panel {
  flex: 1;
}

.progress-ring {
  width: 140px;
  height: 140px;
  margin: 15px auto 20px;
  border-radius: 50%;

  display: grid;
  place-items: center;

  background: conic-gradient(
    from -90deg,
    #A8E7B0 0deg,
    #6ABFBA 230deg,
    rgba(255, 255, 255, 0.09) 230deg,
    rgba(255, 255, 255, 0.09) 360deg
  );

  box-shadow: 0 0 35px rgba(78, 194, 197, 0.08);
  position: relative;
}

.progress-ring::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #0A1210;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.progress-inner {
  z-index: 1;
  text-align: center;
}

.progress-value {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -1px;
}

.progress-caption {
  margin-top: 5px;
  color: #94A9A1;
  font-size: 10px;
}

.progress-description {
  text-align: center;
  color: #A6B7B0;
  font-size: 11px;
  line-height: 1.7;
}

/* =========================================
   13. TASK LIST [UI-TASKS]
========================================= */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.task {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
}

.task:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.task-check {
  width: 19px;
  height: 19px;
  flex-shrink: 0;

  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;

  display: grid;
  place-items: center;
  font-size: 12px;
  color: #DFFF9A;
}

.task-check.done {
  border-color: rgba(220, 255, 120, 0.35);
  background: rgba(220, 255, 120, 0.13);
}

.task-name {
  font-size: 11px;
  color: #E0EAE6;
}

.task-time {
  font-size: 9px;
  color: #84968F;
  margin-top: 5px;
}

.task-status {
  margin-left: auto;
  color: #C4E6A2;
  font-size: 9px;
  white-space: nowrap;
}

/* =========================================
   14. BOTTOM STATUS STRIP [UI-FOOTER]
========================================= */

.bottom-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 19px;
  border-radius: 17px;
}

.bottom-label {
  color: #91A49D;
  font-size: 10px;
}

.bottom-value {
  color: #E3EEE8;
  font-size: 11px;
  margin-top: 6px;
}

.bottom-accent {
  color: #DDF9B0;
}

/* =========================================
   15. LIGHT AND DARK CONTENT THEME [UI-THEME]
========================================= */

body.light-mode {
  --text: #12201E;
  --muted: #647570;
  color: var(--text);
}

body.light-mode .ambient-bg {
  opacity: 0.12;
}

body.light-mode .glass {
  background: rgba(245, 250, 248, 0.78);
  border-color: rgba(20, 50, 44, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 45px rgba(0, 0, 0, 0.06);
}

body.light-mode .brand-name,
body.light-mode .page-title,
body.light-mode .welcome h2,
body.light-mode .panel-title,
body.light-mode .stat-value,
body.light-mode .chart-total,
body.light-mode .task-name {
  color: #152622;
}

body.light-mode .nav-item {
  color: #52655F;
}

body.light-mode .nav-item.active {
  color: #123C3A;
  background: rgba(78, 194, 197, 0.14);
}

body.light-mode .stat-label,
body.light-mode .panel-subtitle,
body.light-mode .chart-caption,
body.light-mode .legend-item,
body.light-mode .chart-day,
body.light-mode .profile-caption,
body.light-mode .task-time,
body.light-mode .bottom-label {
  color: #647770;
}

body.light-mode .bottom-value {
  color: #233E35;
}

body.light-mode .progress-ring::before {
  background: #EDF4EF;
}

body.light-mode .progress-value {
  color: #183B32;
}

body.light-mode .progress-caption,
body.light-mode .progress-description {
  color: #60766D;
}

/* =========================================
   16. RESPONSIVE LAYOUT [UI-RESPONSIVE]
========================================= */

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .sidebar {
    top: 14px;
    height: calc(100vh - 28px);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(230px, 0.85fr);
  }

  .stat-card {
    min-height: 120px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 13px;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    padding: 15px;
    border-radius: 19px;
  }

  .brand {
    padding-bottom: 14px;
  }

  .nav-label {
    padding-top: 10px;
  }

  .navigation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 10px 5px;
    text-align: center;
    font-size: 10px;
  }

  .nav-icon {
    font-size: 17px;
  }

  .sidebar-bottom {
    margin-top: 14px;
    padding-top: 10px;
  }

  .profile {
    padding-top: 10px;
  }

  .workspace {
    gap: 13px;
  }

  .topbar {
    padding: 15px;
  }

  .status-pill {
    display: none;
  }

  .welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 15px;
    min-height: 120px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .panel {
    padding: 17px;
  }

  .progress-ring {
    width: 112px;
    height: 112px;
  }

  .progress-value {
    font-size: 24px;
  }

  .bottom-strip {
    flex-wrap: wrap;
  }
}

@media (max-width: 430px) {
  .right-column {
    grid-template-columns: 1fr;
  }

  .chart {
    gap: 5px;
  }

  .chart-day {
    font-size: 8px;
  }

  .chart-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
