:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #eef2f6;
  --text: #17202a;
  --muted: #637083;
  --line: #dbe2ea;
  --blue: #2563eb;
  --teal: #0f766e;
  --amber: #b45309;
  --rose: #be123c;
  --violet: #6d28d9;
  --green: #047857;
  --shadow: 0 18px 40px rgba(23, 32, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

.login-screen {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), transparent 38%),
    linear-gradient(180deg, #f9fbfc, #e8edf2);
}

.login-panel {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #17202a;
  color: #ffffff;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-panel h1 {
  margin: 10px 0 26px;
  font-size: 2rem;
  line-height: 1.1;
}

.login-form,
.admin-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

textarea {
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.login-form button,
.admin-form button,
.work-form button,
.secondary-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #17202a;
  color: #ffffff;
  padding: 0 16px;
  font-weight: 800;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button,
.danger-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 800;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.danger-button {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: var(--rose);
}

.work-form .ghost-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

.work-form .danger-button {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: var(--rose);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 0.9rem;
}

.form-message.success {
  color: var(--green);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: grid;
  height: 100vh;
  grid-template-rows: auto 1fr auto;
  border-right: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
}

.sidebar-brand strong,
.profile-box strong {
  display: block;
  line-height: 1.2;
}

.sidebar-brand span,
.profile-box span {
  color: var(--muted);
  font-size: 0.84rem;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5563;
  padding: 0 12px;
  text-align: left;
  font-weight: 700;
}

.nav-item.active {
  background: #eef2ff;
  color: #1d4ed8;
}

.profile-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
}

.avatar-image {
  object-fit: cover;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.main-area {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.15;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  display: grid;
  min-height: 128px;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.metric-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
}

.metric-card p {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.accent-blue .metric-icon {
  background: var(--blue);
}

.accent-teal .metric-icon {
  background: var(--teal);
}

.accent-amber .metric-icon {
  background: var(--amber);
}

.accent-rose .metric-icon {
  background: var(--rose);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading.compact {
  align-items: start;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.section-heading > span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.production-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.production-card {
  display: grid;
  min-height: 214px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.clickable-card,
.clickable-list-card,
.calendar-click-target {
  cursor: pointer;
}

.clickable-card:hover,
.clickable-list-card:hover,
.calendar-click-target:hover {
  border-color: #b7c4d4;
  box-shadow: 0 12px 24px rgba(23, 32, 42, 0.06);
}

.production-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.type-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #edf2f7;
  color: #475569;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-planung,
.status-recherche {
  background: #eef2ff;
  color: #1d4ed8;
}

.status-in-produktion,
.status-dreh-geplant {
  background: #ecfdf5;
  color: #047857;
}

.status-schnitt,
.status-abnahme {
  background: #fff7ed;
  color: #b45309;
}

.status-fertig {
  background: #f0fdf4;
  color: #166534;
}

.production-card h3 {
  margin: 14px 0 10px;
  font-size: 1.08rem;
  line-height: 1.3;
}

.production-note {
  min-height: 42px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.meta-item {
  border-left: 3px solid var(--line);
  padding-left: 9px;
}

.meta-item span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.card-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 10px;
}

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar {
  width: 30px;
  height: 30px;
  border: 2px solid #ffffff;
  margin-right: -7px;
  font-size: 0.7rem;
}

.creator-chip {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.creator-chip .creator-avatar {
  width: 32px;
  height: 32px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
  font-size: 0.7rem;
}

.creator-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 4;
  max-width: 220px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  opacity: 0;
  padding: 6px 8px;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 800;
}

.creator-chip:hover .creator-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.counter-row {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.side-column {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-editor-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.inline-task-create {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 180px);
  align-items: end;
  gap: 12px;
}

.inline-task-create label:nth-child(3),
.inline-task-create .secondary-button {
  grid-column: 1 / -1;
}

.compact-check-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.embedded-task-list {
  gap: 10px;
}

.task-edit-row {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.task-edit-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.task-item {
  border-left: 3px solid var(--blue);
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  padding: 12px;
}

.task-item strong {
  display: block;
  margin-bottom: 5px;
  line-height: 1.3;
}

.task-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.production-grid .empty-state {
  grid-column: 1 / -1;
}

.muted-text {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.calendar-only-layout {
  display: grid;
  gap: 20px;
}

.work-form,
.item-list,
.calendar-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.work-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-grid {
  display: grid;
  gap: 8px;
}

.check-card {
  display: grid;
  min-height: 46px;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.9rem;
}

.check-card input {
  width: 18px;
  min-height: 18px;
}

.check-card .avatar {
  width: 28px;
  height: 28px;
  font-size: 0.68rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.picker-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
}

.picker-title {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.25;
}

.compact-toolbar {
  margin-bottom: 0;
}

.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #ffffff;
}

.mini-calendar-cell {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 0;
  font-weight: 800;
}

.mini-calendar-cell span {
  color: #111827;
}

.mini-calendar-cell.is-empty {
  background: #f8fafc;
}

.mini-calendar-cell.is-available {
  background: #dcfce7;
  color: #14532d;
}

.mini-calendar-cell.is-booked {
  background: #fee2e2;
  color: #7f1d1d;
}

.mini-calendar-cell.is-redkonfi {
  background: #dbeafe;
  color: #1e3a8a;
}

.mini-calendar-cell.is-neutral {
  background: #ffffff;
}

.mini-calendar-cell.is-selected {
  box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.42);
}

.mini-calendar-cell:disabled {
  cursor: not-allowed;
}

.selected-date-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.large-notes {
  min-height: 180px;
}

.file-list {
  display: grid;
  gap: 8px;
}

.file-row,
.empty-file-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.file-row span {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.file-actions .ghost-button,
.file-actions .danger-button {
  min-height: 32px;
  padding: 0 10px;
  text-decoration: none;
}

.empty-file-state {
  display: flex;
  justify-content: center;
  min-height: 44px;
  font-weight: 700;
}

.item-list {
  display: grid;
  align-content: start;
  gap: 12px;
}

.compact-list {
  margin-top: 20px;
}

.list-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.list-card.slim {
  grid-template-columns: minmax(0, 1fr) auto;
}

.list-card-actions {
  display: grid;
  justify-items: end;
  align-self: stretch;
  align-content: space-between;
  min-width: 40px;
  gap: 10px;
}

.list-card h3 {
  margin: 12px 0 8px;
  font-size: 1rem;
  line-height: 1.3;
}

.list-card p,
.list-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.list-card p {
  margin-bottom: 10px;
}

.list-card strong {
  display: block;
  margin-bottom: 4px;
}

.list-card .type-label {
  color: #475569;
  font-size: 0.76rem;
}

.list-card .status-pill {
  font-size: 0.76rem;
}

.list-card .status-planung,
.list-card .status-recherche {
  color: #1d4ed8;
}

.list-card .status-in-produktion,
.list-card .status-dreh-geplant {
  color: #047857;
}

.list-card .status-schnitt,
.list-card .status-abnahme {
  color: #b45309;
}

.list-card .status-fertig {
  color: #166534;
}

.list-card-main {
  min-width: 0;
}

.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.list-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.open-hint {
  align-self: center;
  border-radius: 999px;
  background: #eef2f6;
  color: #475569;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.chip-green {
  background: #dcfce7;
  color: #166534;
}

.chip-yellow {
  background: #fef3c7;
  color: #92400e;
}

.chip-blue {
  background: #dbeafe;
  color: #1e3a8a;
}

.chip-red {
  background: #fee2e2;
  color: #7f1d1d;
}

.chip-neutral {
  background: #eef2f6;
  color: #475569;
}

.calendar-panel {
  min-width: 0;
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.calendar-toolbar strong {
  text-align: center;
  text-transform: capitalize;
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.legend-dot.green {
  background: #22c55e;
}

.legend-dot.yellow {
  background: #f59e0b;
}

.legend-dot.red {
  background: #ef4444;
}

.legend-dot.blue {
  background: #3b82f6;
}

.legend-dot.neutral {
  background: #94a3b8;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.calendar-weekday,
.calendar-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.calendar-weekday {
  min-height: 36px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.calendar-cell {
  min-height: 116px;
  background: #ffffff;
  padding: 8px;
}

.calendar-cell.is-empty {
  background: #f8fafc;
}

.calendar-cell.is-today {
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
}

.calendar-day {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.calendar-events {
  display: grid;
  gap: 5px;
  margin-top: 7px;
}

.calendar-event {
  display: block;
  width: 100%;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  padding: 6px;
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}

.calendar-event:hover {
  filter: brightness(0.97);
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-green {
  background: #dcfce7;
  color: #14532d;
}

.event-yellow {
  background: #fef3c7;
  color: #78350f;
}

.event-red {
  background: #fee2e2;
  color: #7f1d1d;
}

.event-blue {
  background: #dbeafe;
  color: #1e3a8a;
}

.event-neutral {
  background: #eef2f6;
  color: #334155;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 20px;
}

.modal-panel {
  display: grid;
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  box-shadow: var(--shadow);
}

.production-modal-panel {
  width: min(1120px, calc(100vw - 40px));
}

.modal-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.modal-heading h2 {
  margin: 0;
}

.decision-actions {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.decision-button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 900;
}

.decision-button.accept {
  background: #bbf7d0;
  color: #14532d;
}

.decision-button.reject {
  background: #fecdd3;
  color: #7f1d1d;
}

.decision-button.defer {
  background: #fde68a;
  color: #78350f;
}

.decision-button.active {
  box-shadow: inset 0 0 0 2px currentColor;
}

.idea-card.idea-accepted {
  border-color: #22c55e;
  background: #f0fdf4;
}

.idea-card.idea-deferred {
  border-color: #f59e0b;
  background: #fffbeb;
}

.idea-card.idea-rejected {
  opacity: 0.78;
}

.presentation-button {
  text-decoration: none;
}

.task-card select {
  min-width: 128px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
}

.admin-form,
.user-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.user-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.editable-user-row {
  align-items: center;
}

.user-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 220px) minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding-left: 50px;
}

.user-actions select {
  min-width: 0;
}

.user-password-input {
  min-width: 0;
}

.user-actions .ghost-button {
  min-height: 36px;
}

.user-actions .danger-button {
  min-height: 36px;
}

.user-identity strong,
.user-identity span {
  display: block;
  overflow-wrap: anywhere;
}

.user-identity span {
  color: var(--muted);
  font-size: 0.85rem;
}

.trash-panel {
  margin-top: 22px;
}

.trash-card {
  background: #fffafa;
}

.profile-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  align-items: start;
  gap: 20px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-preview strong,
.profile-preview span {
  display: block;
  overflow-wrap: anywhere;
}

.profile-preview span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.9rem;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-actions .secondary-button,
.backup-actions .ghost-button,
.backup-actions .danger-button {
  min-height: 40px;
  text-decoration: none;
}

.backup-upload-button {
  cursor: pointer;
}

.backup-upload-button input {
  display: none;
}

.edl-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.edl-form {
  position: sticky;
  top: 28px;
}

.edl-textarea {
  min-height: 420px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre;
}

.edl-results {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.edl-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.edl-metric-card,
.edl-result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.edl-metric-card {
  min-height: 112px;
  padding: 14px;
}

.edl-metric-card span,
.edl-metric-card small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.35;
}

.edl-metric-card strong {
  display: block;
  margin: 8px 0 6px;
  overflow-wrap: anywhere;
  font-size: 1.35rem;
  line-height: 1.1;
}

.edl-result-panel {
  min-width: 0;
  padding: 16px;
}

.edl-table-wrap {
  overflow-x: auto;
}

.edl-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.edl-table th,
.edl-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 9px;
  text-align: left;
  vertical-align: top;
}

.edl-table th {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.edl-table td {
  color: var(--text);
}

.edl-table td span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.edl-table tr:last-child td {
  border-bottom: 0;
}

.large-avatar {
  width: 72px;
  height: 72px;
  font-size: 1.2rem;
}

.role-chip {
  border-radius: 999px;
  background: #eef2f6;
  color: #475569;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .edl-layout {
    grid-template-columns: 1fr;
  }

  .edl-form {
    position: static;
  }

  .edl-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-column {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 16px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-box {
    max-width: none;
  }

  .main-area {
    padding: 20px;
  }

  .topbar {
    display: grid;
  }

  .production-grid,
  .admin-layout,
  .profile-layout,
  .inline-task-create,
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .calendar-cell {
    min-height: 96px;
    padding: 6px;
  }
}

@media (max-width: 560px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .edl-metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card,
  .production-card,
  .side-column,
  .admin-form,
  .user-list,
  .work-form,
  .item-list,
  .calendar-panel,
  .edl-result-panel {
    padding: 14px;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    min-width: 720px;
  }

  .calendar-panel {
    overflow-x: auto;
  }

  .list-card,
  .list-card.slim,
  .task-card,
  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .user-actions select {
    min-width: 0;
  }

  .user-password-input {
    min-width: 0;
  }
}
