@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --green-980: #06170f;
  --green-950: #0b2417;
  --green-900: #102f20;
  --green-850: #153a28;
  --green-800: #1a4a31;
  --green-700: #24623f;
  --green-200: #c7d9c9;
  --green-100: #e1ece3;
  --green-50: #eef5ef;
  --ink: #101714;
  --muted: #5b6b61;
  --line: #b8caba;
  --paper: #ffffff;
  --warning: #8a5b00;
  --danger: #9f1d20;
  --ok: #1f6b3a;
}

* { box-sizing: border-box; }

body {
  font-family: 'Outfit', Arial, sans-serif;
  margin: 0;
  background: var(--green-850);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

header {
  background: linear-gradient(90deg, var(--green-980), var(--green-900));
  color: white;
  padding: 22px 32px;
  border-bottom: 4px solid #789b78;
}

header h1 {
  margin: 0 0 12px 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

main {
  max-width: 1600px;
  margin: 30px auto;
  padding: 0 18px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.card h2, .card h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: 15px;
}

input, select, textarea {
  padding: 11px;
  margin: 6px 0 14px;
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green-700);
  box-shadow: 0 0 0 3px rgba(36, 98, 63, .18);
}

button, .button {
  background: var(--green-800);
  color: white;
  border: 1px solid var(--green-950);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  padding: 11px 16px;
  width: auto;
  font-weight: 700;
  border-radius: 0;
}

button:hover, .button:hover { background: var(--green-950); }

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--line);
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: var(--green-900);
  color: white;
  font-weight: 700;
}

tr:nth-child(even) td { background: #fbfdfb; }

.ok { color: var(--ok); font-weight: 700; }
.warn { color: var(--warning); font-weight: 700; }
.bad { color: var(--danger); font-weight: 700; }

nav a {
  color: white;
  margin-right: 16px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.35);
}

nav a:hover { border-bottom-color: white; }

a {
  color: var(--green-800);
  font-weight: 600;
}

video {
  width: 100%;
  max-height: 360px;
  background: black;
  border-radius: 0;
}


.global-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}

.global-menu a {
  color: white;
  margin-right: 0;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.35);
  padding-bottom: 2px;
}

.global-menu a:hover,
.global-menu a.active {
  border-bottom-color: white;
}


/* v27 workspace and spreadsheet refinements */
input:disabled {
  background: #e3e7e4;
  color: #6b7c72;
  cursor: not-allowed;
}

table input,
table textarea,
.sales-sheet input,
.sales-sheet textarea {
  padding: 6px;
  font-size: 14px;
}

table td,
table th,
.sales-sheet td,
.sales-sheet th {
  padding: 6px;
}

.card {
  overflow-x: auto;
}

/* v28 stable visits */
.card{overflow-x:auto;}

.course-video { margin: 18px 0; }
.course-video iframe { width: 100%; max-width: 900px; aspect-ratio: 16 / 9; border: 0; display: block; }
.course-video video { width: 100%; max-width: 900px; display: block; }
.external-video-link { border: 1px solid #c8d6cd; background: #eef5ef; padding: 16px; }
.video-credit { font-size: 13px; color: #5b6b61; }

.video-timer-box {
  border: 1px solid #c8d6cd;
  background: #eef5ef;
  padding: 14px;
  margin: 0 0 14px 0;
}
.video-timer-box span {
  font-weight: 800;
  font-size: 20px;
}
.timer-done {
  color: #1f6b3a;
}

.video-timer-locked button.disabled,
.video-timer-locked button:disabled,
.video-timer-locked .button.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.video-timer-box .bad {
  color: #9f1d20;
  font-weight: 700;
}
.video-timer-box .ok {
  color: #1f6b3a;
  font-weight: 700;
}

.iframe-click-timer {
  position: relative;
  max-width: 900px;
  cursor: pointer;
}
.iframe-click-timer iframe {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}
.iframe-click-timer-note {
  border: 1px solid #c8d6cd;
  background: #eef5ef;
  padding: 10px 14px;
  margin: 0 0 12px 0;
}
.iframe-timer-running .video-timer-box {
  border-color: #1f6b3a;
}


.menu-brewery-name {
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  opacity: .95;
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-actions form {
  margin: 0;
}
.small-button {
  padding: 7px 10px;
  font-size: 13px;
}
.invoice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.invoice-print-area table input[type="checkbox"] {
  width: auto;
}
@media print {
  header, nav, .no-print, .global-menu, .menu-brewery-name { display: none !important; }
  body { background: white !important; }
  main { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; }
  .invoice-print-area { display: block; }
}

.lesson-question {
  border-top: 1px solid #c8d6cd;
  margin-top: 18px;
  padding-top: 14px;
}

.sales-search {
  margin-bottom: 16px;
  border: 1px solid #c8d6cd;
  background: #eef5ef;
  padding: 14px;
}
.sales-search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sales-search-row input {
  max-width: 420px;
  margin: 0;
}
.sales-search-row button {
  margin: 0;
  white-space: nowrap;
}


/* v65: force radio/checkbox controls to keep natural size even when global input styles exist */
input[type="radio"],
input[type="checkbox"],
.inline-check input[type="checkbox"],
.inline-check input[type="radio"],
.answer-row input[type="radio"],
.answer-row input[type="checkbox"] {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 8px 0 0 !important;
  display: inline-block !important;
  appearance: auto !important;
}

.inline-check {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
}

.answer-grid {
  display: grid !important;
  gap: 12px !important;
  margin-top: 10px !important;
}

.answer-row {
  display: grid !important;
  grid-template-columns: 26px 72px minmax(0, 1fr) !important;
  gap: 8px !important;
  align-items: center !important;
}

.answer-row input[type="radio"] {
  justify-self: start !important;
  align-self: center !important;
}

.answer-row label {
  margin: 0 !important;
  font-weight: 700 !important;
}

.answer-row input:not([type="radio"]):not([type="checkbox"]) {
  width: 100% !important;
  margin: 0 !important;
}


/* v65: mobile optimized course/test */
@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 10px !important;
  }

  header {
    padding: 14px 12px !important;
  }

  header h1 {
    font-size: 22px !important;
    line-height: 1.2 !important;
  }

  .card {
    padding: 14px !important;
    margin: 10px 0 !important;
  }

  .course-progress {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)) !important;
    gap: 6px !important;
  }

  .course-progress span {
    text-align: center !important;
    padding: 8px 6px !important;
    font-size: 14px !important;
  }

  .course-step h2 {
    font-size: 20px !important;
    line-height: 1.25 !important;
  }

  .lesson-question h3 {
    font-size: 17px !important;
  }

  .lesson-question label {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: start !important;
    margin: 10px 0 !important;
    line-height: 1.35 !important;
  }

  .lesson-question input[type="radio"] {
    margin-top: 2px !important;
    width: auto !important;
  }

  .course-video iframe,
  .course-video video {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 210px !important;
  }

  .video-timer-box {
    font-size: 15px !important;
    padding: 10px !important;
  }

  .course-step-actions button,
  .quiz-submit,
  .lesson-next {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 17px !important;
  }

  .answer-row {
    grid-template-columns: 28px 64px minmax(0, 1fr) !important;
  }
}

.danger-button {
  background: #7a1f1f !important;
  color: #fff !important;
  border-color: #7a1f1f !important;
}
.danger-button:hover {
  filter: brightness(0.95);
}

.delete-actions-header {
  text-align: center;
  vertical-align: bottom;
  min-width: 110px;
}
.delete-all-header-form {
  margin: 0 0 6px 0;
}
.delete-all-header-form button {
  white-space: nowrap;
}
