/* base resets / typography */
body {
  font-family: 'Inter', 'Roboto', Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
*, *:before, *:after { box-sizing: inherit; }

h1, h2, h3 {
  font-weight: 700;
  color: #20223a;
  margin-bottom: 12px;
}

a {
  color: #c80041;
  text-decoration: none;
  font-weight: 500;
  transition: color .2s;
}
a:hover {
  color: #d22;
  text-decoration: underline;
}
/* IČO + ARES + DIČ inline row */
.form-inline-two{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:8px;
  align-items:stretch;
}
.btn-ares{
  padding:0 12px;
  border-radius:6px;
  border:1px solid #e3e6ee;
  background:#f5f6fa;
  color:#3938a3;
  font-weight:600;
  display:flex;
  align-items:center;
  justify-content:center;
  height:44px;          /* same as inputs */
  white-space:nowrap;   /* prevent wrapping to 2 lines */
  cursor:pointer;
}
@media (max-width: 700px){
  .form-inline-two{ grid-template-columns:1fr; } /* stack on small screens */
}

/* layout container */
.main-container {
  max-width: 1200px;
  margin: 40px auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.17);
  padding: 40px 32px;
}

/* tables */
.modern-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
}
.modern-table th,
.modern-table td {
  border: 1px solid #ebebeb;
  padding: 10px 8px;
  text-align: left;
  font-size: 15px;
}
.modern-table th {
  background: #f8f8fa;
  font-weight: 700;
  color: #444;
}
.modern-table tr:nth-child(even) {
  background: #f7fafd;
}

/* form controls */
input[type=text],
input[type=email],
input[type=password],
input[type=date],
select,
textarea {
  border: 1px solid #d5d5df;
  border-radius: 5px;
  padding: 9px 12px;
  margin: 6px 0 16px;
  width: 100%;
  font-size: 15px;
  background: #fafdff;
  transition: border .2s;
  font-family: inherit;
  line-height: 1.3;
}
input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
textarea:focus {
  outline: none;
  border-color: #c80041;
}
label {
  font-weight: 500;
  color: #444;
}
.form-note {
  font-size: 14px;
  color: #888;
}

/* messages */
.success {
  color: #46b154;
  font-weight: bold;
  background: #f5fff7;
  border-radius: 7px;
  padding: 8px 16px;
  margin-bottom: 20px;
  display: inline-block;
}
.error {
  color: #c80041;
  background: #fff5f8;
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: bold;
  margin-bottom: 20px;
  display: inline-block;
}

/* autocomplete */
.autocomplete-results {
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  z-index: 100;
  max-height: 160px;
  overflow-y: auto;
  width: 350px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.autocomplete-results div {
  padding: 7px 12px;
  cursor: pointer;
}
.autocomplete-results div:hover {
  background: #f6f6fa;
}

/* product table helpers */
.products-table td input,
.products-table td select {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 5px;
  border: 1px solid #e3e6ee;
  border-radius: 5px;
  background: #fff;
  font-size: 1em;
}
.products-table td textarea {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
}
.products-table td {
  vertical-align: middle;
}

/* unified button system */
.btn, button, input[type=submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  min-height: 42px;
  transition: background .2s, box-shadow .2s, border .2s;
  font-family: inherit;
  box-sizing: border-box;
}

.btn-primary {
  background: #5e60ce;
  color: #fff;
  box-shadow: 0 2px 8px rgba(94,96,206,0.3);
}
.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  background: #f1f3fc;
  color: #3c3cb4;
  border: 1px solid #d9dbed;
}
.btn-secondary:hover {
  background: #e8ecf9;
}

.btn-danger {
  background: #e04343;
  color: #fff;
}
.btn-danger:hover {
  filter: brightness(1.05);
}

/* small red variant (if needed) */
.btn-red-sm {
  min-width: 100px;
  box-shadow: 0 2px 6px rgba(200,0,65,0.13);
  text-align: center;
  display: inline-block;
  padding: 8px 14px;
}

/* action links / PDF */
.btn-action, .pdf-link-text {
  background: #fff;
  border: 1px solid #cfd8e6;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.85em;
  color: #1f2040;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap:4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn-action:hover { background:#f4f6ff; border-color:#adb9dd; }
.pdf-link-text { color: #5e3ec9; font-weight:500; background:none; border:none; padding:0; }
.pdf-link-text:hover { text-decoration:underline; }

/* danger variant for action */
.btn-action-danger {
  background: #fff;
  border: 1px solid #e1c2c5;
  color: #a31f1f;
  border-radius:6px;
  font-size:0.85em;
  cursor:pointer;
  padding:6px 12px;
}
.btn-action-danger:hover { background:#ffe6e6; }

/* utility */
.action-buttons { display:flex; gap:8px; align-items:center; flex-wrap:nowrap; }
.input-flex { display:flex; gap:8px; }
.input-flex > input { flex:1; }
.table-wrapper {
  overflow-x: auto;
  max-width: 100%;
}

.table-wrapper table {
  min-width: 800px; /* ensures structure holds if many columns */
}
