:root {
  --primary: #ed1c24;
  --primary-dark: #c9151c;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: rgba(0, 0, 0, 0.87);
  --muted: rgba(0, 0, 0, 0.6);
  --border: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Roboto, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.app-shell {
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  background: var(--primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-logo {
  height: 44px;
  width: auto;
  display: block;
}

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

.brand {
  font-weight: 700;
  font-size: 20px;
  color: #fff;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.button:hover {
  opacity: 0.96;
}

.button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.button-secondary {
  background: #757575;
  border-color: #757575;
  color: #fff;
}

.button-secondary:hover {
  background: #616161;
  border-color: #616161;
}

.input,
.select,
.textarea {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.textarea {
  min-height: 140px;
  resize: vertical;
  padding-top: 14px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.12);
}

.form-group {
  display: grid;
  gap: 8px;
  width: 100%;
}

.form-group label {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

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

.form-card {
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 16px;
}

.section-title {
  margin: 0 0 20px 0;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
}

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.actions-row .button {
  min-width: 180px;
}

/* TABLES */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.table th,
.table td {
  padding: 3px 6px;
  text-align: left;
  vertical-align: middle;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 700;
  background: #fff;
}

.table th:last-child,
.table td:last-child {
  border-right: none;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:first-child th:first-child {
  border-top-left-radius: var(--radius);
}

.table tr:first-child th:last-child {
  border-top-right-radius: var(--radius);
}

.table tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}

.table tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

.table-fixed {
  table-layout: fixed;
}

.table-fixed th:nth-child(1),
.table-fixed td:nth-child(1) {
  width: auto;
}

.table-fixed th:nth-child(2),
.table-fixed td:nth-child(2),
.table-fixed th:nth-child(4),
.table-fixed td:nth-child(4) {
  width: 100px;
  text-align: center;
}

.table-fixed th:nth-child(3),
.table-fixed td:nth-child(3),
.table-fixed th:nth-child(5),
.table-fixed td:nth-child(5) {
  width: 140px;
  text-align: center;
}

.table-fixed input[type="time"] {
  min-width: 50px;
  width: 100%;
}

/* LOGIN PAGE */
.login-page {
  background: var(--bg);
  min-height: 100vh;
}

.login-topbar {
  height: 40px;
  background: var(--primary);
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.login-layout {
  max-width: 1200px;
  margin: 24px auto 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.login-brand-side {
  flex: 0 1 320px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.login-brand-logo {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
}

.login-panel {
  flex: 0 1 460px;
  width: 100%;
}

.login-panel-inner {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.04);
  padding: 32px;
}

.login-title {
  margin: 0 0 24px 0;
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
  color: var(--text);
}

.login-form {
  width: 100%;
}

.login-form .form-group {
  margin-bottom: 16px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
}

.login-form .input {
  min-height: 52px;
  border-radius: 12px;
  font-size: 17px;
}

.login-actions {
  margin-top: 22px;
}

.login-submit {
  min-width: 180px;
  min-height: 52px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.login-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(237, 28, 36, 0.08);
  color: #b00020;
  font-weight: 700;
}

@media (min-width: 1024px) {

  /* čas (hh:mm) */
  .crew-table input[type="time"] {
    height: 30px;
    min-height: 28px;
    padding: 2px 6px;
    font-size: 13px;
    border-radius: 6px;
  }

  /* checkboxi */
  .crew-table input[type="checkbox"] {
    transform: scale(0.9);
    margin: 0;
  }

}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .form-grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  .login-layout {
    gap: 28px;
    margin-top: 20px;
  }

  .login-brand-side {
    flex-basis: 220px;
  }

  .login-brand-logo {
    max-width: 170px;
  }

  .login-panel-inner {
    padding: 26px;
  }

  .login-title {
    font-size: 24px;
  }
}

@media (max-width: 700px) {
  html {
    font-size: 80%;
  }

  .container {
    padding: 0 10px;
  }

  .card {
    padding: 14px;
  }

  .topbar {
    padding: 8px 10px;
  }

  .topbar-logo {
    height: 30px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12.8px;
    border-radius: 8px;
  }

  .button {
    min-height: 35px;
    padding: 0 12px;
    font-size: 12.8px;
    border-radius: 8px;
  }

  .input,
  .select,
  .textarea,
  input[type="date"] {
  min-height: 30px;
  height: 30px;
  padding: 2px 6px;
  font-size: 13px;
  border-radius: 6px;
  box-sizing: border-box;
}

  .textarea {
    min-height: 110px;
    height: auto;
    padding-top: 10px;
  }

  .form-group {
    gap: 6px;
  }

  .form-group label {
    font-size: 12.8px;
  }

  .form-grid-2,
  .form-grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .actions-row {
    gap: 10px;
    margin-top: 16px;
  }

  .actions-row .button {
    width: 100%;
    min-width: 0;
  }

  .crew-table th:nth-child(3),
  .crew-table td:nth-child(3),
  .crew-table th:nth-child(5),
  .crew-table td:nth-child(5) {
    display: none;
  }

  .crew-table {
    table-layout: fixed;
  }

  .crew-table th:nth-child(1),
  .crew-table td:nth-child(1) {
    width: auto;
  }

  .crew-table th:nth-child(2),
  .crew-table td:nth-child(2),
  .crew-table th:nth-child(4),
  .crew-table td:nth-child(4) {
    width: 58px;
    text-align: center;
  }

  .crew-table td:first-child {
    word-break: break-word;
  }

  .table th,
  .table td {
    padding: 6px 8px;
    font-size: 12.8px;
  }

  .login-topbar {
    height: 32px;
  }

  .login-layout {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 14px;
    padding: 0 10px;
  }

  .login-brand-side {
    flex: none;
    padding-top: 0;
  }

  .login-brand-logo {
    max-width: 96px;
    margin: 0 auto;
  }

  .login-panel {
    flex: none;
    width: 100%;
    max-width: 336px; /* ~80% od 420px */
    margin: 0 auto;
  }

  .login-panel-inner {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .login-title {
    font-size: 19px;
    margin-bottom: 14px;
    text-align: center;
  }

  .login-form .input {
    min-height: 42px;
    font-size: 13.6px;
  }

  .login-actions {
    margin-top: 16px;
  }

  .login-submit {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    font-size: 13.6px;
  }
}
.input::placeholder {
  color: rgba(0,0,0,0.45);
  font-weight: 500;
}

input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  font-family: inherit;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.filter-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0px;
  flex: 0 1 260px;
}

.filter-field input[type="date"] {
  width: 100%;
}

.filter-form .button {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .filter-form {
    align-items: stretch;
  }

  input[type="date"] {
    max-width: 100%;
  }

  .filter-field {
    min-width: 0;
    flex: 1 1 100%;
  }

  .filter-form .button {
    width: 100%;
  }
}