:root {
  --bg: #07111d;
  --bg-2: #0a1728;
  --panel: rgba(12, 24, 42, 0.9);
  --panel-2: rgba(16, 31, 53, 0.94);
  --line: rgba(137, 161, 201, 0.16);
  --line-strong: rgba(137, 161, 201, 0.26);
  --text: #f0f5ff;
  --text-soft: #c7d4e7;
  --muted: #8da0bb;
  --accent: #4f8cff;
  --accent-2: #2fd39a;
  --accent-warm: #ff8b49;
  --danger: #ff6f7d;
  --shadow: 0 24px 80px rgba(2, 10, 24, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(79, 140, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 139, 73, 0.12), transparent 22%),
    linear-gradient(180deg, #08111d 0%, #06101a 100%);
}

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

button,
input,
select,
textarea {
  border-radius: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(6, 16, 29, 0.84);
  color: var(--text);
  outline: none;
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input::placeholder,
textarea::placeholder {
  color: #7d90ab;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(79, 140, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.12);
  background: rgba(9, 22, 38, 0.96);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  border: 1px solid var(--line);
  background: rgba(20, 37, 60, 0.84);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 140, 255, 0.32);
  background: rgba(26, 48, 77, 0.96);
}

button.primary,
button.active {
  border-color: rgba(79, 140, 255, 0.34);
  background: linear-gradient(135deg, var(--accent) 0%, #2d6ef1 100%);
  color: #fff;
}

button.secondary {
  border-color: rgba(255, 139, 73, 0.22);
  background: rgba(255, 139, 73, 0.12);
  color: #ffd9c5;
}

button.ghost {
  background: transparent;
}

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

a {
  color: #a8c5ff;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 16px 0;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.status.novy {
  color: #ffd9c5;
  background: rgba(255, 139, 73, 0.14);
  border-color: rgba(255, 139, 73, 0.2);
}

.status.vybavene {
  color: #d3ffe9;
  background: rgba(47, 211, 154, 0.14);
  border-color: rgba(47, 211, 154, 0.2);
}

.status.riesi_sa {
  color: #d9e7ff;
  background: rgba(79, 140, 255, 0.14);
  border-color: rgba(79, 140, 255, 0.2);
}

.status.archivovane {
  color: #d6deec;
  background: rgba(141, 160, 187, 0.14);
  border-color: rgba(141, 160, 187, 0.2);
}

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

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.card,
.auth,
.admin-panel,
.admin-sidebar,
.modal-card,
.flash-card {
  background: linear-gradient(180deg, rgba(14, 27, 47, 0.95) 0%, rgba(10, 21, 37, 0.96) 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth {
  width: min(460px, 100%);
  border-radius: 28px;
  padding: 28px;
}

.auth h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  letter-spacing: -0.03em;
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}

.admin-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
}

.sidebar-top {
  display: grid;
  gap: 16px;
}

.brand-block h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.sidebar-create {
  width: 100%;
}

.project-filters,
.segmented {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.project-filters button,
.segmented button {
  min-width: 0;
  padding: 8px 12px;
  background: transparent;
  border-color: transparent;
  color: var(--text-soft);
}

.project-filters button.active {
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.96) 0%, rgba(45, 110, 241, 0.96) 100%);
  border-color: rgba(79, 140, 255, 0.42);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(79, 140, 255, 0.28);
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(255, 139, 73, 0.96) 0%, rgba(216, 91, 32, 0.96) 100%);
  border-color: rgba(255, 139, 73, 0.36);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(216, 91, 32, 0.24);
}

.sidebar-projects {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-right: 6px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.project-button,
.project-menu {
  height: 48px;
}

.project-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 16px;
}

.project-item.is-active .project-button {
  border-color: rgba(79, 140, 255, 0.36);
  background: rgba(79, 140, 255, 0.12);
}

.project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-count {
  min-width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 139, 73, 0.14);
  color: #ffd9c5;
  font-weight: 700;
  font-size: 12px;
}

.project-menu,
.icon-button {
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  border-radius: 14px;
}

.sidebar-bottom {
  padding-top: 8px;
}

.sidebar-logout {
  width: 100%;
}

.admin-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  overflow: hidden;
}

.flash-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-radius: 20px;
  padding: 14px 16px;
}

.flash-card.is-error {
  border-color: rgba(255, 111, 125, 0.22);
}

.flash-main {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.flash-actions {
  display: flex;
  gap: 8px;
}

.admin-columns {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 0.9fr);
  gap: 16px;
  min-height: 0;
}

.admin-panel {
  border-radius: 28px;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-panel--detail {
  grid-template-rows: minmax(0, 1fr);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2,
.panel-head h3 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.panel-head h2 {
  font-size: 28px;
}

.panel-head h3 {
  font-size: 28px;
}

.panel-head p {
  margin: 0;
}

.project-url {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 13px;
  text-decoration: none;
  word-break: break-all;
}

.project-url:hover {
  color: #ffffff;
  text-decoration: underline;
}

.panel-search {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.comment-list,
.detail-scroll {
  min-height: 0;
  overflow: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.comment-row {
  width: 100%;
  display: grid;
  grid-template-columns: 70px 88px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  text-align: left;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}

.comment-row.is-active {
  border-color: rgba(79, 140, 255, 0.34);
  background: rgba(79, 140, 255, 0.12);
}

.comment-row.is-resolved {
  border-color: rgba(47, 211, 154, 0.26);
  background: rgba(47, 211, 154, 0.1);
}

.comment-row.is-active.is-resolved {
  border-color: rgba(47, 211, 154, 0.38);
  background: rgba(47, 211, 154, 0.16);
}

.comment-row__number,
.comment-row__type,
.comment-row__date {
  white-space: nowrap;
}

.comment-row__number {
  font-weight: 700;
}

.comment-row__type,
.comment-row__date {
  color: var(--muted);
  font-size: 13px;
}

.comment-row__message {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-empty {
  padding: 24px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.detail-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-summary-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.detail-section h4 {
  margin: 0 0 12px;
}

.detail-summary p {
  margin: 0 0 10px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.messages {
  display: grid;
  gap: 10px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.message.agency {
  background: rgba(79, 140, 255, 0.08);
}

.message-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 6px;
}

.message p {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 10, 20, 0.62);
  backdrop-filter: blur(12px);
  z-index: 1000;
  padding: 24px;
  overflow: auto;
}

.modal-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.modal-shell--narrow {
  width: min(720px, 100%);
}

.modal-card {
  border-radius: 30px;
  padding: 14px;
}

.modal-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-project-head,
.modal-actions,
.mini-card__head,
.link-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal-project-head {
  align-items: flex-start;
}

.modal-head h3,
.pane-head h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
}

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

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

.modal-pane {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.pane-head {
  margin-bottom: 8px;
}

.modal-inline,
.inline-form,
.compact-form-row.two {
  display: grid;
  gap: 8px;
}

.modal-inline {
  grid-template-columns: minmax(0, 1fr) auto;
}

.modal-inline--wide {
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.inline-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

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

.mini-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.snippet-card {
  margin-bottom: 10px;
}

.snippet-note,
.form-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.snippet-code {
  min-height: 64px;
  resize: none;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.link-row {
  align-items: stretch;
  flex-wrap: wrap;
  margin-top: 8px;
}

.link-url {
  flex: 1 1 320px;
  min-width: 220px;
}

.icon-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.modal-close {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 28px;
  line-height: 1;
  border-radius: 14px;
}

.empty-state {
  padding: 6px 2px;
}

@media (max-width: 1199px) {
  .admin-shell,
  .admin-columns,
  .modal-grid {
    grid-template-columns: 1fr;
  }
}
