/* ---------------------------------
   Reset & Box‑Sizing
   --------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ---------------------------------
   Body
   --------------------------------- */
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: #f4f6f8;
  color: #333;
  line-height: 1.6;
  overflow: hidden;              /* main scrolling is inside the center column */
}

/* ---------------------------------
   Header
   --------------------------------- */
.header {
  background: #2196F3;
  color: #fff;
  padding: 1rem 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ---------------------------------
   Layout: 3‑col Flex
   --------------------------------- */
.page-wrapper {
  display: flex;
  height: calc(100vh - 60px);   /* full viewport minus header */
  margin: 0;
  padding: 0;
}

/* ---------------------------------
   Sidebar
   --------------------------------- */
.sidebar {
  width: 280px;
  background: #f8f9fa;
  border-right: 1px solid #ddd;
  padding: 1rem;
  overflow-y: auto;
  margin: 0;                     /* flush to edges */
}

/* ---------------------------------
   Center Column
   --------------------------------- */
.main-center {
  flex: 1;                       /* take remaining width */
  display: flex;
  justify-content: center;      /* horizontally center wrapper */
  align-items: flex-start;      /* stack content top-down */
  overflow-y: auto;
}

.center-wrapper {
  width: 100%;
  max-width: 960px;
  padding: 1.5rem;
}

/* ---------------------------------
   Cards (unchanged)
   --------------------------------- */
.card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
}
.card h3 { font-size: 1.1rem; margin-bottom: .5rem; }
.card p { margin: .3rem 0; font-size: .95rem; }
.card ul { list-style: disc inside; font-size: .95rem; }
.card button {
  display: block;
  width: 100%;
  padding: .5rem;
  font-size: .95rem;
  background: #2196F3;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  margin-top: .5rem;
}
.card button:hover { background: #1976D2; }

/* ---------------------------------
   Controls
   --------------------------------- */
.controls {
  text-align: center;
  margin-bottom: 2rem;
}
.analog-clock {
  width: 160px; height: 160px;
  margin: 0 auto 1rem;
  position: relative;
}
.clock-face {
  width: 100%; height: 100%;
  background: url('/static/img/clock-bg.png') no-repeat center/contain;
  border-radius: 50%;
  position: relative; overflow: hidden;
}
.hand {
  position: absolute; left: 50%; top: 50%;
  transform-origin: 0% 50%; transition: transform .05s ease-in-out;
}
.hour-hand { width: 35%; height: 6px; background: #333; }
.min-hand  { width: 45%; height: 4px; background: #333; }
.second-hand { width: 48%; height: 2px; background: #e74c3c; }

.btn {
  background: #2196F3; color: #fff;
  border: none; border-radius: 4px;
  padding: .75rem 1.5rem; font-size: 1rem;
  cursor: pointer; transition: background .3s;
}
.btn:disabled { background: #9e9e9e; cursor: not-allowed; }
.btn:hover:not(:disabled) { background: #1976D2; }

.summary { margin: 1rem 0; font-weight: bold; }
.goal-met { margin-top: .5rem; color: #388E3C; font-weight: bold; }

/* ---------------------------------
   Progress Bar
   --------------------------------- */
.progress-container {
  width: 100%; max-width: 600px;
  height: 1rem; background: #e0e0e0;
  border-radius: 4px; margin: .5rem auto 2rem;
  overflow: hidden;
}
.progress-bar { height: 100%; transition: width .3s; }

/* ---------------------------------
   Chart (fluid aspect ratio)
   --------------------------------- */
.chart-container {
  position: relative;
  width: 100%;
  /* 2:1 aspect ratio → padding-bottom = 50% */
  padding-bottom: 50%;
  margin-bottom: 2rem;
}
.chart-container canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%  !important;
  height: 100% !important;
}

/* ---------------------------------
   Table
   --------------------------------- */
.table-container { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse;
  margin-bottom: 2rem; table-layout: auto;
}
.data-table th, .data-table td {
  padding: .75rem; text-align: center;
  border: 1px solid #ddd;
}
.data-table th {
  background: #2196F3; color: #fff;
}
.data-table tr:nth-child(even) { background: #fafafa; }

/* ---------------------------------
   Responsive Breakpoints
   --------------------------------- */
@media (max-width: 1024px) {
  .sidebar { width: 240px; }
}

@media (max-width: 768px) {
  .page-wrapper { flex-direction: column; }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
  .main-center, .center-wrapper {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 600px) {
  .btn { width: 100%; padding: .75rem; }
}

