/* BioLite Brand Colors */
:root {
  --brand-charcoal: #363436;
  --brand-teal: #008fa1;
  --brand-light-grey: #f3f3f3;
  --brand-grey: #ebebec;
  --brand-medium-grey: #cfd2d3;
  --brand-yellow: #ff8f00;
  --brand-orange: #c15027;
}

/* Override Pico dark theme variables */
:root[data-theme="dark"] {
  --pico-background-color: var(--brand-medium-grey);
  --pico-color: #111;
  --pico-primary: var(--brand-teal);
  --pico-primary-hover: #007a8a;
  --pico-secondary: var(--brand-charcoal);
}

/* Fonts */
@font-face {
  font-family: 'Reader Bold';
  src: url("../fonts/reader-bold.0cf328b7874f.otf") format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: 'Open Sans', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.app-title,
.content h2,
.login-card h1,
.form-page h2,
.page-header h2 {
  font-family: 'Reader Bold', 'Open Sans', sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Layout */
.app-layout {
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--brand-charcoal);
  color: var(--brand-light-grey);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--brand-teal);
  text-align: center;
}

.sidebar-logo {
  display: block;
  max-width: 150px;
  margin: 0 auto 0.75rem;
}

.sidebar-header .app-title {
  margin: 0;
  font-size: 0.875rem;
  color: var(--brand-light-grey);
  text-align: center;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
}

.sidebar-nav li {
  display: block;
  margin: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.65rem 1.25rem;
  color: var(--brand-medium-grey);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--brand-light-grey);
}

.sidebar-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--brand-teal);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
}

.sidebar-footer .user-name {
  display: block;
  color: var(--brand-light-grey);
  margin-bottom: 0.25rem;
}

.sidebar-footer .logout-link {
  display: block;
  color: var(--brand-medium-grey);
  text-decoration: none;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.sidebar-footer .logout-link:hover {
  color: var(--brand-orange);
}

/* Main content area */
.content {
  background: var(--brand-medium-grey);
  color: #111;
  padding: 2rem;
  margin-left: 220px;
  min-height: 100vh;
}

/* Override Pico's link color inside content */
.content a {
  color: var(--brand-teal);
}

.content a:hover {
  color: #007a8a;
}

/* Tables */
.content table {
  --pico-background-color: #fff;
  --pico-border-color: var(--brand-medium-grey);
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border-color: var(--brand-medium-grey);
}

.content table th {
  background: var(--brand-charcoal);
  color: var(--brand-light-grey);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
  border: none;
}

.content table td {
  color: #111;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--brand-medium-grey) !important;
  border-top: none;
  border-left: none;
  border-right: none;
}

.content table tr:last-child td {
  border-bottom: none !important;
}

/* Buttons / Actions */
td.actions-cell {
  white-space: nowrap;
}

td.actions-cell .btn-icon {
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: middle;
}

td.actions-cell .btn-icon:last-child {
  margin-right: 0;
}

.btn-icon {
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: #111;
  transition: opacity 0.15s;
}

.btn-icon:hover {
  opacity: 0.5;
}

.btn-primary,
a.btn-primary {
  background: var(--brand-teal);
  color: #fff !important;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}

.btn-primary:hover {
  background: #007a8a;
}

.btn-secondary {
  background: var(--brand-orange);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
}

.btn-secondary:hover {
  background: #a8421f;
}

/* Time entry grid */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.week-nav a {
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--brand-charcoal);
  padding: 0.25rem 0.5rem;
}

.week-nav a:hover {
  color: var(--brand-teal);
}

.week-nav .week-label {
  font-size: 1.1rem;
  font-weight: 600;
  min-width: 220px;
  text-align: center;
}

.time-grid {
  width: 100%;
  border-collapse: collapse;
}

.time-grid td,
.time-grid th {
  border-bottom-color: var(--brand-medium-grey);
}

.time-grid input[data-date] {
  width: 85px;
  padding: 0.3rem 0.4rem;
  text-align: center;
  border: 1px solid var(--brand-grey);
  border-radius: 3px;
  font-size: 0.85rem;
  background: #fff;
  color: #111;
}

.time-grid input[data-date]:focus {
  border-color: var(--brand-teal);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 143, 161, 0.2);
}

.time-grid .row-total,
.time-grid .col-total {
  font-weight: 600;
  text-align: center;
  color: var(--brand-charcoal);
}

.time-grid .grand-total {
  font-weight: 700;
  color: var(--brand-teal);
}

.save-status {
  text-align: center;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.save-status.saved {
  color: var(--brand-teal);
}

.save-status.pending {
  color: var(--brand-orange);
}

.save-status.error {
  color: var(--brand-orange);
}

/* Category add row */
.add-category-row select {
  background: #fff;
  color: #111;
  border: 1px solid var(--brand-grey);
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 3px;
}

/* Forms */
.content form label {
  color: #333;
  font-weight: 600;
  font-size: 0.85rem;
}

.content form input:not([type="checkbox"]):not([type="radio"]),
.content form textarea,
.content form select {
  background: #fff;
  color: #111;
  border: 1px solid var(--brand-grey);
}

.content form input:not([type="checkbox"]):not([type="radio"]):focus,
.content form textarea:focus,
.content form select:focus {
  border-color: var(--brand-teal);
}

.content form input[type="checkbox"],
.content form input[type="radio"] {
  --pico-border-color: #999;
  --pico-primary: var(--brand-teal);
  --pico-primary-hover: #007a8a;
}

/* Dialog modals */
dialog {
  border: none;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  background: #fff;
  color: #111;
}

dialog::backdrop {
  background: rgba(54, 52, 54, 0.7);
}

dialog h2 {
  color: var(--brand-charcoal);
  margin-top: 0;
}

/* Form page wrapper */
.form-page {
  max-width: 600px;
}

.form-page h2 {
  color: var(--brand-charcoal);
  margin-bottom: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h2 {
  margin: 0;
  color: var(--brand-charcoal);
}

/* Tags display */
.tag-badge {
  display: inline-block;
  background: var(--brand-teal);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}

/* Multi-select widget */
.multi-select-widget {
  border: 1px solid var(--brand-grey);
  border-radius: 4px;
  background: #fff;
  padding: 0.5rem;
}

.multi-select-widget .search-input {
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--brand-grey);
  border-radius: 3px;
  font-size: 0.85rem;
}

.multi-select-widget .options-list {
  max-height: 150px;
  overflow-y: auto;
  margin-bottom: 0.5rem;
}

.multi-select-widget .options-list label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.25rem;
  font-weight: normal;
  font-size: 0.85rem;
  cursor: pointer;
}

.multi-select-widget .options-list label:hover {
  background: var(--brand-grey);
}

.multi-select-widget .selected-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.5rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--brand-grey);
}

.multi-select-widget .selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--brand-charcoal);
  color: var(--brand-light-grey);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
}

.multi-select-widget .selected-chip .remove-chip {
  cursor: pointer;
  font-weight: bold;
  opacity: 0.7;
}

.multi-select-widget .selected-chip .remove-chip:hover {
  opacity: 1;
  color: var(--brand-orange);
}

/* Checkbox groups in forms */
.checkbox-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal !important;
}

/* Radio groups */
.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal !important;
  cursor: pointer;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--brand-charcoal);
}

.login-card {
  background: #fff;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  width: auto;
  min-width: min-content;
}

.login-card h1 {
  color: var(--brand-charcoal);
  margin-bottom: 0.5rem;
  white-space: nowrap;
}

.login-card p {
  color: #666;
  margin-bottom: 2rem;
}

.login-card .google-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--brand-teal);
  color: #fff;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.15s;
}

.login-card .google-btn:hover {
  background: #007a8a;
}

/* Confirm dialog */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(54, 52, 54, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.confirm-box {
  background: #fff;
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  text-align: center;
}

.confirm-box p {
  color: #111;
  margin-bottom: 1.5rem;
}

.confirm-box .confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
