
/* =========================================================
   1. DESIGN TOKENS (already defined in :root)
   ========================================================= */
:root {
  --button-outline: rgba(0,0,0, .10);
  --badge-outline: rgba(0,0,0, .05);

  --opaque-button-border-intensity: -8;

  --elevate-1: rgba(0,0,0, .03);
  --elevate-2: rgba(0,0,0, .08);

  --background: 210 20% 97%;
  --foreground: 222 47% 13%;
  --border: 214 20% 87%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 13%;
  --card-border: 214 20% 90%;
  --sidebar: 210 20% 95%;
  --sidebar-foreground: 222 47% 13%;
  --sidebar-border: 214 20% 87%;
  --sidebar-primary: 199 80% 44%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 210 30% 90%;
  --sidebar-accent-foreground: 222 47% 13%;
  --sidebar-ring: 199 80% 44%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 13%;
  --popover-border: 214 20% 87%;
  --primary: 199 80% 44%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 30% 93%;
  --secondary-foreground: 222 47% 13%;
  --muted: 210 20% 93%;
  --muted-foreground: 215 20% 50%;
  --accent: 199 60% 90%;
  --accent-foreground: 199 80% 28%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --input: 214 20% 82%;
  --ring: 199 80% 44%;
  --chart-1: 199 80% 44%;
  --chart-2: 160 60% 40%;
  --chart-3: 30 80% 55%;
  --chart-4: 280 65% 60%;
  --chart-5: 340 75% 55%;

  --font-sans: 'Inter', sans-serif;
  --font-serif: Georgia, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: .5rem;
  --shadow-2xs: 0px 1px 2px 0px rgba(0,0,0,0.04);
  --shadow-xs: 0px 1px 3px 0px rgba(0,0,0,0.06);
  --shadow-sm: 0px 1px 4px 0px rgba(0,0,0,0.07), 0px 1px 2px -1px rgba(0,0,0,0.04);
  --shadow: 0px 2px 6px 0px rgba(0,0,0,0.08), 0px 1px 2px -1px rgba(0,0,0,0.04);
  --shadow-md: 0px 4px 10px 0px rgba(0,0,0,0.09), 0px 2px 4px -1px rgba(0,0,0,0.05);
  --shadow-lg: 0px 8px 16px 0px rgba(0,0,0,0.09), 0px 4px 6px -1px rgba(0,0,0,0.05);
  --shadow-xl: 0px 16px 24px 0px rgba(0,0,0,0.10), 0px 8px 10px -1px rgba(0,0,0,0.05);
  --shadow-2xl: 0px 24px 40px 0px rgba(0,0,0,0.12);
  --tracking-normal: 0em;
  --spacing: 0.25rem;

  --sidebar-primary-border: hsl(var(--sidebar-primary));
  --sidebar-primary-border: hsl(from hsl(var(--sidebar-primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --sidebar-accent-border: hsl(var(--sidebar-accent));
  --sidebar-accent-border: hsl(from hsl(var(--sidebar-accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --primary-border: hsl(var(--primary));
  --primary-border: hsl(from hsl(var(--primary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --secondary-border: hsl(var(--secondary));
  --secondary-border: hsl(from hsl(var(--secondary)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --muted-border: hsl(var(--muted));
  --muted-border: hsl(from hsl(var(--muted)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --accent-border: hsl(var(--accent));
  --accent-border: hsl(from hsl(var(--accent)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
  --destructive-border: hsl(var(--destructive));
  --destructive-border: hsl(from hsl(var(--destructive)) h s calc(l + var(--opaque-button-border-intensity)) / alpha);
}

/* =========================================================
   2. BASE / RESET
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* =========================================================
   3. PAGE LAYOUT
   ========================================================= */

main {
  max-width: 80rem;
  margin-inline: auto;
  padding: 1.5rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;

  background: hsl(var(--card) / 0.95);
  backdrop-filter: blur(6px);

  border-bottom: 1px solid hsl(var(--card-border));
  box-shadow: var(--shadow-sm);
}


/* =========================================================
   4. TYPOGRAPHY
   ========================================================= */

/* Numeric displays (clock, times, due times) */
.numeric-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
}

/* Section titles (Subjects, Add Timepoint, Timesheet, etc.) */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

.helper-text {
  margin-top: 0.25rem;          /* equivalent to mt-1 */
  font-size: 0.75rem;           /* text-xs */
  color: hsl(var(--muted-foreground));
  line-height: 1.3;
}

.helper-text--error {
  color: hsl(var(--destructive));
}

.helper-text--success {
  color: hsl(140 60% 40%);
}

/* =========================================================
   5. SURFACES (Cards, Panels)
   ========================================================= */

.card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--card-border));
  border-radius: 0.8rem;
  box-shadow: var(--shadow-sm);
  padding: 0.5rem;
}

.card-header {
  padding: 1rem 1rem 0.75rem 1rem;
  margin: 0;
}

.card-content {
  padding: 0rem 1rem 1rem 1rem;
}


/* =========================================================
   6. CONTROLS (Buttons, Inputs, Labels)
   ========================================================= */

/* Labels */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Inputs */
input {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;

  font-size: 0.875rem;
  font-family: inherit;

  background: hsl(var(--background));
  color: hsl(var(--foreground));

  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
}

input::placeholder {
  color: hsl(var(--muted-foreground));
}

input:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px hsl(var(--background)),
    0 0 0 4px hsl(var(--ring));
}

input[aria-invalid="true"],
input.invalid {
  border-color: hsl(var(--destructive));
}


/* Buttons (base) */
button {
  height: 2.25rem;
  padding: 0 0.75rem;

  font-size: 0.875rem;
  font-weight: 500;

  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));

  background: hsl(var(--background));
  color: hsl(var(--foreground));

  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button variants */
.button-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary-border));
}

.button-secondary {
  height: 2.25rem;
  padding: 0 0.75rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;

  font-size: 0.875rem;
  font-weight: 500;

  cursor: pointer;
  user-select: none;

  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* optional hover (only when not selected) */
.button-secondary:hover {
  background: hsl(var(--muted)/0.4);
}

/*.button-outline {
  background: hsl(var(--destructive-foreground));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--secondary-foreground));
}*/

.button-ghost {
  background: transparent;
  border-color: transparent;
  color: hsl(var(--muted-foreground));
}

.button-ghost:hover {
  background: hsl(var(--muted)/0.4);
  color: hsl(var(--foreground));
}

.button-sm {
  height: 1.75rem;
  font-size: 0.75rem;
  padding: 0 0.5rem;
}

.button-md {
  height: 2rem;
  font-size: 0.9rem;
  padding: 0 0.5rem;
}

.button-icon {
  width: 3rem;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button-with-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.375rem; /* ~ mr-1.5 */
}

.button-with-icon-sm {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  height: 1.75rem;
  font-size: 0.75rem;
  padding: 0 0.5rem;
  gap: 0.3rem; /* ~ mr-1.5 */
  margin-bottom: 0.25rem
}


/* =========================================================
   7. TABLE (Timesheet)
   ========================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.875rem;
}

th {
  text-align: left;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.4);
}

th,
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--card-border));
}

.startTimetd {
  display: flex;
  gap: 0.75rem;
}

tbody tr:nth-child(even) {
  background: hsl(var(--muted) / 0.15);
}

.numeric-cell {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   8. ALERT STATES (Timepoints)
   ========================================================= */

/* Cell backgrounds */
.tp-soon {
  background: hsl(45 100% 92%);
}

.tp-due {
  background: hsl(30 100% 92%);
}

.tp-overdue {
  background: hsl(0 100% 94%);
}

.tp-done {
  background: hsl(140 60% 94%);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;

  font-size: 0.75rem;
  font-weight: 500;

  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
}


/* =========================================================
   9. TOOLTIP
   ========================================================= */

.tooltip {
  background: hsl(var(--foreground));
  color: hsl(var(--background));

  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;

  border-radius: 0.375rem;
  box-shadow: var(--shadow-md);
}

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
}

/* =========================================================
   10. DIALOG / MODAL
   ========================================================= */

.dialog {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-xl);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 100;
}

/* =========================================================
   11. HEADER LAYOUT (missing structure)
   ========================================================= */

.header-inner {
  max-width: 80rem;
  margin-inline: auto;
  padding: 0.5rem 1.5rem;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.clock-display {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.375rem 1rem; /* ≈ px-4 py-1.5 */
  border-radius: 0.5rem;

  background: hsl(var(--muted) / 0.7);
}

.clock-icon {
  width: 1rem;
  height: 1rem;

  color: hsl(var(--muted-foreground));
  opacity: 0.8;

  flex-shrink: 0;
}


/* =========================================================
   12. SECTION LAYOUT
   ========================================================= */

.section {
  margin-bottom: 1rem;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.section > .section-title {
  margin-bottom: 0.75rem;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-right: 1rem;
  gap: 0.75rem;
  flex-wrap: nowrap;
}


/* =========================================================
   13. CARD LAYOUT HELPERS
   ========================================================= */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 2rem; /* equivalent to py-8 */

  color: hsl(var(--muted-foreground));
  text-align: center;
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 2.5rem;
  height: 2.5rem;

  margin-bottom: 0.75rem;

  font-size: 2rem;        /* for emoji or icon fonts */
  opacity: 0.3;           /* muted / non-distracting */
}


/* =========================================================
   14. CONTROL ROWS (form rows)
   ========================================================= */

.control-row {
  display: flex;
  min-height: 3.5rem;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.control-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-col--grow {
  flex-grow: 1;
}

.control-row > button {
  flex-shrink: 0;      /* buttons stay on the same row */
}

/* =========================================================
   15. SEGMENTED RADIO BUTTONS (min / hr)
   ========================================================= */

.unit-buttons {
  display: inline-flex;
  gap: 0.3rem;              /* makes them separate buttons */
  align-items: center;
}

/* hide the real radio circle */
.unit-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* the "button" look */
.unit-btn {
  height: 2.25rem;
  padding: 0 0.75rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));

  background: hsl(var(--background));
  color: hsl(var(--foreground));

  font-size: 0.875rem;
  font-weight: 500;

  cursor: pointer;
  user-select: none;

  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

/* selected state */
.unit-btn:has(input:checked) {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary-border));
}

/* focus ring (keyboard navigation) */
.unit-btn:has(input:focus-visible) {
  box-shadow:
    0 0 0 2px hsl(var(--background)),
    0 0 0 4px hsl(var(--ring));
}

/* optional hover (only when not selected) */
.unit-btn:hover {
  background: hsl(var(--muted));
}
.unit-btn:has(input:checked):hover {
  background: hsl(var(--primary)); /* keep solid when selected */
}


/* =========================================================
   16. BUTTON SIZE HELPERS
   ========================================================= */

.icon {
  vertical-align: middle;
  width: 0.9rem;
  height: 0.9rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.icon-md {
  vertical-align: middle;
  width: 1.05rem;
  height: 1.05rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  display: block;
}

.icon-sm { width: 0.75rem; height: 0.75rem; }
.icon-md { width: 1rem;   height: 1rem; }
.icon-lg { width: 1.25rem;height: 1.25rem; }


/* =========================================================
   17. TABLE UTILITIES
   ========================================================= */



.no-copy {
  user-select: none;
}

/* =========================================================
   14. TIMEPOINT ROWS (form rows)
   ========================================================= */

.timepoint-row {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timepoint-card {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: hsl(var(--accent)/0.5);
  border: 1px solid hsl(var(--card-border));
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;

  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));

}

.timepoint-button {
  height: 1.25rem;
  width: 1.25rem;
  padding: 0;

  
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.control-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.control-col--grow {
  flex-grow: 1;
}

.control-row > button {
  flex-shrink: 0;      /* buttons stay on the same row */
}

/* =========================================================
   20. ACCESSIBILITY HELPERS
   ========================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* =========================================================
   21. VISIBILITY HELPERS
   ========================================================= */

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}


/* =========================================================
   Others
   ========================================================= */

#recordBtn{
  display: none;
  position: absolute;
}


