:root {
  --space: 4px;
  --gap: 4px;
  --radius: 6px;
  /* Sdílené s FullCalendar (calendar.js :root --fc-button-*) a .common-btn */
  --btn-primary: #4444ef;
  --btn-primary-hover: #3838d9;
  --btn-primary-active: #3232c4;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  margin: var(--space);
  background: #e2e8f0;
  position: relative;
  min-height: 100vh;
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space);
  border-radius: var(--radius);
  background: #f8f9fa;
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.main-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--gap);
}

.panel {
  background: white;
  padding: var(--space);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.panel-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  font-size: 0.85rem;
  margin: 0 0 var(--gap) 0;
  color: #475569;
  text-transform: uppercase;
  font-weight: bold;
  line-height: 1.2;
}

.kanban-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--gap);
  margin: 0;
}

.kanban-column {
  background: #e2e8f0;
  border-radius: var(--radius);
  padding: var(--space);
  min-height: 8rem;
  display: flex;
  flex-direction: column;
}

.kanban-column h3 {
  font-size: 0.7rem;
  margin: 0 0 var(--gap) 0;
  text-align: center;
  color: #475569;
  text-transform: uppercase;
  font-weight: bold;
  line-height: 1.2;
}

.kanban-list {
  flex-grow: 1;
  min-height: 3rem;
}

.kanban-card {
  background: white;
  padding: var(--space);
  margin-bottom: var(--gap);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: grab;
  border-left: 3px solid #3b82f6;
  font-size: 0.75rem;
  line-height: 1.25;
}

.kanban-card:last-child {
  margin-bottom: 0;
}

.kanban-card--selected {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

.panel-title-actions {
  display: flex;
  gap: var(--gap);
}

.sortable-ghost {
  opacity: 0.4;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
  margin: 0 0 var(--gap) 0;
}

.header-bar h1 {
  font-size: 0.95rem;
  margin: 0;
  color: #1e293b;
  line-height: 1.2;
}

.logout-btn,
.common-btn {
  padding: 5px 10px;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: bold;
  line-height: 1.2;
  border: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.logout-btn {
  background: #ef4444;
}

.common-btn {
  background: var(--btn-primary);
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 350px;
  text-align: center;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 8px;
  margin-bottom: var(--gap);
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-sizing: border-box;
}

.login-box button {
  width: 100%;
  padding: 8px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.error {
  color: #ef4444;
  font-size: 0.85rem;
  margin-bottom: var(--gap);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-dialog {
  width: min(380px, calc(100vw - 16px));
  background-color: white;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  font-family: sans-serif;
}

.modal-header {
  background-color: #3b82f6;
  color: white;
  padding: 8px 10px;
  font-weight: bold;
  font-size: 0.85rem;
}

.modal-body {
  padding: var(--space);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.modal-input {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
}

.modal-footer {
  padding: 0 var(--space) var(--space) var(--space);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
}

.modal-footer-actions {
  display: flex;
  gap: var(--gap);
}

.modal-btn {
  padding: 6px 10px;
  min-height: 2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.75rem;
}

.modal-btn--close {
  background-color: #e2e8f0;
  color: #475569;
}

.modal-btn--save {
  background-color: #3b82f6;
  color: white;
}

.modal-btn--delete {
  background-color: #ef4444;
  color: white;
  font-size: 0.75rem;
}

.event-detail-panel {
  scroll-margin-top: var(--space);
  margin: 0;
}

.event-detail-content {
  display: flex;
  flex-direction: column;
}

.event-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 0;
  border-bottom: 1px solid #cbd5e1;
}

.event-tab {
  padding: 6px 10px;
  min-height: 2rem;
  border: 1px solid #cbd5e1;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  margin-bottom: -1px;
  line-height: 1.2;
}

.event-tab:hover {
  background: #d8dee8;
}

.event-tab.is-active {
  background: #4444ef;
  color: #fff;
  border-color: #4444ef;
  position: relative;
  z-index: 1;
}

.event-tab-body {
  border: 1px solid #cbd5e1;
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: var(--space);
  background: #fff;
}

.event-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--gap);
  margin-bottom: var(--gap);
}

.event-detail-header .panel-title {
  margin-bottom: 0;
}

.event-detail-placeholder {
  color: #64748b;
  font-size: 0.8rem;
  margin: 0;
}

.event-google-info {
  background: #f1f5f9;
  border-radius: 4px;
  padding: var(--space);
  margin: 0 0 var(--gap) 0;
  border-left: 3px solid transparent;
}

.event-google-info--colored {
  border-left-color: var(--event-color);
  background: color-mix(in srgb, var(--event-color) 14%, #f1f5f9);
}

.event-google-title {
  font-weight: bold;
  color: #1e293b;
  margin: 0 0 2px 0;
  font-size: 0.85rem;
  line-height: 1.25;
}

.event-meta {
  color: #64748b;
  font-size: 0.75rem;
  margin: 0;
  line-height: 1.25;
}

.event-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  margin: 0;
}

.event-view-item dt {
  font-size: 0.7rem;
  font-weight: bold;
  color: #64748b;
  margin-bottom: 2px;
}

.event-view-item dd {
  margin: 0;
  color: #1e293b;
  font-size: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.25;
}

.event-view-item--wide {
  grid-column: 1 / -1;
}

.event-look-form {
  margin-bottom: var(--gap);
}

.event-look-input-row {
  display: flex;
  gap: var(--gap);
  flex-wrap: wrap;
}

.event-look-input-row input {
  flex: 1 1 120px;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
  min-height: 2rem;
}

.event-look-status {
  color: #64748b;
  font-size: 0.75rem;
  margin: 0 0 var(--gap) 0;
}

.event-look-results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.event-look-item {
  display: flex;
  align-items: center;
  gap: var(--gap);
  padding: var(--space);
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}

.event-look-item:last-child {
  border-bottom: none;
}

.event-look-item:hover {
  background: #f8fafc;
}

.event-look-item.is-active {
  background: #eef2ff;
}

.event-look-date {
  flex-shrink: 0;
  padding: 2px 6px;
  min-height: 1.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f1f5f9;
  color: #1e293b;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

.event-look-date:hover {
  background: #e2e8f0;
}

.event-look-title {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.25;
}

.event-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.event-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-field span {
  font-size: 0.7rem;
  font-weight: bold;
  color: #475569;
}

.event-field input,
.event-field textarea {
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.8rem;
}

.event-field textarea {
  resize: vertical;
}

.event-field--wide {
  grid-column: 1 / -1;
}

.event-form-footer {
  display: flex;
  align-items: center;
  gap: var(--gap);
  margin-top: var(--gap);
}

.event-save-status {
  color: #16a34a;
  font-size: 0.75rem;
}

.common-btn:disabled {
  background: #e2e8f0;
  color: #64748b;
  opacity: 1;
  cursor: not-allowed;
}

@media (max-width: 900px) {
  .main-layout,
  .event-form-grid,
  .event-view-grid {
    grid-template-columns: 1fr;
  }

  .event-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  :root {
    --space: 4px;
  }

  .kanban-board {
    grid-template-columns: 1fr;
  }

  .header-bar h1 {
    font-size: 0.9rem;
  }
}
