:root {
  --brand-600: #124a78;
  --brand-500: #185685;
  --brand-400: #266b8c;
  --bg: #f2f4fb;
  --surface: #ffffff;
  --text: #1e2333;
}

* { font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }

body {
  background: linear-gradient(180deg, #eef0fb 0%, #f2f3fb 260px, #f2f3fb 100%);
  color: var(--text);
}

/* --- Navigace --- */
.navbar-brand-gradient {
  background: var(--brand-600);
  box-shadow: 0 2px 12px rgba(18, 74, 120, .3);
}
.navbar-brand { font-weight: 800; letter-spacing: .2px; }
.navbar-brand-gradient .nav-link {
  font-weight: 500;
  opacity: .92;
  transition: opacity .15s ease;
}
.navbar-brand-gradient .nav-link:hover { opacity: 1; }

/* --- Karty --- */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 2px 10px rgba(30, 35, 51, .06);
}
.card-body h1, .card-body h2 { font-weight: 700; }

/* --- Tlačítka --- */
.btn { border-radius: .65rem; font-weight: 600; }
.btn-primary {
  background: var(--brand-500);
  border: none;
  box-shadow: 0 2px 8px rgba(24, 86, 133, .35);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(18, 74, 120, .45);
}
.btn-outline-primary { color: var(--brand-600); border-color: var(--brand-500); }
.btn-outline-primary:hover { background: var(--brand-500); border-color: var(--brand-500); }
.btn-success { background: #10b981; border-color: #10b981; }
.btn-success:hover { background: #0ea271; border-color: #0ea271; }
.btn-danger, .btn-outline-danger:hover { background: #ef4444; border-color: #ef4444; }

/* --- Formuláře --- */
.form-label { font-weight: 600; font-size: .88rem; color: #3f4459; margin-bottom: .35rem; }

.form-control, .form-select {
  background: #f6f7fc;
  border: 2px solid #b7bede;
  border-radius: .6rem;
  padding: .55rem .85rem;
  font-size: .95rem;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.form-control:hover, .form-select:hover { border-color: #9aa4d1; }
.form-control:focus, .form-select:focus {
  background: #fff;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 .2rem rgba(38, 107, 140, .18);
}
.form-control[readonly], .form-control:disabled, .form-select:disabled {
  background: #eef0f5;
  color: #5b6072;
}
.form-control::placeholder { color: #9aa0b4; }
textarea.form-control { min-height: 4.5rem; }

.form-check-input {
  width: 1.15em; height: 1.15em; margin-top: .2em;
  border: 1.5px solid #c7cdea; border-radius: .3em;
}
.form-check-input:checked { background-color: var(--brand-500); border-color: var(--brand-500); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(38, 107, 140, .18); }
.form-check-label { color: #3f4459; }

/* Našeptávač zákazníků z adresáře */
.customer-suggest {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1.5px solid #b7bede;
  border-radius: .6rem;
  box-shadow: 0 8px 20px rgba(30, 35, 51, .15);
  margin-top: 3px;
  max-height: 240px;
  overflow-y: auto;
}
.customer-suggest-item { padding: .5rem .75rem; cursor: pointer; border-bottom: 1px solid #f0f1f7; }
.customer-suggest-item:last-child { border-bottom: none; }
.customer-suggest-item:hover { background: #eef0fd; }

/* Nadpisy sekcí uvnitř karet */
.card-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: .6rem;
  margin-bottom: 1.1rem;
  border-bottom: 2px solid #eef0fd;
  color: #1e2333;
}

/* --- Tabulka zakázek --- */
table.orders td, table.orders th { vertical-align: middle; }
table.orders thead th {
  background: #eef0fd;
  color: var(--brand-600);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: none;
}
table.orders tbody tr:hover { background: #f6f7fe; }
table.orders td a { font-weight: 700; color: var(--brand-600); text-decoration: none; }
table.orders td a:hover { text-decoration: underline; }

/* --- Stavové štítky --- */
.status-badge {
  font-weight: 600;
  font-size: .78rem;
  padding: .38em .75em;
  border-radius: 999px;
  border: none;
}
.st-prijato    { background: #e2e8f0; color: #475569; }
.st-vreseni    { background: #fef3c7; color: #92400e; }
.st-hotovo     { background: #d1fae5; color: #065f46; }
.st-vyzvednuto { background: var(--brand-500); color: #fff; }
.st-zruseno    { background: #fee2e2; color: #991b1b; }

/* --- Odhad termínu --- */
.due-badge {
  display: inline-block;
  padding: .3em .7em;
  border-radius: 999px;
  font-weight: 600;
  font-size: .82rem;
  background: #eef0f5;
  color: #475569;
}
.due-badge.due-soon    { background: #fef3c7; color: #92400e; }
.due-badge.due-overdue { background: #fee2e2; color: #b91c1c; }

/* --- Mini kalendář termínů (popover po najetí myší) --- */
.calendar-popover { position: relative; }
.calendar-trigger {
  display: flex;
  align-items: center;
  gap: .4rem;
  height: 100%;
  padding: .55rem .9rem;
  border: 2px solid #b7bede;
  border-radius: .6rem;
  background: #f6f7fc;
  font-weight: 600;
  font-size: .88rem;
  color: #3f4459;
  white-space: nowrap;
}
.calendar-trigger a { color: var(--brand-600); text-decoration: none; font-weight: 800; padding: 0 .2rem; }
.calendar-trigger a:hover { color: var(--brand-500); }
.calendar-popover-panel {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: .35rem;
  width: 230px;
  background: #fff;
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(30, 35, 51, .18);
  padding: .7rem .85rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease 1.5s, visibility 0s linear 1.8s;
}
.calendar-popover:hover .calendar-popover-panel {
  opacity: 1;
  visibility: visible;
  transition: opacity .12s ease, visibility 0s linear 0s;
}
.calendar-mini { table-layout: fixed; }
.calendar-mini th {
  text-align: center;
  font-size: .6rem;
  color: #8890a8;
  font-weight: 700;
  text-transform: uppercase;
  border: none;
  background: none;
  padding: .15rem 0;
}
.calendar-mini td {
  text-align: center;
  vertical-align: middle;
  border: none;
  padding: .05rem;
  height: 1.65rem;
}
.calendar-mini .cal-day-num { display: block; font-size: .68rem; color: #3f4459; line-height: 1; }
.calendar-mini a.cal-day-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-decoration: none;
  border-radius: .4rem;
  padding: .1rem 0;
}
.calendar-mini a.cal-day-link:hover { background: #eef0fd; }
.calendar-mini .cal-day-num.cal-due { color: #dc2626; font-weight: 800; }
.calendar-mini td.cal-today .cal-day-num { font-weight: 800; color: var(--brand-600); text-decoration: underline; }
.calendar-mini td.cal-today .cal-day-num.cal-due { color: #dc2626; }
.calendar-mini td.cal-has-due { background: #fef3c7; border-radius: .4rem; }
.calendar-mini td.cal-selected { background: #eef0fd; border-radius: .4rem; }

/* --- Stopky --- */
.stopwatch {
  font-variant-numeric: tabular-nums;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-600);
}

/* --- Kompaktnější rozestupy na širších obrazovkách (mobil zůstává prostornější kvůli dotyku) --- */
@media (min-width: 992px) {
  .card { margin-bottom: .6rem !important; }
  .card-body { padding: .75rem .9rem; }
  .card-body h2 { padding-bottom: .3rem; margin-bottom: .55rem; font-size: .95rem; }
  .mb-3 { margin-bottom: .45rem !important; }
  .mb-2 { margin-bottom: .3rem !important; }
  .mb-4 { margin-bottom: .6rem !important; }
  .row.g-2 { --bs-gutter-y: .3rem; }
  .form-label { margin-bottom: .15rem; font-size: .82rem; }
  .form-control, .form-select { padding: .3rem .6rem; font-size: .88rem; }
  textarea.form-control { min-height: 3.2rem; }
  .btn { padding: .35rem .8rem; }
  h1.h3 { margin-bottom: .4rem !important; font-size: 1.4rem; }
  .container.pb-5 { padding-bottom: 1rem !important; }
}

/* --- Pevná lišta rychlých kotev (jen mobil) --- */
.mobile-anchor-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: 56px;
  z-index: 40;
  justify-content: space-around;
  align-items: center;
  background: var(--brand-400);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  padding: .3rem 0;
}
.mobile-anchor-bar a {
  color: #fff;
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: .25rem .4rem;
}
@media (max-width: 991.98px) {
  .mobile-anchor-bar { display: flex; }
}

@media print {
  nav, .no-print { display: none !important; }
  body { background: #fff; }
}
