* {
  box-sizing: border-box;
}

body,
.body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #e8e4df, transparent 55%),
    radial-gradient(circle at 100% 0%, #edeae5, transparent 55%),
    linear-gradient(180deg, #f8f7f5 0%, #f2f0ec 60%, #edeae5 100%);
  color: #2e2b27;
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  width: 100%;
  max-width: 560px;
  padding: 1rem 1rem 3.5rem;
  margin: 0 auto;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1rem 1.1rem;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-header-row h2 {
  margin: 0;
}

.delete-btn {
  color: #b84040;
}

.delete-btn:hover {
  background: rgba(184, 64, 64, 0.1);
  color: #9e3434;
}

.delete-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e8e4df;
  display: flex;
  justify-content: center;
}

.btn-delete-session {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1.5px solid #b84040;
  color: #b84040;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-delete-session:hover {
  background: #b84040;
  color: #fff;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.07),
    0 0 0 1px #e8e4df;
}

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

.app-icon {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3d3835 0%, #5a7a5e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.header-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #2e2b27;
  letter-spacing: -0.01em;
}

.header-user {
  font-size: 0.78rem;
  color: #9e9288;
}

.header-right {
  color: #4a4540;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb {
  margin: 0.4rem 0 0.8rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.breadcrumb a {
  color: #5a7a5e;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  margin: 0 0.3rem;
  color: #c4bdb6;
}

.breadcrumb-current {
  color: #2e2b27;
  font-weight: 500;
}

.nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: space-around;
  padding: 0.4rem 0.6rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.07);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  color: #9ca3af;
  font-size: 0.7rem;
}

.nav-item.active {
  background: #f2f0ec;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #5a7a5e;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-label {
  line-height: 1;
}

h2 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #2e2b27;
}

.icon-heading {
  width: 20px;
  height: 20px;
  color: #5a7a5e;
  border-radius: 999px;
  border: 1px solid #d4cfc8;
}

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

.stat {
  border-radius: 12px;
  padding: 0.75rem;
  background: #faf9f7;
  border: 1px solid #e8e4df;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-size: 0.75rem;
  color: #6b7280;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #3d3835;
}

.dashboard-top-stats .stat:hover {
  transform: translateY(-3px) scale(1.025);
  background: #f5f2ee;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  border-color: #c8c0b8;
}

.dashboard-top-stats .stat:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}

.dashboard-top-stats .stat-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-link {
  text-decoration: none;
  color: inherit;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.stat-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #f2f0ec;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Stat card color variants */
.stat--red {
  background: #fef6f5;
  border-color: #f0ceca;
}
.stat--red .stat-icon {
  background: #fdeae8;
  border-color: rgba(190, 60, 50, 0.2);
}
.stat--red .stat-value {
  color: #b84040;
}
.dashboard-top-stats .stat--red:hover {
  background: #feeeed;
  border-color: #e0a49e;
}

.stat--amber {
  background: #fdf8f1;
  border-color: #eddcbb;
}
.stat--amber .stat-icon {
  background: #f5e8cc;
  border-color: rgba(170, 120, 30, 0.2);
}
.stat--amber .stat-value {
  color: #9a6e20;
}
.dashboard-top-stats .stat--amber:hover {
  background: #fbf2e4;
  border-color: #dcc89a;
}

.stat--green {
  background: #f4f9f5;
  border-color: #c8e0cc;
}
.stat--green .stat-icon {
  background: #d8ecdd;
  border-color: rgba(60, 120, 75, 0.2);
}
.stat--green .stat-value {
  color: #3d7a4a;
}
.dashboard-top-stats .stat--green:hover {
  background: #edf7f0;
  border-color: #a8cdaf;
}

.button-compact {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  background: #f5f2ee;
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chart-main {
  color: #2e2b27;
  flex: 1;
}

.chart-cta {
  display: flex;
  color: #5a7a5e;
}

.tiles-card {
  padding-bottom: 0.2rem;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0.8rem;
  border-radius: 1rem;
  background: #faf9f7;
  border: 1px solid #e8e4df;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  will-change: transform;
}

.tile-primary {
  grid-column: span 2;
  background: linear-gradient(135deg, #2e2b27, #4a4540);
  color: #f9fafb;
  border: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
  will-change: transform;
}

.tile-icon {
  height: 24px;
  border-radius: 999px;
  border: 1px solid #e8e4df;
  background: #f2f0ec;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.45rem;
}

.tile-label {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #2e2b27;
}

.tile-primary .tile-label {
  color: #f5f2ee;
}

.tile-caption {
  font-size: 0.75rem;
  color: #6b7280;
}

.tile-primary .tile-caption {
  color: #b8b0a6;
}

.tile-value {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.2rem;
  color: #3d3835;
}

.tile-primary .tile-value {
  color: #f5f2ee;
}

.tile-warning-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
}

.tile-warning-icon .icon-alert {
  width: 14px;
  height: 14px;
}

.tile-header-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tile-task-list {
  list-style: none;
  padding: 0;
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: #4b5563;
}

.tile-task-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  padding-top: 0.18rem;
}

.tile-task-name {
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-task-age {
  font-size: 0.7rem;
  color: #6b7280;
  flex-shrink: 0;
  margin-left: 0.4rem;
}

.tile-empty {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.tile:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1), 0 0 0 1.5px rgba(0, 0, 0, 0.08);
  background: #f5f2ee;
  border-color: #d4cfc8;
}

.tile:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
}

.tile-primary:hover {
  transform: translateY(-4px) scale(1.015);
  background: linear-gradient(135deg, #3d3835 0%, #5a5048 100%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.3), 0 0 0 1.5px rgba(255, 255, 255, 0.15);
}

.tile-primary:active {
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.form-group {
  margin-bottom: 0.75rem;
}

label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #374151;
}

input[type='text'],
input[type='number'],
input[type='date'],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 0.8rem;
  border: 1px solid #d4cfc8;
  font-size: 0.9rem;
  background: #ffffff;
  color: #2e2b27;
  outline: none;
  transition: border-color 0.15s ease;
}

input[type='text']:focus,
input[type='number']:focus,
input[type='date']:focus,
textarea:focus,
select:focus {
  border-color: #5a7a5e;
  box-shadow: 0 0 0 3px rgba(90, 122, 94, 0.12);
}

textarea {
  min-height: 80px;
}

button,
.button {
  border: none;
  background: linear-gradient(135deg, #3d3835, #5a5048);
  color: #f9fafb;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

button:hover,
.button:hover {
  background: linear-gradient(135deg, #2e2b27, #3d3835);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-2px) scale(1.03);
}

button:active,
.button:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

button.secondary,
.button.secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

button.secondary:hover,
.button.secondary:hover {
  background: #f2f0ec;
  border-color: #d4cfc8;
  color: #3d3835;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px) scale(1.03);
}

button.secondary:active,
.button.secondary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #f2f0ec;
  color: #5a7a5e;
  font-size: 0.75rem;
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.7rem 0.75rem;
  margin-bottom: 0.4rem;
  border-radius: 0.9rem;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.4rem 0.8rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.checkbox-item input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #5a7a5e;
}

.tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.tag-check {
  font-size: 0.65em;
  opacity: 0.6;
  margin-right: 0.1em;
}

.tag.overdue {
  background: #fee2e2;
  color: #b91c1c;
}

.tag.ok {
  background: #e8f0e9;
  color: #4a6b4e;
}

.link-quiet {
  text-decoration: none;
}

.link-quiet:hover {
  text-decoration: underline;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  font-size: 0.75rem;
}

.calendar-day {
  display: block;
  min-height: 60px;
  border-radius: 0.5rem;
  padding: 0.25rem;
  background: #f9fafb;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.calendar-day span {
  font-weight: 500;
}

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.event-session {
  background: #7a9e80;
}

.event-vacation {
  background: #3b82f6;
}

.history-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.history-reset {
  white-space: nowrap;
  align-self: flex-end;
  margin-bottom: 0.1rem;
}

.btn-sm {
  padding: 0.3rem 0.65rem !important;
  font-size: 0.78rem !important;
}

.history-filters .form-group {
  margin: 0;
  flex: 1 1 0;
}

.history-filters label {
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

.history-filters input[type='date'],
.history-filters select {
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
}

.history-filters button[type='submit'] {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.history-list .history-main {
  flex: 1;
}

.history-list li {
  align-items: flex-start;
}

.history-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.history-date {
  font-weight: 600;
  color: #2e2b27;
}

.history-duration {
  font-weight: 500;
  color: #5a7a5e;
}

.history-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.2rem;
}

.history-comment {
  font-size: 0.8rem;
  color: #6b7280;
}

.history-actions {
  padding-left: 0.75rem;
  display: flex;
  align-items: center;
}

.icon-button {
  border: none;
  background: none;
  padding: 0.2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-button.primary {
  background: #3d3835;
  color: #f9fafb;
}

.icon-edit,
.icon-plus,
.icon-calendar,
.icon-dashboard,
.icon-history,
.icon-sun,
.icon-cart,
.icon-home,
.icon-alert,
.icon-back,
.icon-logout,
.icon-back,
.icon-trash,
.icon-check {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.icon-home {
  border-radius: 999px;
}

.icon-dashboard {
  border-style: dashed;
}

.icon-history {
  border-top-left-radius: 999px;
}

.icon-calendar {
  border-bottom-width: 2px;
}

.icon-sun {
  border-color: #f59e0b;
}

.icon-cart {
  border-bottom-left-radius: 999px;
}

.icon-alert {
  border-color: #f97316;
}

.icon-back {
  border-radius: 999px;
}

.icon-logout {
  border-radius: 999px;
}

.icon-trash {
  border-radius: 3px;
}

.icon-check.on {
  background: #5a7a5e;
  border-color: #5a7a5e;
}

.icon-check.off {
  background: transparent;
  border-color: #9ca3af;
}

.icon-home::before {
  content: "🏠";
}

.icon-dashboard::before {
  content: "📊";
}

.icon-history::before {
  content: "⏱";
}

.icon-calendar::before {
  content: "📅";
}

.icon-sun::before {
  content: "☀️";
}

.icon-cart::before {
  content: "🧺";
}

.icon-alert::before {
  content: "⚠️";
}

.icon-plus::before {
  content: "+";
}

.icon-back::before {
  content: "←";
}

.icon-logout::before {
  content: "⏻";
}

.icon-edit::before {
  content: "✏️";
}

.icon-trash::before {
  content: "🗑️";
}

.icon-check.on::before {
  content: "✓";
}

.shopping-list {
  margin-top: 0.25rem;
}

.shopping-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.shopping-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shopping-name {
  font-size: 0.9rem;
}

.shopping-status {
  font-size: 0.75rem;
  color: #6b7280;
}

.shopping-status.missing {
  color: #b91c1c;
}

.shopping-status.ok {
  color: #5a7a5e;
}

.shopping-add {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.shopping-delete-form {
  margin-left: 0.25rem;
}

.logout-button {
  background: #ef4444;
  color: #fef2f2;
}

.logout-button:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.dashboard-chart-card {
  margin-top: 0.25rem;
}

.mini-chart {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mini-chart-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-chart-label {
  width: 4.2rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.mini-chart-bar-wrapper {
  flex: 1;
  background: #e8e4df;
  border-radius: 999px;
  overflow: hidden;
}

.mini-chart-bar {
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4a5a4d 0%, #5a7a5e 60%, #7a9e80 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.35rem;
}

.mini-chart-bar-value {
  font-size: 0.7rem;
  color: #f5f2ee;
}

.todo-empty {
  text-align: center;
  padding: 1.5rem 0;
}

.todo-empty-icon {
  font-size: 2.2rem;
  margin-bottom: 0.4rem;
  color: #5a7a5e;
}

.todo-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2e2b27;
  margin-bottom: 0.2rem;
}

.todo-empty-sub {
  font-size: 0.8rem;
  color: #a89e94;
}

.todo-list .todo-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-direction: column;
}

.todo-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.todo-item-lastdate {
  font-size: 0.72rem;
  color: #8a8178;
}

.todo-item--overdue {
  background: #fef6f5;
  border-color: #f0ceca;
}

.todo-item--ok {
  background: #f4f9f5;
  border-color: #c8e0cc;
}

.todo-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #2e2b27;
  flex: 1;
}

.todo-item-age {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.todo-item-age--late {
  color: #b84040;
}

.todo-item-age--ok {
  color: #3d7a4a;
}

.muted {
  font-size: 0.8rem;
  color: #6b7280;
}

/* ── Stats page ────────────────────────────────────── */

.stats-hero-grid {
  grid-template-columns: repeat(2, 1fr);
}

.stat--blue {
  background: #f0f6ff;
  border-color: #bdd5ef;
}
.stat--blue .stat-icon {
  background: #d8eaf8;
  border-color: rgba(40, 100, 180, 0.2);
}
.stat--blue .stat-value {
  color: #2c6aad;
}

.stat--charcoal {
  background: #f5f3f0;
  border-color: #ddd9d4;
}
.stat--charcoal .stat-icon {
  background: #ede9e4;
  border-color: rgba(60, 55, 50, 0.15);
}
.stat--charcoal .stat-value {
  color: #2e2b27;
}

.stat-sub {
  font-size: 0.7rem;
  color: #a89e94;
  margin-top: 0.15rem;
}

.stats-empty {
  text-align: center;
  color: #9ca3af;
  padding: 1.5rem 0;
  line-height: 1.6;
}

/* Horizontal bar chart */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar-chart-row {
  display: grid;
  grid-template-columns: 3rem 1fr 2.8rem;
  align-items: center;
  gap: 0.5rem;
  animation: bar-row-fade 0.4s ease both;
}

@keyframes bar-row-fade {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.bar-chart-label {
  font-size: 0.7rem;
  color: #6b7280;
  text-align: right;
  white-space: nowrap;
}

.bar-chart-label--task {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

.bar-chart-row:has(.bar-chart-label--task) {
  grid-template-columns: 6.5rem 1fr 2rem;
}

.bar-chart-track {
  height: 20px;
  background: #f2f0ec;
  border-radius: 999px;
  overflow: hidden;
}

.bar-chart-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
  transform-origin: left;
  animation: bar-scale-in 0.6s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes bar-scale-in {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.bar-chart-fill--blue {
  background: linear-gradient(90deg, #6aabde 0%, #4e8dcc 100%);
}

.bar-chart-fill--sage {
  background: linear-gradient(90deg, #7a9e80 0%, #5a7a5e 100%);
}

.bar-chart-end-val {
  font-size: 0.68rem;
  color: #6b7280;
  text-align: left;
  white-space: nowrap;
}

/* Vertical day-of-week chart */
.dow-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  height: 130px;
}

.dow-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 0.15rem;
}

.dow-bar-val {
  font-size: 0.6rem;
  color: #a89e94;
  height: 0.9rem;
  line-height: 0.9rem;
  text-align: center;
}

.dow-bar-track {
  flex: 1;
  width: 100%;
  background: #f2f0ec;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
}

.dow-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, #e07535 0%, #b84040 100%);
  border-radius: 6px 6px 0 0;
  min-height: 2px;
  transform-origin: bottom;
  animation: bar-scale-up 0.7s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes bar-scale-up {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

.dow-bar-label {
  font-size: 0.65rem;
  color: #6b7280;
  text-align: center;
}

/* Donut chart */
.donut-layout {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.donut-wrapper {
  flex-shrink: 0;
}

.donut-chart {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
  animation: donut-appear 0.7s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

@keyframes donut-appear {
  from { transform: scale(0.6) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg); opacity: 1; }
}

.donut-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

.donut-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2e2b27;
  line-height: 1;
}

.donut-total-label {
  font-size: 0.58rem;
  color: #a89e94;
  margin-top: 0.1rem;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  overflow: hidden;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.donut-legend-name {
  flex: 1;
  color: #4b5563;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.donut-legend-pct {
  font-weight: 600;
  color: #2e2b27;
  flex-shrink: 0;
}

.tasks-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tasks-table-header h2 {
  margin: 0;
}

.tasks-empty {
  margin: 0.25rem 0 0.75rem;
}

.tasks-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.tasks-table thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a89e94;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid #e8e4df;
}

.tasks-table tbody tr {
  border-bottom: 1px solid #f0ede9;
  transition: background 0.15s;
}

.tasks-table tbody tr:last-child {
  border-bottom: none;
}

.tasks-table tbody tr.drag-over {
  background: #f2f0ec;
  box-shadow: inset 0 2px 0 #5a7a5e;
}

.tasks-table tbody tr.dragging {
  opacity: 0.4;
}

.tasks-table td {
  padding: 0.35rem 0.5rem;
  vertical-align: middle;
}

.tasks-table-drag-col {
  width: 1.5rem;
  text-align: center;
}

.tasks-table-due-col {
  width: 5.5rem;
}

.tasks-table-actions-col {
  width: 2.5rem;
  text-align: right;
}

.drag-handle {
  cursor: grab;
  color: #c8c0b8;
  font-size: 1rem;
  user-select: none;
  display: inline-block;
  line-height: 1;
}

.drag-handle:active {
  cursor: grabbing;
}

.task-table-name-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.3rem 0.4rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: #2e2b27;
  transition: border-color 0.15s, background 0.15s;
}

.task-table-name-input:hover,
.task-table-name-input:focus {
  border-color: #d4cfc8;
  background: #faf9f7;
  outline: none;
}

.task-due-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-due-input {
  width: 3.5rem !important;
  padding: 0.25rem 0.4rem !important;
  font-size: 0.85rem !important;
}

.task-due-unit {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay--visible {
  display: flex;
}

.modal {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  width: calc(100% - 2rem);
  max-width: 340px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: modal-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modal-pop {
  from { transform: scale(0.88); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #2e2b27;
  margin-bottom: 0.5rem;
}

.modal-body {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.modal-btn-delete {
  background: #b84040;
  color: #fff;
  border: none;
}

.modal-btn-delete:hover {
  background: #9e3434;
  box-shadow: 0 4px 12px rgba(184, 64, 64, 0.3);
}

dialog.modal {
  border: none;
  padding: 0;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  width: calc(100% - 2rem);
  max-width: 340px;
}

dialog.modal > .modal-content {
  padding: 1.25rem 1.4rem;
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.modal-message {
  font-size: 0.875rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

/* Save toast */
.save-toast {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #2e2b27;
  color: #f5f2ee;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 300;
  white-space: nowrap;
}

.save-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.save-toast--error {
  background: #b84040;
}

@media (min-width: 768px) {
  .layout {
    max-width: 960px;
    padding: 1.5rem 1.5rem 2rem;
    margin-bottom: 0;
  }

  .nav {
    position: static;
    transform: none;
    max-width: none;
    margin: 0 0 1rem;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.12);
    border-radius: 999px;
  }
}
