﻿:root {
  --bg: #f2f7fb;
  --bg-2: #dbeaf5;
  --text: #102a43;
  --muted: #486581;
  --panel: #ffffffcc;
  --line: #c6d3e1;
  --accent: #0d7adf;
  --accent-2: #11b5a4;
  --danger: #d7263d;
  --warn: #f0a202;
  --ok: #2a9d8f;
  --shadow: 0 8px 30px rgba(16, 42, 67, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, var(--bg-2), transparent 40%),
    radial-gradient(circle at 80% 0%, #e6f5f2, transparent 32%),
    var(--bg);
  min-height: 100vh;
}

.app-shell {
  width: min(1400px, 95vw);
  margin: 24px auto;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 2rem);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toolbar > * {
  min-width: 0;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) 1fr;
  gap: 16px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.card h2,
.card h3 {
  margin: 0 0 8px;
}

.tabs-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
  font-weight: 700;
  cursor: pointer;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tab-btn.active {
  background: linear-gradient(120deg, var(--accent), #2f99f8);
  color: #fff;
  border-color: #0b66b8;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

select[multiple] {
  min-height: 108px;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), #2f99f8);
  color: #fff;
  border-color: #0b66b8;
}

.btn.danger {
  background: #ffe8ec;
  border-color: #ffc6cf;
  color: #912033;
}

.btn.small {
  width: fit-content;
}

.file-btn {
  display: inline-flex;
  align-items: center;
}

.entity-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entity-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px 8px;
  background: #fff;
  min-width: 0;
}

.entity-list li > div {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entity-list .meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.icon-btn {
  border: 1px solid #e7b8bf;
  background: #fff1f4;
  color: #8f1f30;
  border-radius: 8px;
  padding: 2px 8px;
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.check-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px;
  background: #fff;
}

.view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-wrapper {
  overflow-x: auto;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid var(--line);
  vertical-align: top;
  padding: 6px;
}

.schedule-table th {
  background: #f0f6fc;
}

.time-col {
  width: 92px;
  white-space: nowrap;
  font-weight: 700;
}

.slot {
  min-height: 88px;
  background: #fbfdff;
  transition: background 0.2s ease;
}

.slot.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.slot.has-conflict {
  background: #ffe2e6;
}

.slot.has-warning {
  background: #fff3d9;
}

.event {
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 6px;
  border: 1px solid #c9d9ec;
  background: #eef5ff;
  cursor: grab;
}

.event small {
  display: block;
  color: #34495e;
  line-height: 1.3;
}

.event.conflict {
  border-color: #d7263d;
  box-shadow: inset 0 0 0 1px #d7263d;
}

.event.warning {
  border-color: #f0a202;
}

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

.error-list {
  margin: 0;
  padding-left: 18px;
  max-height: 220px;
  overflow: auto;
}

.badge {
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 2px 8px;
  color: #fff;
  font-weight: 700;
}

.badge.high {
  background: var(--danger);
}

.badge.medium {
  background: var(--warn);
  color: #3d2a00;
}

.badge.low {
  background: var(--ok);
}

.indicator-block {
  margin-bottom: 12px;
}

.indicator-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.indicator-block li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 7px;
  background: #fff;
  min-width: 0;
}

.indicator-block li span,
.indicator-block li strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-stack {
  display: grid;
  gap: 12px;
}

.import-box {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #f9fcff;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.meta-text {
  color: var(--muted);
  margin: 0 0 8px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 24, 39, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1000;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.availability-grid {
  display: grid;
  grid-template-columns: 120px repeat(5, minmax(90px, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.availability-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  font-size: 0.85rem;
  background: #f8fcff;
  overflow-wrap: anywhere;
}

.availability-cell.head {
  font-weight: 700;
  background: #eef5ff;
}

.availability-cell.slot {
  cursor: pointer;
}

.availability-cell.slot.off {
  background: #ffe6ea;
  border-color: #ffc2cc;
  color: #842033;
}

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

.summary-stat {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

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

.summary-stat strong {
  display: block;
  font-size: 1.25rem;
  margin-top: 2px;
}

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

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