/* =========================================================
   ESD – Stavební deník
   Modern design system
   ========================================================= */

:root {
  /* Surface */
  --bg:               #f5f7fa;
  --surface:          #ffffff;
  --surface-soft:     #f8fafc;
  --surface-hover:    #f1f5f9;
  --border:           #e2e8f0;
  --border-strong:    #cbd5e1;
  --divider:          #eef1f5;

  /* Text */
  --text:             #0f172a;
  --text-soft:        #334155;
  --text-muted:       #64748b;
  --text-disabled:    #94a3b8;
  --text-inverse:     #ffffff;

  /* Accent */
  --accent:           #0f172a;
  --accent-hover:     #1e293b;
  --accent-soft:      #f1f5f9;

  /* Semantic */
  --green:            #16a34a;
  --green-soft:       #ecfdf5;
  --green-text:       #166534;
  --amber:            #d97706;
  --amber-soft:       #fef3c7;
  --amber-text:       #92400e;
  --red:              #dc2626;
  --red-soft:         #fef2f2;
  --red-text:         #991b1b;
  --blue:             #2563eb;
  --blue-soft:        #eff6ff;
  --blue-text:        #1e40af;

  /* Sizing */
  --radius-sm:        6px;
  --radius:           10px;
  --radius-lg:        14px;
  --radius-pill:      999px;

  --shadow-sm:        0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow:           0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg:        0 10px 25px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);

  --sidebar-width:    260px;

  --font:             -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
                      Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono:        "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* =========================================================
   Reset / base
   ========================================================= */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

h1 { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 0 0 14px; color: var(--text); letter-spacing: -0.005em; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--text); }
p  { margin: 0 0 12px; }
small { font-size: 12px; color: var(--text-muted); }

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

::selection { background: rgba(15, 23, 42, 0.12); }

/* =========================================================
   Layout / sidebar
   ========================================================= */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #0f172a;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 20px;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 24px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 18px;
}

.sidebar-header .brand-mark {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #0f172a;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.sidebar-header .brand-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sidebar-header .brand-sub {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: #cbd5e1;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-item:hover {
  background: #1e293b;
  color: #ffffff;
  text-decoration: none;
}
.nav-item.active {
  background: #1e293b;
  color: #ffffff;
}
.nav-item .icon { flex-shrink: 0; color: inherit; opacity: 0.85; }

.sidebar-section-label {
  padding: 14px 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: #1e293b;
}
.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #475569;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-user .name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .role {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
}
.sidebar-user .info { flex: 1; min-width: 0; }

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.btn-logout:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #475569;
  text-decoration: none;
}

/* Content area */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 36px 48px;
  min-height: 100vh;
}
.main { max-width: 1280px; margin: 0 auto; }

@media (max-width: 900px) {
  .sidebar { width: 220px; }
  .content { margin-left: 220px; padding: 20px 18px 32px; }
}

/* =========================================================
   Cards
   ========================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.card h2 {
  margin: 0 0 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--divider);
}

.card.collapsible > summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card.collapsible > summary::-webkit-details-marker { display: none; }
.card.collapsible > summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg);
  margin-left: auto;
  transition: transform 0.15s ease;
}
.card.collapsible[open] > summary::after { transform: rotate(45deg); }
.card.collapsible > div:not(.summary-extra) { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--divider); }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-soft);
  border-color: var(--text-muted);
  color: var(--text);
  text-decoration: none;
}

.btn-success {
  background: var(--green);
  color: var(--text-inverse);
  border-color: var(--green);
}
.btn-success:hover {
  background: #15803d;
  border-color: #15803d;
  color: var(--text-inverse);
  text-decoration: none;
}

.btn-danger {
  background: var(--surface);
  color: var(--red);
  border-color: #fecaca;
}
.btn-danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red-text);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.btn .icon { flex-shrink: 0; }

.btn-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* =========================================================
   Forms
   ========================================================= */

.row {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}
.row > .full { flex: 1 1 100%; }
.row > .half { flex: 1 1 calc(50% - 7px); min-width: 0; }
.row > .third { flex: 1 1 calc(33.333% - 9.33px); min-width: 0; }

.field-label,
.row label > span,
.row > .half > label:first-child,
.row > .full > label:first-child,
.row > .third > label:first-child {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input,
input[type="text"].input,
input[type="email"].input,
input[type="password"].input,
input[type="number"].input,
input[type="date"].input,
input[type="time"].input,
input[type="tel"].input,
input[type="url"].input,
select.input,
textarea.input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input:focus,
input.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.input { resize: vertical; min-height: 80px; }

input[type="file"].input {
  padding: 8px;
  background: var(--surface-soft);
}

.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  flex-wrap: wrap;
}

/* details/expandable */
details.field-group {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
details.field-group[open] { background: var(--surface); }
details.field-group > summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
details.field-group > summary::-webkit-details-marker { display: none; }
details.field-group > summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  transform: rotate(-45deg);
  margin-left: auto;
  transition: transform 0.15s ease;
}
details.field-group[open] > summary::after { transform: rotate(45deg); }
details.field-group > div { margin-top: 14px; }

/* =========================================================
   Tables
   ========================================================= */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--divider);
}

.table thead th {
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.table tbody tr:hover { background: var(--surface-soft); }
.table tbody tr:last-child td { border-bottom: 0; }

/* legacy class kept for parity */
.overview-table { width: 100%; }

/* =========================================================
   Alerts
   ========================================================= */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert-success { background: var(--green-soft); border-color: #bbf7d0; color: var(--green-text); }
.alert-error   { background: var(--red-soft);   border-color: #fecaca; color: var(--red-text); }
.alert-warning { background: var(--amber-soft); border-color: #fde68a; color: var(--amber-text); }
.alert-info    { background: var(--blue-soft);  border-color: #bfdbfe; color: var(--blue-text); }

/* =========================================================
   Badges
   ========================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-success { background: var(--green-soft); color: var(--green-text); border-color: #bbf7d0; }
.badge-warning { background: var(--amber-soft); color: var(--amber-text); border-color: #fde68a; }
.badge-danger  { background: var(--red-soft);   color: var(--red-text);   border-color: #fecaca; }
.badge-info    { background: var(--blue-soft);  color: var(--blue-text);  border-color: #bfdbfe; }
.badge-neutral { background: var(--surface-soft); color: var(--text-muted); border-color: var(--border); }

.badge .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* =========================================================
   Page header
   ========================================================= */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 22px;
}
.page-header .breadcrumb {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.page-header .breadcrumb a { color: var(--text-muted); font-weight: 500; }
.page-header .breadcrumb a:hover { color: var(--text); }
.page-header h1 { margin: 0; }
.page-header .meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.page-header .meta strong { color: var(--text); font-weight: 600; }
.page-header .meta-sep { color: var(--border-strong); margin: 0 8px; }
.page-header .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   Photos / gallery
   ========================================================= */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.photo-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.photo-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.photo-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.photo-item .photo-desc {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--divider);
}

/* Lightbox */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.92);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 6px; }
.gallery-lightbox button {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
}

/* =========================================================
   Comment box (entries)
   ========================================================= */

.comment {
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.comment.customer {
  background: var(--amber-soft);
  border-color: #fde68a;
}
.comment .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.comment .meta strong { color: var(--text); font-weight: 600; }
.comment .body { white-space: pre-wrap; color: var(--text-soft); font-size: 13px; }

/* =========================================================
   Empty state
   ========================================================= */

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-title { font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* =========================================================
   Compliance callout
   ========================================================= */

.compliance-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--amber-soft);
  border: 1px solid #fde68a;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--amber-text);
}
.compliance-notice strong { color: var(--amber-text); font-weight: 600; }

/* =========================================================
   Status pills (diary entries)
   ========================================================= */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
}
.status-pill.draft  { background: var(--amber-soft); color: var(--amber-text); border-color: #fde68a; }
.status-pill.signed { background: var(--green-soft); color: var(--green-text); border-color: #bbf7d0; }
.status-pill.locked { background: var(--surface-soft); color: var(--text-soft); border-color: var(--border-strong); }
.status-pill .dot {
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

/* =========================================================
   Utility
   ========================================================= */

.muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.fw-600 { font-weight: 600; }
.text-mono { font-family: var(--font-mono); }

.flex      { display: flex; }
.flex-col  { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.flex-grow { flex-grow: 1; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Tile-style stat box */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.tile .tile-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.tile .tile-value { font-size: 22px; font-weight: 700; color: var(--text); }

/* SVG icons */
.icon {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 1.6;
}

/* =========================================================
   Row actions – primary button + kebab dropdown
   ========================================================= */

.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.action-menu {
  position: relative;
  display: inline-block;
}
.action-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary:hover {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--text-muted);
}
.action-menu[open] > summary {
  background: var(--surface-soft);
  color: var(--text);
  border-color: var(--text-muted);
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: action-menu-in 0.12s ease-out;
}

@keyframes action-menu-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.action-menu-item {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.1s ease;
}
.action-menu-item:hover {
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}
.action-menu-item.danger {
  color: var(--red);
}
.action-menu-item.danger:hover {
  background: var(--red-soft);
  color: var(--red-text);
}

.action-menu-divider {
  height: 1px;
  background: var(--divider);
  margin: 4px 0;
}

/* Pretty `<details>` summary in cards */
details > summary {
  list-style: none;
}
details > summary::-webkit-details-marker { display: none; }

/* =========================================================
   Auth pages – velký login s animovaným gradient pozadím
   ========================================================= */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #e8f0ff 0%, #dbe6f7 45%, #cad8ed 100%);
  position: relative;
  overflow: hidden;
}

/* Velké zářící gradient bloby – víc barev, výraznější pohyb */
.auth-shell::before,
.auth-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}
.auth-shell::before {
  width: 900px;
  height: 900px;
  background: radial-gradient(circle at 30% 30%, #2196f3 0%, transparent 62%);
  top: -280px;
  left: -220px;
  opacity: 0.78;
  animation: blob-float-a 18s ease-in-out infinite;
}
.auth-shell::after {
  width: 820px;
  height: 820px;
  background: radial-gradient(circle at 70% 70%, #1e3a8a 0%, transparent 62%);
  bottom: -320px;
  right: -240px;
  opacity: 0.62;
  animation: blob-float-b 22s ease-in-out infinite;
}

.auth-shell .blob-c {
  position: absolute;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #38bdf8 0%, transparent 65%);
  filter: blur(110px);
  opacity: 0.55;
  top: 50%;
  left: 50%;
  z-index: 0;
  animation: blob-float-c 24s ease-in-out infinite;
}

/* Čtvrtý a pátý blob – cyan a indigo */
.auth-shell .blob-d {
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #06b6d4 0%, transparent 65%);
  filter: blur(100px);
  opacity: 0.5;
  top: 12%;
  right: 14%;
  z-index: 0;
  animation: blob-float-d 16s ease-in-out infinite;
}
.auth-shell .blob-e {
  position: absolute;
  width: 580px;
  height: 580px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #6366f1 0%, transparent 65%);
  filter: blur(110px);
  opacity: 0.45;
  bottom: 8%;
  left: 10%;
  z-index: 0;
  animation: blob-float-e 20s ease-in-out infinite;
}

@keyframes blob-float-a {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  25%      { transform: translate(180px, 120px) scale(1.2) rotate(60deg); }
  50%      { transform: translate(80px, 220px) scale(1.1) rotate(120deg); }
  75%      { transform: translate(220px, 80px) scale(1.25) rotate(180deg); }
}
@keyframes blob-float-b {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%      { transform: translate(-160px, -140px) scale(1.25) rotate(-90deg); }
  66%      { transform: translate(-80px, -240px) scale(1.1) rotate(-180deg); }
}
@keyframes blob-float-c {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95) rotate(0deg); }
  33%      { transform: translate(-30%, -55%) scale(1.3) rotate(120deg); }
  66%      { transform: translate(-60%, -40%) scale(1.15) rotate(240deg); }
}
@keyframes blob-float-d {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-200px, 180px) scale(1.3); }
}
@keyframes blob-float-e {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(220px, -160px) scale(1.25); }
}

/* Skrolující blueprint mřížka – výraznější, pulzující */
.auth-shell .grid-overlay {
  position: absolute;
  inset: -100px;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  pointer-events: none;
  z-index: 0;
  animation: grid-drift 22s linear infinite, grid-pulse 5s ease-in-out infinite;
}

@keyframes grid-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 112px 112px; }
}
@keyframes grid-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* Diagonální světelné pruhy přejíždějící obrazovku */
.auth-shell .streaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-shell .streaks i {
  position: absolute;
  width: 260px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(33, 150, 243, 0.85), transparent);
  filter: blur(0.5px);
  transform-origin: left center;
  animation: streak-sweep linear infinite;
}
@keyframes streak-sweep {
  0%   { transform: translate(-300px, 0) rotate(-22deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(110vw, 0) rotate(-22deg); opacity: 0; }
}
.auth-shell .streaks i:nth-child(1) { top: 12%; animation-duration: 8s;  animation-delay: -1s; }
.auth-shell .streaks i:nth-child(2) { top: 28%; animation-duration: 11s; animation-delay: -5s; width: 180px; }
.auth-shell .streaks i:nth-child(3) { top: 52%; animation-duration:  9s; animation-delay: -3s; width: 320px; }
.auth-shell .streaks i:nth-child(4) { top: 71%; animation-duration: 13s; animation-delay: -7s; }
.auth-shell .streaks i:nth-child(5) { top: 88%; animation-duration: 10s; animation-delay: -2s; width: 240px; }

/* Animovaná vlna dole */
.auth-shell .wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 140px;
  pointer-events: none;
  z-index: 0;
}
.auth-shell .wave svg { width: 100%; height: 100%; display: block; }
.auth-shell .wave svg path { animation: wave-shift 12s ease-in-out infinite; }
.auth-shell .wave svg path:nth-child(2) { animation-duration: 16s; animation-delay: -3s; }
.auth-shell .wave svg path:nth-child(3) { animation-duration: 20s; animation-delay: -7s; }

@keyframes wave-shift {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-40px); }
}

/* Plovoucí částice – víc, větší, jasnější */
.auth-shell .particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-shell .particles span {
  position: absolute;
  bottom: -10px;
  background: radial-gradient(circle, rgba(33, 150, 243, 0.85) 0%, rgba(33, 150, 243, 0.3) 50%, transparent 70%);
  border-radius: 50%;
  animation: particle-rise linear infinite;
  box-shadow: 0 0 12px rgba(33, 150, 243, 0.6);
}
@keyframes particle-rise {
  0%   { transform: translateY(0) scale(0.5); opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) scale(1.3); opacity: 0; }
}

/* 32 individuálních particles */
.auth-shell .particles span:nth-child(1)  { left:  3%; width:  8px; height:  8px; animation-duration: 14s; animation-delay:  -2s; }
.auth-shell .particles span:nth-child(2)  { left:  8%; width:  5px; height:  5px; animation-duration: 18s; animation-delay:  -8s; }
.auth-shell .particles span:nth-child(3)  { left: 13%; width: 10px; height: 10px; animation-duration: 11s; animation-delay: -15s; }
.auth-shell .particles span:nth-child(4)  { left: 18%; width:  4px; height:  4px; animation-duration: 22s; animation-delay:  -5s; }
.auth-shell .particles span:nth-child(5)  { left: 23%; width:  7px; height:  7px; animation-duration: 16s; animation-delay: -12s; }
.auth-shell .particles span:nth-child(6)  { left: 28%; width:  9px; height:  9px; animation-duration: 13s; animation-delay:  -3s; }
.auth-shell .particles span:nth-child(7)  { left: 33%; width:  5px; height:  5px; animation-duration: 20s; animation-delay: -18s; }
.auth-shell .particles span:nth-child(8)  { left: 38%; width:  8px; height:  8px; animation-duration: 17s; animation-delay:  -7s; }
.auth-shell .particles span:nth-child(9)  { left: 43%; width:  4px; height:  4px; animation-duration: 24s; animation-delay: -22s; }
.auth-shell .particles span:nth-child(10) { left: 48%; width:  6px; height:  6px; animation-duration: 14s; animation-delay: -10s; }
.auth-shell .particles span:nth-child(11) { left: 53%; width:  9px; height:  9px; animation-duration: 18s; animation-delay:  -4s; }
.auth-shell .particles span:nth-child(12) { left: 58%; width:  5px; height:  5px; animation-duration: 16s; animation-delay: -14s; }
.auth-shell .particles span:nth-child(13) { left: 63%; width:  8px; height:  8px; animation-duration: 12s; animation-delay: -19s; }
.auth-shell .particles span:nth-child(14) { left: 68%; width:  4px; height:  4px; animation-duration: 22s; animation-delay:  -6s; }
.auth-shell .particles span:nth-child(15) { left: 73%; width:  6px; height:  6px; animation-duration: 17s; animation-delay: -25s; }
.auth-shell .particles span:nth-child(16) { left: 78%; width: 10px; height: 10px; animation-duration: 19s; animation-delay: -11s; }
.auth-shell .particles span:nth-child(17) { left: 83%; width:  5px; height:  5px; animation-duration: 14s; animation-delay: -16s; }
.auth-shell .particles span:nth-child(18) { left: 88%; width:  8px; height:  8px; animation-duration: 18s; animation-delay:  -9s; }
.auth-shell .particles span:nth-child(19) { left: 93%; width:  6px; height:  6px; animation-duration: 16s; animation-delay: -13s; }
.auth-shell .particles span:nth-child(20) { left: 96%; width:  4px; height:  4px; animation-duration: 21s; animation-delay: -20s; }
.auth-shell .particles span:nth-child(21) { left:  5%; width:  6px; height:  6px; animation-duration: 19s; animation-delay: -23s; }
.auth-shell .particles span:nth-child(22) { left: 17%; width:  9px; height:  9px; animation-duration: 15s; animation-delay: -17s; }
.auth-shell .particles span:nth-child(23) { left: 27%; width:  4px; height:  4px; animation-duration: 23s; animation-delay:  -8s; }
.auth-shell .particles span:nth-child(24) { left: 36%; width:  7px; height:  7px; animation-duration: 13s; animation-delay: -21s; }
.auth-shell .particles span:nth-child(25) { left: 45%; width:  5px; height:  5px; animation-duration: 17s; animation-delay: -12s; }
.auth-shell .particles span:nth-child(26) { left: 56%; width: 10px; height: 10px; animation-duration: 11s; animation-delay:  -5s; }
.auth-shell .particles span:nth-child(27) { left: 65%; width:  4px; height:  4px; animation-duration: 25s; animation-delay: -27s; }
.auth-shell .particles span:nth-child(28) { left: 75%; width:  7px; height:  7px; animation-duration: 14s; animation-delay: -18s; }
.auth-shell .particles span:nth-child(29) { left: 82%; width:  5px; height:  5px; animation-duration: 20s; animation-delay: -11s; }
.auth-shell .particles span:nth-child(30) { left: 91%; width:  9px; height:  9px; animation-duration: 16s; animation-delay: -24s; }
.auth-shell .particles span:nth-child(31) { left: 40%; width:  6px; height:  6px; animation-duration: 18s; animation-delay: -28s; }
.auth-shell .particles span:nth-child(32) { left: 70%; width:  8px; height:  8px; animation-duration: 15s; animation-delay: -30s; }

.auth-box {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  padding: 44px 40px 36px;
  width: 100%;
  max-width: 460px;
  box-shadow:
    0 30px 60px rgba(10, 25, 41, 0.18),
    0 4px 12px rgba(10, 25, 41, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: card-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ESD Logo – velké, vystředěné */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;
  animation: logo-fade 0.9s ease-out 0.1s both;
}
.auth-logo svg { display: block; max-width: 320px; height: auto; }
.auth-logo-img {
  display: block;
  max-width: 380px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 20px rgba(15, 23, 42, 0.1));
}
.auth-logo .auth-tagline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: #0f172a;
  text-transform: uppercase;
  white-space: nowrap;
}
.auth-logo .auth-tagline::before,
.auth-logo .auth-tagline::after {
  content: "";
  display: block;
  height: 2px;
  width: 32px;
  background: #2196f3;
  border-radius: 1px;
}
.auth-logo .auth-tagline .accent { color: #2196f3; }

@keyframes logo-fade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-box label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin: 14px 0 6px;
  font-weight: 500;
}
.auth-box input.input {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.12);
}
.auth-box input.input:focus {
  background: #ffffff;
  border-color: #2196f3;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.15);
}

.auth-box button.btn {
  width: 100%;
  padding: 13px;
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.auth-box button.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.auth-box .auth-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Bagry – stylizované siluety jedou napříč obrazovkou */
.auth-shell .excavators {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-shell .excavator {
  position: absolute;
  display: block;
  color: #0f172a;
  filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.15));
}
.auth-shell .excavator svg {
  display: block;
  width: 100%;
  height: auto;
}
.auth-shell .excavator .body {
  animation: dig-bounce 0.5s ease-in-out infinite alternate;
}
.auth-shell .excavator .boom {
  transform-origin: 72px 47px;
  animation: boom-swing 3s ease-in-out infinite alternate;
}
.auth-shell .excavator .bucket {
  transform-origin: 122px 36px;
  animation: bucket-dig 2.4s ease-in-out infinite alternate;
}

/* Pozadí pro lepší kontrast u bagrů */
.auth-shell .excavator-1 {
  bottom: 70px;
  width: 130px;
  opacity: 0.6;
  animation: drive-right 26s linear infinite;
}
.auth-shell .excavator-2 {
  bottom: 100px;
  width: 95px;
  opacity: 0.4;
  animation: drive-left 38s linear infinite;
}
.auth-shell .excavator-2 .body,
.auth-shell .excavator-2 .boom,
.auth-shell .excavator-2 .bucket {
  animation-duration: 4s, 2.5s, 3s;
}
.auth-shell .excavator-3 {
  top: 14%;
  width: 100px;
  opacity: 0.35;
  animation: drive-right 44s linear infinite;
  animation-delay: -8s;
}
.auth-shell .excavator-3 .body { animation-duration: 0.45s; }
.auth-shell .excavator-3 .boom { animation-duration: 3.6s; }
.auth-shell .excavator-3 .bucket { animation-duration: 2.8s; }

@keyframes drive-right {
  0%   { left: -200px; }
  100% { left: 110vw; }
}
@keyframes drive-left {
  0%   { right: -200px; transform: scaleX(-1); }
  100% { right: 110vw; transform: scaleX(-1); }
}
@keyframes dig-bounce {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-1.5px); }
}
@keyframes boom-swing {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(-22deg); }
}
@keyframes bucket-dig {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(30deg); }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  .auth-shell::before,
  .auth-shell::after,
  .auth-shell .blob-c,
  .auth-shell .blob-d,
  .auth-shell .blob-e,
  .auth-shell .grid-overlay,
  .auth-shell .particles span,
  .auth-shell .streaks i,
  .auth-shell .wave svg path,
  .auth-shell .excavator,
  .auth-shell .excavator .body,
  .auth-shell .excavator .boom,
  .auth-shell .excavator .bucket,
  .auth-box,
  .auth-logo {
    animation: none !important;
  }
}

/* Identification block (entries.php header) */
.id-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  font-size: 13px;
}
.id-grid .group-title {
  color: var(--text-muted);
  font-weight: 500;
}
.id-grid .group-content {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.id-grid .group-content strong { color: var(--text); font-weight: 600; margin-right: 4px; }
.id-grid .group + .group { grid-column: 1 / -1; border-top: 1px dashed var(--divider); padding-top: 10px; margin-top: 4px; }
