/* Dieter Rams — as little design as possible (default) */

:root,
html[data-theme="rams"] {
  --bg: #f2f2f2;
  --ink: #1a1a1a;
  --muted: #757575;
  --line: #d6d6d6;
  --line-strong: #bdbdbd;
  --card: #ffffff;
  --surface: #fafafa;
  --panel-bg: transparent;
  --panel-pad: 0;
  --panel-border: none;
  --panel-shadow: none;

  --braun: #c45c26;
  --braun-soft: #f7ebe4;
  --accent: var(--braun);
  --primary-btn-bg: #1a1a1a;
  --primary-btn-fg: #ffffff;

  --danger: #a33b2b;
  --danger-bg: #f8efed;
  --warning: #9a6b2f;
  --warning-bg: #f7f1e8;
  --success: #3d6b4f;
  --success-bg: #eef5f0;

  --home-bg: #f7faf8;
  --leave-bg: #faf6f5;
  --who-bg: #f5f5f5;
  --note-bg: #fafafa;
  --row-alt: #fafafa;
  --row-alt-who: #f7f7f7;
  --row-hover: #f0f0f0;
  --row-hover-who: #ebebeb;

  --radius: 2px;
  --border-w: 1px;
  --shadow: none;
  --shadow-sm: none;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", "Consolas", monospace;
  --font-weight-brand: 500;
  --letter-brand: -0.02em;
  --text-transform-brand: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  margin: 0;
  font-size: 1.5rem;
  font-weight: var(--font-weight-brand);
  letter-spacing: var(--letter-brand);
  text-transform: var(--text-transform-brand);
  color: var(--ink);
}

.sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: none;
}

main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel,
.upload-panel {
  background: var(--panel-bg);
  border: var(--panel-border);
  box-shadow: var(--panel-shadow);
  padding: var(--panel-pad);
  border-radius: var(--radius);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.count {
  color: var(--muted);
  font-weight: 400;
}

.explain {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.75rem;
  white-space: nowrap;
  color: var(--muted);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot.danger { background: var(--danger); }
.dot.warning { background: var(--warning); }

.drops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.drop {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.35rem 1.25rem;
  background: var(--card);
  cursor: pointer;
  min-height: 108px;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.drop:hover,
.drop.dragover {
  background: var(--surface);
}

.drop.has-file {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.drop-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.drop-label {
  font-size: 1rem;
  font-weight: 500;
}

.drop-hint {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--primary-btn-bg);
  border-color: var(--primary-btn-bg);
  color: var(--primary-btn-fg);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--card);
}

.btn.loading {
  position: relative;
}

.btn.loading .btn-label {
  visibility: hidden;
}

.btn.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--danger-bg);
  color: var(--danger);
  border-left: 2px solid var(--danger);
  font-size: 0.88rem;
}

.results {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.stat {
  background: var(--card);
  border: none;
  box-shadow: none;
  padding: 1rem 1.05rem;
}

.stat .label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.stat .value {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
}

.stat.warn {
  background: var(--card);
}

.stat.warn .value {
  color: var(--accent);
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.search-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.search input {
  min-width: 200px;
  padding: 0.5rem 0;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  font-size: 0.88rem;
  background: transparent;
  color: var(--ink);
}

.search input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.table-wrap {
  overflow: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: none;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.conflicts-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  background: var(--surface);
}

.conflicts-table .group-row th {
  top: 0;
  z-index: 3;
  border-bottom: none;
  padding-bottom: 0.15rem;
  color: var(--ink);
  font-weight: 500;
}

.conflicts-table .sub-row th {
  top: 1.45rem;
  z-index: 2;
  padding-top: 0.1rem;
}

.conflicts-table .group-row .col-who,
.conflicts-table .sub-row .col-who {
  background: var(--who-bg);
}

.conflicts-table .group-row .col-home,
.conflicts-table .sub-row .col-home {
  background: var(--home-bg);
  color: var(--success);
}

.conflicts-table .group-row .col-leave,
.conflicts-table .sub-row .col-leave {
  background: var(--leave-bg);
  color: var(--danger);
}

.conflicts-table .group-row .col-note,
.conflicts-table .sub-row .col-note,
.conflicts-table .group-row .col-actie,
.conflicts-table .sub-row .col-actie {
  background: var(--note-bg);
}

.conflicts-table td.col-who {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--card);
  min-width: 10.5rem;
  border-right: 1px solid var(--line);
  font-weight: 500;
}

.conflicts-table thead .col-who {
  position: sticky;
  left: 0;
  z-index: 4;
}

.conflicts-table .col-split {
  border-left: 1px solid var(--line);
}

.conflicts-table tbody tr:nth-child(even) td {
  background: var(--row-alt);
}

.conflicts-table tbody tr:nth-child(even) td.col-who {
  background: var(--row-alt-who);
}

.conflicts-table tbody tr:hover td {
  background: var(--row-hover);
}

.conflicts-table tbody tr:hover td.col-who {
  background: var(--row-hover-who);
}

.conflicts-table tr.full td.col-who {
  box-shadow: inset 2px 0 0 var(--danger);
}

.conflicts-table tr.partial td.col-who {
  box-shadow: inset 2px 0 0 var(--warning);
}

.conflicts-table tr.is-hidden {
  opacity: 0.4;
}

.conflicts-table tr:last-child td {
  border-bottom: none;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cell-main {
  font-weight: 500;
}

.cell-sub {
  color: var(--muted);
  font-size: 0.78rem;
}

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

.empty {
  margin: 1rem 0 0;
  padding: 0.85rem 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  box-shadow: none;
  color: var(--success);
  font-weight: 500;
  font-size: 0.88rem;
}

.side-grids {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.accordion.panel {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.accordion > summary {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.95rem;
  list-style: none;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.accordion > summary::-webkit-details-marker {
  display: none;
}

.accordion > summary::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid var(--muted);
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  margin-right: 0.55rem;
  vertical-align: middle;
}

.accordion[open] > summary::before {
  transform: rotate(90deg);
}

.emp {
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.emp:first-child {
  border-top: none;
  padding-top: 0.25rem;
}

.emp h3 {
  margin: 0 0 0.2rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.emp h3 small {
  color: var(--muted);
  font-weight: 400;
}

.emp .meta {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.month-block {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  box-shadow: none;
  background: var(--card);
  padding: 0.75rem 0.85rem;
}

.month-block summary {
  cursor: pointer;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  list-style: none;
}

.month-block summary::-webkit-details-marker {
  display: none;
}

.meta-inline {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.month-list {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
}

.month-item {
  display: grid;
  grid-template-columns: 1.2fr auto auto 1.4fr;
  gap: 0.4rem 0.65rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.month-item:first-child { border-top: none; }
.month-item.full { box-shadow: inset 2px 0 0 var(--danger); padding-left: 0.65rem; }
.month-item.partial { box-shadow: inset 2px 0 0 var(--warning); padding-left: 0.65rem; }
.month-item.is-hidden { opacity: 0.4; }

.month-who { font-weight: 500; }
.month-date { font-family: var(--mono); font-size: 0.8rem; }
.month-note { color: var(--muted); font-size: 0.8rem; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--card);
  box-shadow: none;
}

.tag.conflict {
  border-color: #e0c8c3;
  background: var(--danger-bg);
  color: var(--danger);
}

.tag.partial {
  border-color: #e2d6c0;
  background: var(--warning-bg);
  color: var(--warning);
}

.day-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.day-chip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.15rem 0.4rem;
  font-size: 0.74rem;
  font-family: var(--mono);
  font-weight: 450;
  background: var(--card);
  box-shadow: none;
}

.day-chip.conflict {
  border-color: #e0c8c3;
  background: var(--danger-bg);
  color: var(--danger);
}

.day-chip.partial {
  border-color: #e2d6c0;
  background: var(--warning-bg);
  color: var(--warning);
}

.day-chip.is-hidden {
  opacity: 0.4;
}

.col-actie {
  width: 1%;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--card);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 860px) {
  .top {
    flex-direction: column;
    align-items: stretch;
  }
  .drops,
  .side-grids {
    grid-template-columns: 1fr;
  }
  .month-item {
    grid-template-columns: 1fr 1fr;
  }
}
