html, body {
  height: 100%;
  overflow: hidden;
}

#loginScreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #0b1220;
  align-items: center;
  justify-content: center;
}

.loginBox {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 0 60px rgba(37,99,235,0.15);
}

.loginBox h2 {
  margin: 0 0 4px 0;
  font-size: 18px;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.loginBox p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.loginField {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.loginField label {
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.loginField input {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  color: #e5e7eb;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.loginField input:focus {
  border-color: #2563eb;
}

#loginBtn {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  margin-top: 4px;
}

#loginBtn:hover { background: #1d4ed8; }
#loginBtn:disabled { opacity: 0.5; cursor: not-allowed; }

#loginError {
  color: #f87171;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

#startMenu {
  display:none;
  width:100%;
  height:100vh;
  align-items:center;
  justify-content:center;
  background:#0b1220;
}

.menuBox{
  background:#111827;
  border:1px solid #1f2937;
  border-radius:20px;
  padding:40px;
  text-align:center;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:280px;
}

.menuBtn{
  background:#2563eb;
  color:#fff;
  border:none;
  padding:12px;
  border-radius:10px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:15px;
}

.menuBtn:disabled{ background:#374151; cursor:not-allowed; }

.menuBtn--tf,
.menuBtn--s,
.menuBtn--fto {
  background: transparent;
  border: 1.5px solid #60a5fa;
  color: #60a5fa;
}
.menuBtn--tf:hover,
.menuBtn--s:hover,
.menuBtn--fto:hover {
  background: rgba(96, 165, 250, 0.12);
}

#menuRoleBadge { text-align:center; margin:-4px 0 4px 0; }

/* Wrappery wstrzykniętych paneli — muszą być full screen */
#tfInjectedRoot,
#sInjectedRoot,
#ftoInjectedRoot {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: none;
}

#tfInjectedRoot.active,
#sInjectedRoot.active,
#ftoInjectedRoot.active {
  display: block;
}

.menuSpinner {
  width: 18px; height: 18px;
  border: 2px solid #334155;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: menuSpin 0.7s linear infinite;
  display: inline-block;
}
@keyframes menuSpin { to { transform: rotate(360deg); } }

.footer {
  position: fixed;
  bottom: 0; right: 0;
  padding: 10px 14px;
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #1f2937;
  border-left: 1px solid #1f2937;
  border-top-left-radius: 14px;
  box-shadow: -6px -6px 20px rgba(0,0,0,0.25);
  z-index: 9999;
  max-width: 420px;
}
.footerText {
  display:flex; flex-direction:column; gap:2px;
  font-size:11px; line-height:1.3; color:#94a3b8;
}
.footerText span { font-size:10px; color:#64748b; }

body {
  margin:0;
  font-family:Arial,sans-serif;
  background:#0b1220;
  color:#e5e7eb;
  display:flex;
  height:100vh;
}

/* ── Style panelu Taryfikator ── */

body{
  margin:0;
  font-family:Arial,sans-serif;
  background:#0b1220;
  color:#e5e7eb;
  display:flex;
  height:100vh;
}

.sectionTitle{
  font-size:12px;
  color:#94a3b8;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.icon-btn i,
.icon-btn svg {
  flex-shrink: 0;
  display: block;
}

#app {
  display: none;
  width: 100%;
  height: 100vh;
}

body{
  margin:0;
  font-family:Arial,sans-serif;
  background:#0b1220;
  color:#e5e7eb;
  display:flex;
  height:100vh;
}

aside{
  width:320px;
  background:#111827;
  padding:16px;
  overflow:auto;
}

main{
  flex:1;
  display:flex;
  flex-direction:column;
}

.top{
  padding:16px;
  border-bottom:1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.content{
  padding:16px;
  overflow:auto;
}

.cat{
  padding:10px;
  background:#1f2937;
  border-radius:10px;
  margin:6px 0;
  cursor:pointer;
}

.cat.active{
  outline:2px solid #2563eb;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:10px;
}

.card{
  background:#0f172a;
  padding:12px;
  border-radius:10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

small{color:#94a3b8}

.actions{
  display:flex;
  gap:6px;
  align-items:center;
}

.btn{
  background-color:#2563eb;
  color:#fff;
  border:none;
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: background-color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

/* background-color (nie skrót "background") celowo — skrót resetowałby background-image
   (strzałkę SVG w select.btn) na hover, powodując jej znikanie/"przeskok" */
.btn:hover:not(:disabled) { background-color:#1d4ed8; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity:0.5; cursor:not-allowed; }

.danger{background-color:#dc2626}
.danger:hover:not(:disabled){ background-color:#b91c1c; }

/* Ładniejsze <select class="btn"> — strzałka SVG zamiast natywnej, spójne z resztą UI */
select.btn {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  text-align: left;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px;
  padding-right: 32px;
}

select.btn:focus,
input.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.35);
}

select.btn option {
  background: #111827;
  color: #e5e7eb;
}

/* Custom scrollbar dla rozwiniętej listy <select> (działa w przeglądarkach opartych na Chromium/CEF) */
select.btn::-webkit-scrollbar {
  width: 10px;
}

select.btn::-webkit-scrollbar-track {
  background: #111827;
}

select.btn::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
  border: 2px solid #111827;
}

select.btn::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

.badge{
  background:#16a34a;
  padding:2px 8px;
  border-radius:6px;
  font-size:12px;
  margin-left:auto;
}

.panel{
  background:#111827;
  padding:16px;
  border-radius:14px;
}

.row{
  display:flex;
  justify-content:space-between;
  padding:8px 0;
  border-bottom:1px solid #1f2937;
}

.section{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid #334155;
}

.bottomPanel{
  margin-top:20px;
  padding-top:12px;
  border-top:1px solid #334155;
}

.sectionTitle{
  font-size:12px;
  color:#94a3b8;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:1px;
}

.actionsRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-direction:row;
}

.previewImg{
  max-width:100%;
  max-height:240px;
  margin-top:10px;
  border-radius:12px;
  border:1px solid #334155;
  object-fit:contain;
}

.btn-green{
  background:#16a34a;
}

.btn-blue{
  background:#2563eb;
}

.segmentGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:8px;
  margin-top:10px;
}

.segmentBtn{
  background:#2563eb;
  color:#fff;
  border:none;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
  text-align:center;
}

.segmentBtn:hover{
  background:#1d4ed8;
}

.searchInput {
  width: 100%;
  box-sizing: border-box;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  color: #e5e7eb;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 14px;
}

.searchInput:focus {
  border-color: #2563eb;
}

.searchEmpty {
  color: #64748b;
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
}

#logoutBtn {
  background: #374151;
  color: #94a3b8;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}

#logoutBtn:hover { background: #4b5563; }

.footer {
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  border-top: 1px solid #1f2937;
  border-left: 1px solid #1f2937;
  border-top-left-radius: 14px;
  box-shadow: -6px -6px 20px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  max-width: 420px;
}

.footerText {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  line-height: 1.3;
  color: #94a3b8;
}

.footerText span {
  font-size: 10px;
  color: #64748b;
}

#startMenu {
  display:none;
  width:100%;
  height:100vh;
  align-items:center;
  justify-content:center;
  background:#0b1220;
}

.menuBox{
  background:#111827;
  border:1px solid #1f2937;
  border-radius:20px;
  padding:40px;
  text-align:center;
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:280px;
}

.menuBtn{
  background:#2563eb;
  color:#fff;
  border:none;
  padding:12px;
  border-radius:10px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:15px;
}

.menuBtn:disabled{
  background:#374151;
  cursor:not-allowed;
}

.menuBtn--fto {
  background: linear-gradient(135deg, #92400e, #b45309);
  border: 1px solid #f59e0b;
  color: #fef3c7;
}

.menuBtn--fto:hover {
  background: linear-gradient(135deg, #b45309, #d97706);
}

#menuRoleBadge {
  text-align: center;
  margin: -4px 0 4px 0;
}

/* === CHMURKA WYROKU === */
#verdictBubble {
  position: relative;
  top: auto;
  right: auto;
  z-index: 1000;
}

.vb-trigger {
  background: #1f2937;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #e5e7eb;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}

.vb-trigger:hover,
.vb-trigger.active {
  background: #2563eb;
  border-color: #2563eb;
}

.vb-count {
  background: #2563eb;
  color: #fff;
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  text-align: center;
  transition: background 0.15s;
}

.vb-trigger.active .vb-count {
  background: #fff;
  color: #2563eb;
}

.vb-popup {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 14px;
  min-width: 240px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 1001;
}

.vb-popup.open {
  display: block;
}

.vb-popup-title {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.vb-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #1f2937;
  font-size: 12px;
  gap: 8px;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s;
}

.vb-item:hover .vb-item-name,
.vb-item:hover .vb-item-count {
  color: #f87171;
}

.vb-item:hover::after {
  content: '✕';
  color: #f87171;
  font-size: 11px;
  margin-left: 4px;
  flex-shrink: 0;
}

.vb-item:last-child {
  border-bottom: none;
}

.vb-item-name {
  color: #e5e7eb;
  flex: 1;
}

.vb-item-count {
  color: #94a3b8;
  font-size: 11px;
  white-space: nowrap;
}

.vb-totals {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #334155;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.vb-totals-fine {
  color: #fbbf24;
  font-weight: bold;
}

.vb-totals-jail {
  color: #f87171;
  font-weight: bold;
}

/* === WYRÓWNANIE IKON === */
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.icon-btn i,
.icon-btn svg {
  flex-shrink: 0;
  display: block;
}

.cat .icon-btn,
.cat {
  display: flex;
  align-items: center;
}

/* ── Style panelu Moja Służba ── */

body{
  margin:0;
  font-family:Arial,sans-serif;
  background:#0b1220;
  color:#e5e7eb;
  display:flex;
  height:100vh;
}

.sectionTitle{
  font-size:12px;
  color:#94a3b8;
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:1px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}

.icon-btn i,
.icon-btn svg {
  flex-shrink: 0;
  display: block;
}

/* === MOJA SŁUŻBA === */
#mojaSluzbApp {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
}

.ms-header {
  padding: 16px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
}

.ms-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: #111827;
  border-bottom: 1px solid #334155;
}

.ms-tab {
  background: #1f2937;
  color: #94a3b8;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s, color 0.2s;
}

.ms-tab.active {
  background: #2563eb;
  color: #fff;
}

.ms-content {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.ms-panel {
  background: #111827;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.ms-notes-area {
  width: 100%;
  box-sizing: border-box;
  min-height: 320px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px;
  color: #e5e7eb;
  font-size: 15px;
  line-height: 1.6;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
  font-family: Arial, sans-serif;
}

.ms-notes-area:focus {
  border-color: #2563eb;
}

.ms-counter-display {
  font-size: 64px;
  font-weight: bold;
  text-align: center;
  color: #e5e7eb;
  padding: 20px 0 10px;
  letter-spacing: 2px;
}

.ms-counter-display.negative {
  color: #f87171;
}

.ms-counter-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 10px 0;
}

.ms-btn-add {
  background: #16a34a;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  min-width: 70px;
}

.ms-btn-sub {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 22px;
  cursor: pointer;
  min-width: 70px;
}

.ms-btn-clear {
  background: #374151;
  color: #e5e7eb;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.ms-btn-history {
  background: #1d4ed8;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.ms-history-list {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f172a;
  border-radius: 8px;
  font-size: 13px;
}

.ms-history-item .ms-hi-action {
  font-weight: bold;
}

.ms-history-item .ms-hi-time {
  color: #64748b;
  font-size: 11px;
}

.ms-timer-status {
  text-align: center;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 8px;
}

.ms-timer-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0;
}

.ms-btn-toggle {
  color: #fff;
  border: none;
  padding: 14px 36px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  min-width: 220px;
  transition: background 0.2s;
}

.ms-btn-toggle.on-duty {
  background: #dc2626;
}

.ms-btn-toggle.off-duty {
  background: #16a34a;
}

.ms-total-time {
  text-align: center;
  font-size: 13px;
  color: #4ade80;
  margin-top: 6px;
  font-weight: bold;
  min-height: 18px;
}

.ms-timer-log {
  margin-top: 10px;
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms-timer-log-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0f172a;
  border-radius: 8px;
  font-size: 13px;
}

.ms-timer-log-item.wejscie {
  border-left: 3px solid #16a34a;
}

.ms-timer-log-item.zejscie {
  border-left: 3px solid #dc2626;
}

.ms-saved-indicator {
  font-size: 11px;
  color: #16a34a;
  text-align: right;
  margin-top: 4px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.3s;
}

.ms-saved-indicator.show {
  opacity: 1;
}

/* ── Style panelu FTO / Egzamin RTO ── */

/* === FTO MENU (kafelki) === */
#ftoMenu {
  display: none;
  width: 100%;
  height: 100vh;
  align-items: center;
  justify-content: center;
  background: #0b1220;
}

.fto-menu-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.fto-tile-btn {
  background: transparent;
  border: 1.5px solid #60a5fa;
  color: #60a5fa;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
}

.fto-tile-btn:hover {
  background: rgba(96, 165, 250, 0.12);
}

/* === OBECNOŚĆ APP === */
#obecnoscApp {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
  background: #0b1220;
}

#ftoManageApp {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
  background: #0b1220;
}

input.btn,
select.btn {
  color: #fff;
}

input.btn::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.fto-manage-layout {
  display: flex;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
}

.fto-manage-card {
  flex: 1;
  min-width: 300px;
  max-width: none;
  height: 100%;
}

.fto-week-card {
  flex: 1;
  min-width: 300px;
  max-width: none;
  min-height: 0;
  height: 100%;
}

.fto-late-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  min-width: 260px;
  height: 100%;
}

.fto-late-card,
.fto-academy-card {
  flex: 1;
  min-height: 0;
  max-width: none;
}

.fto-academy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.fto-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.fto-toggle-text {
  font-size: 11px;
  color: #94a3b8;
  font-weight: bold;
  white-space: nowrap;
}

.fto-toggle-track {
  position: relative;
  width: 38px;
  height: 20px;
  background: #1f2937;
  border: 1px solid #334155;
  border-radius: 999px;
  flex-shrink: 0;
}

.fto-toggle-thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 16px;
  height: 16px;
  background: #60a5fa;
  border-radius: 50%;
  transition: left 0.15s ease, background 0.15s ease;
}

.fto-toggle-thumb--right {
  left: 19px;
  background: #4ade80;
}

.fto-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
}

.fto-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.fto-academy-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 140px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 8px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
}

.fto-academy-preview::-webkit-scrollbar {
  width: 8px;
}

.fto-academy-preview::-webkit-scrollbar-track {
  background: transparent;
}

.fto-academy-preview::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
}

.fto-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.fto-week-nav-btn {
  padding: 6px 12px;
  font-size: 16px;
  line-height: 1;
}

.fto-week-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fto-week-range {
  font-size: 13px;
  color: #94a3b8;
  font-weight: bold;
}

.fto-week-day-picker {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
}

.fto-week-day-pill {
  position: relative;
  flex: 1;
  min-width: 44px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  color: #94a3b8;
}

.fto-week-day-pill:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.fto-week-day-pill-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fto-week-day-pill-date {
  font-size: 12px;
  font-weight: bold;
  color: #e5e7eb;
}

.fto-week-day-pill-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.fto-week-day-pill.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.fto-week-day-pill.active .fto-week-day-pill-date {
  color: #fff;
}

.fto-week-day-detail {
  margin-top: 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 12px;
  min-height: 64px;
}

.fto-week-day-detail-head {
  font-weight: bold;
  color: #f1f5f9;
  font-size: 13px;
  margin-bottom: 6px;
}

.fto-week-check {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
  padding: 3px 0;
}

.fto-week-empty {
  font-size: 13px;
  color: #64748b;
}

.fto-week-rank-toggle {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}

.fto-week-rank-toggle .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
}

.fto-week-ranking {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
}

.fto-week-ranking::-webkit-scrollbar {
  width: 8px;
}

.fto-week-ranking::-webkit-scrollbar-track {
  background: transparent;
}

.fto-week-ranking::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
}

.fto-week-rank-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #cbd5e1;
  padding: 5px 8px;
  border-radius: 6px;
  background: #0f172a;
}

.fto-week-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

#ftoWeekTabCurrent,
#ftoWeekTabHistory {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.fto-week-tabs .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
}

.fto-cal {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 10px;
  margin-top: 8px;
}

.fto-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.fto-cal-month-label {
  font-size: 13px;
  font-weight: bold;
  color: #f1f5f9;
  text-transform: capitalize;
}

.fto-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.fto-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.fto-cal-day {
  text-align: center;
  font-size: 12px;
  color: #cbd5e1;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
}

.fto-cal-day:hover {
  background: #1f2937;
}

.fto-cal-day--empty {
  cursor: default;
}

.fto-cal-day--in-range {
  background: rgba(37, 99, 235, 0.25);
}

.fto-cal-day--start,
.fto-cal-day--end {
  background: #2563eb;
  color: #fff;
  font-weight: bold;
}

.fto-cal-day--start {
  border-radius: 6px 0 0 6px;
}

.fto-cal-day--end {
  border-radius: 0 6px 6px 0;
}

.fto-cal-day--start.fto-cal-day--end {
  border-radius: 6px;
}

.fto-cal-range-label {
  margin-top: 8px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.fto-history-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 60px;
  margin-top: 10px;
  overflow-y: auto;
}

.fto-history-results::-webkit-scrollbar {
  width: 8px;
}

.fto-history-results::-webkit-scrollbar-track {
  background: transparent;
}

.fto-history-results::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
}

.fto-range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #cbd5e1;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0f172a;
  gap: 8px;
}

.fto-range-row--clickable {
  cursor: pointer;
}

.fto-range-row--clickable:hover {
  background: #1f2937;
}

.fto-day-detail-body {
  margin-top: 10px;
  max-height: 50vh;
  overflow-y: auto;
  text-align: left;
}

.fto-day-detail-body::-webkit-scrollbar {
  width: 8px;
}

.fto-day-detail-body::-webkit-scrollbar-track {
  background: transparent;
}

.fto-day-detail-body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
}

.fto-range-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: bold;
  color: #0b1220;
  white-space: nowrap;
}

.fto-range-badge--present {
  background: #4ade80;
}

.fto-range-badge--late {
  background: #fbbf24;
}

.fto-range-badge--absent {
  background: #f87171;
}

/* === Custom modal (zamiast alert/confirm/prompt) === */
.fto-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.fto-modal-overlay.show {
  display: flex;
}

.fto-modal-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
  text-align: center;
}

.fto-modal-title {
  font-size: 16px;
  font-weight: bold;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.fto-modal-message {
  font-size: 14px;
  color: #94a3b8;
}

.fto-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.fto-modal-actions .btn {
  flex: 1;
}

.fto-modal-btn-cancel {
  background: #374151 !important;
  color: #e5e7eb !important;
}

.fto-modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.fto-modal-text {
  color: #e5e7eb;
  font-size: 14px;
}

.fto-manage-list-wrap {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 6px;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fto-manage-list-wrap::-webkit-scrollbar {
  width: 8px;
}

.fto-manage-list-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.fto-manage-list-wrap::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 8px;
}

.obecnosc-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.obecnosc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#obecnoscSubmitBtn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
}

.obecnosc-img-slot {
  width: 140px;
  height: 140px;
  border: 2px dashed #334155;
  border-radius: 12px;
  background: #0f172a;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}

.obecnosc-img-slot:hover {
  border-color: #60a5fa;
}

.obecnosc-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #475569;
  font-size: 12px;
  cursor: default;
}

.obecnosc-img-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.65);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: #f87171;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.obecnosc-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e3a5f;
  border: 1px solid #2563eb;
  color: #93c5fd;
  min-width: 22px;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

/* === RTO APP === */
#rtoApp {
  display: none;
  width: 100%;
  height: 100vh;
  flex-direction: column;
  background: #0b1220;
}

.fto-panel-header {
  padding: 16px;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #111827;
}

/* Pasek postępu egzaminu RTO wpięty w nagłówek panelu (zamiast pod obrazkiem) */
.rto-header-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 20px;
  max-width: 480px;
  min-width: 0;
}

.rto-header-progress #rtoQuestionLabel,
.rto-header-progress .rto-score-badge {
  white-space: nowrap;
}

.rto-header-progress .rto-progress-bar-wrap {
  flex: 1;
  min-width: 60px;
}

/* Pasek z przyciskami odpowiedzi przypięty na samym dole panelu egzaminu */
.rto-bottom-bar {
  display: none;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #334155;
  background: #111827;
}

.fto-panel-body {
  flex: 1;
  overflow: auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

#rtoExam {
  width: 100% !important;
  max-width: 680px !important;
  margin: 0 auto !important;
}

/* Ekran powitalny */
#rtoWelcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.rto-welcome-icon {
  width: 72px;
  height: 72px;
  background: #1e3a5f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #2563eb;
}

.rto-welcome-title {
  margin: 0;
  font-size: 26px;
  font-weight: bold;
  color: #f1f5f9;
}

.rto-welcome-sub {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.rto-rules-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 18px 20px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.rto-rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

.rto-rule-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  margin-top: 6px;
  flex-shrink: 0;
}

.rto-start-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.rto-start-btn:hover { background: #1d4ed8; }

/* Progress bar */
.rto-question-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 6px;
}

.rto-score-badge {
  background: #1e3a5f;
  color: #60a5fa;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
}

.rto-progress-bar-wrap {
  height: 6px;
  background: #1f2937;
  border-radius: 4px;
  overflow: hidden;
}

.rto-progress-bar-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Karta z obrazkiem — rozciąga się na całą dostępną wysokość do paska przycisków */
.rto-img-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  flex: 1;
  min-width: 0;
}

.rto-question-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  cursor: zoom-in;
}

/* Powiększony podgląd obrazka po kliknięciu — kliknięcie gdziekolwiek zamyka */
.rto-img-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  box-sizing: border-box;
}

.rto-img-zoom-overlay.show {
  display: flex;
}

.rto-img-zoom-overlay img {
  max-width: 95%;
  max-height: 95%;
  border-radius: 12px;
  cursor: zoom-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Spinner */
.rto-img-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #64748b;
  font-size: 13px;
}

.rto-spinner-ring {
  width: 36px;
  height: 36px;
  border: 3px solid #1f2937;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: rtoSpin 0.8s linear infinite;
}

@keyframes rtoSpin {
  to { transform: rotate(360deg); }
}

/* Przyciski odpowiedzi — mały pasek na dole panelu */
.rto-btn-correct {
  flex: 1;
  background: #15803d;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.rto-btn-correct:hover:not(:disabled) { background: #166534; }
.rto-btn-correct:active:not(:disabled) { transform: scale(0.97); }
.rto-btn-correct:disabled { opacity: 0.5; cursor: not-allowed; }

.rto-btn-5050 {
  flex: 1;
  background: #b45309;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s;
}

.rto-btn-5050:hover:not(:disabled) { background: #92400e; }
.rto-btn-5050:active:not(:disabled) { transform: scale(0.97); }
.rto-btn-5050:disabled { opacity: 0.5; cursor: not-allowed; }

.rto-btn-wrong {
  flex: 1;
  background: #b91c1c;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
}

.rto-btn-wrong:hover:not(:disabled) { background: #991b1b; }
.rto-btn-wrong:active:not(:disabled) { transform: scale(0.97); }
.rto-btn-wrong:disabled { opacity: 0.5; cursor: not-allowed; }

/* Overlay animacji */
#rtoFeedbackOverlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8888;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#rtoFeedbackOverlay.show {
  display: flex;
}

.rto-feedback-bubble {
  padding: 32px 56px;
  border-radius: 24px;
  font-size: 52px;
  font-weight: bold;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: rtoPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.rto-feedback-bubble.correct {
  background: #14532d;
  border: 3px solid #4ade80;
  color: #4ade80;
}

.rto-feedback-bubble.wrong {
  background: #450a0a;
  border: 3px solid #f87171;
  color: #f87171;
}

.rto-feedback-bubble.half {
  background: #451a03;
  border: 3px solid #fbbf24;
  color: #fbbf24;
}

.rto-feedback-label {
  font-size: 18px;
  font-weight: normal;
  opacity: 0.8;
}

@keyframes rtoPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ekran wyników */
.rto-result-card {
  background: #111827;
  border-radius: 20px;
  border: 1px solid #1f2937;
  padding: 40px 36px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.rto-result-score {
  font-size: 86px;
  font-weight: bold;
  line-height: 1;
}

.rto-result-score.pass { color: #4ade80; }
.rto-result-score.fail { color: #f87171; }

.rto-result-label {
  font-size: 22px;
  font-weight: bold;
}

.rto-result-label.pass { color: #4ade80; }
.rto-result-label.fail { color: #f87171; }

.rto-result-sub {
  font-size: 14px;
  color: #64748b;
}

.rto-result-divider {
  width: 100%;
  height: 1px;
  background: #1f2937;
}

.rto-result-details {
  display: flex;
  gap: 30px;
  justify-content: center;
  font-size: 14px;
}

.rto-result-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.rto-result-detail-num {
  font-size: 28px;
  font-weight: bold;
}

.rto-result-detail-num.green { color: #4ade80; }
.rto-result-detail-num.red   { color: #f87171; }

.rto-result-detail-lbl {
  color: #64748b;
  font-size: 12px;
}

.rto-back-btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rto-back-btn:hover { background: #1d4ed8; }

/* Konfetti */
.rto-confetti-particle {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 7777;
  animation: rtoFall linear forwards;
}

@keyframes rtoFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
