:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111827;
  --success: #157347;
  --warning: #b7791f;
  --danger: #b42318;
  --blue: #1d4ed8;
  --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar nav { display: flex; gap: 14px; color: var(--muted); font-size: 14px; }
.topbar nav a:hover { color: var(--text); }
.muted { color: var(--muted); }
.layout { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 64px); }
.sidebar {
  padding: 18px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow: auto;
}
.content { padding: 24px; overflow: auto; }
.panel-heading, .content-header, .shift-head, .status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 26px; margin-bottom: 4px; }
h2 { font-size: 17px; }
.badge, .coverage, .status-badge, .event-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}
.search, input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  background: white;
  margin: 6px 0 12px;
}
.legend { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.dot-free { background: var(--success); }
.dot-busy { background: var(--warning); }
.guards-list { display: grid; gap: 10px; }
.guard-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  cursor: grab;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
}
.guard-card:active { cursor: grabbing; }
.guard-card strong, .guard-card span, .guard-card small { display: block; }
.guard-card span, .guard-card small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.guard-card.free { border-left: 5px solid var(--success); }
.guard-card.busy { border-left: 5px solid var(--warning); }
.guard-card.dragging { opacity: .55; }
.shifts-board { display: grid; gap: 26px; }
.date-section h2 { margin: 0 0 12px; text-transform: capitalize; }
.shift-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 14px; }
.shift-card {
  background: var(--panel);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 15px;
  box-shadow: var(--shadow);
  min-height: 215px;
}
.shift-card.missing { border-color: rgba(183, 121, 31, .28); }
.shift-card.covered { border-color: rgba(21, 115, 71, .22); }
.shift-card.drop-hover { outline: 3px dashed var(--blue); background: #eef6ff; }
.shift-head strong, .shift-head span { display: block; }
.shift-head span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.coverage.ok { background: #dcfce7; color: var(--success); }
.coverage.warn { background: #fef3c7; color: var(--warning); }
.shift-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; font-size: 13px; color: var(--muted); }
.event-pill { background: #e0f2fe; color: #075985; }
.shift-note { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.assigned-list { display: grid; gap: 8px; }
.assigned-chip {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  font-size: 13px;
}
.assigned-chip small { color: var(--muted); }
.assigned-chip button { border: 0; background: transparent; color: var(--danger); font-size: 18px; cursor: pointer; }
.status-confirmed { border-left: 4px solid var(--success); }
.status-proposed { border-left: 4px solid var(--warning); }
.status-declined { border-left: 4px solid var(--danger); }
.status-done { border-left: 4px solid var(--blue); }
.missing-note {
  border: 1px dashed var(--warning);
  color: var(--warning);
  background: #fffbeb;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
}
button, .primary-btn, .secondary-btn, .danger-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 700;
  cursor: pointer;
}
.primary-btn { background: var(--primary); color: white; }
.secondary-btn { background: #e5e7eb; color: var(--text); }
.danger-btn { background: #fee2e2; color: var(--danger); }
.full { width: 100%; }
.alert { border-radius: 14px; padding: 12px; margin: 12px 0; font-weight: 650; }
.alert-success { background: #dcfce7; color: var(--success); }
.alert-error { background: #fee2e2; color: var(--danger); }
.alert-warning { background: #fef3c7; color: var(--warning); }
.alert-info { background: #e0f2fe; color: #075985; }
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.login-card {
  width: min(420px, 100%);
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.login-card.wide { width: min(620px, 100%); }
.login-card label { display: block; margin: 12px 0 4px; font-weight: 700; }
.demo-credentials { margin-top: 18px; padding: 12px; background: #f9fafb; border-radius: 14px; color: var(--muted); font-size: 13px; }
.mobile-page { width: min(820px, 100%); margin: 0 auto; padding: 24px; }
.my-schedule-list { display: grid; gap: 14px; }
.my-shift-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.my-shift-date { color: var(--muted); font-size: 13px; text-transform: capitalize; margin-bottom: 6px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { background: white; border: 1px solid var(--border); border-radius: 18px; padding: 24px; color: var(--muted); }
.manage-panel {
  margin: 0 0 18px;
  padding: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.manage-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.manage-header h2 { margin: 0; }
.manage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.manage-form {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f9fafb;
}
.manage-form h3 { margin: 0 0 3px; font-size: 16px; }
.manage-form input,
.manage-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px;
  min-height: 40px;
  background: white;
}
.manage-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.manage-form label input,
.manage-form label select {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}
.manage-page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 44px;
}
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.manage-grid-page {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}
.manage-grid-page .manage-form {
  background: white;
  box-shadow: var(--shadow);
}
.manage-lists {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.manage-lists > div {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.manage-lists h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
.simple-list {
  display: grid;
  gap: 8px;
}
.simple-list > div {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: #f9fafb;
}
.simple-list strong,
.simple-list span {
  display: block;
}
.simple-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}
.form-row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 850px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); }
  .content { padding: 16px; }
  .content-header { align-items: flex-start; flex-direction: column; }
  .manage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manage-lists { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .manage-grid,
  .manage-lists,
  .form-row.two { grid-template-columns: 1fr; }
}


/* v2: izbira dneva v razporedu */
.date-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px 0;
}

.date-tab {
  border: 1px solid #d0d7de;
  background: #fff;
  border-radius: 999px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 600;
}

.date-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}
