/* ═══════════════════════════════════════════
   aMuz Design System — SOWA (System Obsługi Wydarzeń Akademickich)
   ═══════════════════════════════════════════ */

/* FONTS */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* VARIABLES */
:root {
  --amuz-red: #e63946;
  --amuz-red-dark: #c1121f;
  /* Czerwień dla tekstu — #e63946 ma 4.2:1 (poniżej WCAG AA 4.5:1) */
  --amuz-red-text: var(--amuz-red-dark);
  --gold: #d4af37;
  --ink: #0f172a;
  --ink-soft: #475569;
  /* WCAG AA: ≥4.5:1 także na --bg i --surface (#94a3b8 miał 2.3–2.6:1) */
  --muted: #5b6f8c;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --surface: #f1f5f9;
  --shadow-sm:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 10px 25px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.1);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius: 8px;
  --font-main: "Plus Jakarta Sans", sans-serif;
  --topbar-h: 60px;
  --nav-h: 52px;
  --success: #15803d;
  --error: #dc2626;
  --info: #2563eb;
  --text: var(--ink);
  --text-dim: var(--ink-soft);
  --text-muted: var(--muted);
  --border: var(--line);
  --border-strong: #cbd5e1;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --gold-border: rgba(212, 175, 55, 0.3);
  --transition: 0.18s ease;
}

[data-theme="dark"] {
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --line: #334155;
  --border-strong: #475569;
  --bg: #0b1120;
  --card: #1e293b;
  --surface: #0f172a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-main);
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(at 100% 0%, rgba(230, 57, 70, 0.04) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(15, 23, 42, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  transition:
    background-color 0.3s,
    color 0.3s;
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(at 100% 0%, rgba(230, 57, 70, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(15, 23, 42, 0.5) 0px, transparent 50%);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  outline: none;
}
button {
  cursor: pointer;
  background: none;
  border: none;
}
h1,
h2,
h3,
h4 {
  letter-spacing: -0.02em;
}

/* ═══ TOPBAR ═══ */
#app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo img {
  width: 36px !important;
  height: auto;
  display: block;
}

.header-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-title-full {
  font-weight: 600;
  color: var(--ink-soft);
}

.header-subtitle {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.header-user-name {
  font-weight: 700;
  color: var(--ink);
}

.header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amuz-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
  user-select: none;
}

#btn-logout {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  transition: var(--transition);
  font-family: inherit;
  letter-spacing: 0.03em;
}

#btn-logout:hover {
  border-color: var(--amuz-red);
  color: var(--amuz-red-text);
}

/* ═══ NAV TABS ═══ */
#nav-tabs {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  z-index: 99;
  height: var(--nav-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 4px;
}
.nav-tab {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.nav-tab:hover {
  color: var(--ink-soft);
  background: var(--surface);
}
.nav-tab.active {
  color: var(--amuz-red-text);
  background: rgba(230, 57, 70, 0.07);
  border-color: rgba(230, 57, 70, 0.18);
  font-weight: 700;
}
.nav-tab i {
  width: 14px;
  height: 14px;
}

/* ═══ MAIN LAYOUT ═══ */
#app-main {
  position: fixed;
  top: calc(var(--topbar-h) + var(--nav-h));
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto;
}
.module {
  display: none;
}
.module.active {
  display: block;
}
.module-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}
.module-inner.wide {
  max-width: 1200px;
}
.module-inner.full {
  max-width: none;
  padding: 36px 28px 80px;
}

/* ═══ LOGIN ═══ */
#login-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-md);
}

.login-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.login-emblem img {
  width: 100px !important;
  height: auto;
  display: block;
}

.login-card h1 {
  font-size: 1.6rem;
  margin-bottom: 8px;
  font-weight: 800;
}

.login-tagline {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.login-card p {
  color: var(--ink-soft);
  font-size: 13px;
  margin-bottom: 32px;
  line-height: 1.7;
}

#btn-login {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 24px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

#btn-login:hover {
  background: var(--amuz-red);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.3);
}

#btn-login:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* dark mode */

/* ═══ FORM PAGE ═══ */
.form-page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.form-page-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.form-page-header p {
  color: var(--ink-soft);
  font-size: 13px;
}

/* form section cards */
.form-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.form-section:focus-within {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.section-header {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.section-header:hover {
  background: rgba(0, 0, 0, 0.025);
}
.section-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(230, 57, 70, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amuz-red);
  flex-shrink: 0;
}
.section-header-icon i {
  width: 15px;
  height: 15px;
}
.section-header-text h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 1px;
}
.section-header-text p {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.section-content {
  padding: 4px 22px 22px;
  border-top: 1px solid var(--line);
}
.section-content[hidden] {
  display: none;
}

/* collapsible section chevron */
.section-chevron {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: auto;
  transition: transform 0.25s ease;
}
.form-section.collapsed .section-chevron {
  transform: rotate(-90deg);
}
.form-section.collapsed .section-content {
  display: none;
}
.section-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  vertical-align: middle;
}
.section-badge.visible {
  opacity: 1;
}

/* conditional sections */
.conditional-section {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height 0.35s ease,
    opacity 0.25s ease;
}
.conditional-section.visible {
  max-height: 900px;
  opacity: 1;
}

/* form fields */
.field-group {
  margin-top: 18px;
}
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.field-label .required {
  color: var(--amuz-red-text);
  margin-left: 3px;
}
.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.5;
  font-weight: 500;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--amuz-red);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}
.field-input.error,
.field-select.error {
  border-color: var(--error);
}
.field-input::placeholder {
  color: var(--muted);
}
.field-textarea {
  resize: vertical;
  min-height: 88px;
}
.field-select option {
  background: var(--card);
}
/* Link do kalendarza rezerwacji sal */
.sala-cal-link {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--amuz-red-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sala-cal-link i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.field-error {
  font-size: 11px;
  color: var(--error);
  margin-top: 5px;
  display: none;
  font-weight: 600;
}
.field-error.show {
  display: block;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-row.triple {
  grid-template-columns: 1fr 1fr 1fr;
}

/* YN toggle */
.yn-toggle {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.yn-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
  text-align: center;
}
.yn-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.yn-btn.active-yes {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.35);
  color: var(--success);
}
.yn-btn.active-no {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--error);
}

/* checkbox grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 7px;
  margin-top: 8px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.checkbox-item:hover {
  border-color: rgba(230, 57, 70, 0.3);
}
.checkbox-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  accent-color: var(--amuz-red);
  cursor: pointer;
}
.checkbox-item.checked {
  border-color: rgba(230, 57, 70, 0.3);
  background: rgba(230, 57, 70, 0.05);
}
.checkbox-item label {
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-soft);
  line-height: 1.3;
  font-weight: 500;
}
.checkbox-item.checked label {
  color: var(--ink);
  font-weight: 600;
}
.checkbox-item.disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* people picker */
.people-picker {
  position: relative;
}
.people-picker-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.people-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: none;
}
.people-results.show {
  display: block;
}
.people-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  border-bottom: 1px solid var(--line);
}
.people-result-item:last-child {
  border-bottom: none;
}
.people-result-item:hover {
  background: rgba(230, 57, 70, 0.04);
}
.people-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(230, 57, 70, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amuz-red);
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.people-info-name {
  font-size: 13px;
  font-weight: 700;
}
.people-info-email {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.people-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(230, 57, 70, 0.05);
  border: 1px solid rgba(230, 57, 70, 0.2);
  border-radius: var(--radius-sm);
  margin-top: 6px;
}
.people-selected-name {
  font-size: 13px;
  font-weight: 700;
  flex: 1;
}
.people-selected-email {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.people-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  line-height: 0;
  transition: var(--transition);
}
.people-clear:hover {
  color: var(--error);
}

/* location */
.location-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.location-custom {
  display: none;
}
.location-custom.show {
  display: block;
}

/* Podpowiedzi miejsc (wzorzec _WZORCE-APLIKACJI/podpowiedzi-autocomplete.md) */
.ac-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 2px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 50;
}
.ac-list.open {
  display: block;
}
.ac-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.ac-item:last-child {
  border-bottom: none;
}
.ac-item:hover,
.ac-item.active {
  background: rgba(230, 57, 70, 0.06);
}
.ac-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.ac-addr {
  font-size: 12px;
  color: var(--muted);
}

/* bool checkbox */
.bool-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg);
  transition: var(--transition);
}
.bool-checkbox:hover {
  border-color: var(--border-strong);
}
.bool-checkbox input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--amuz-red);
  cursor: pointer;
}
.bool-checkbox label {
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-soft);
  line-height: 1.4;
  font-weight: 500;
}

/* file upload */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg);
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--amuz-red);
  background: rgba(230, 57, 70, 0.03);
}
.drop-zone i {
  width: 28px;
  height: 28px;
  color: var(--muted);
  margin-bottom: 10px;
}
.drop-zone p {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  font-weight: 600;
}
.drop-zone span {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
#file-input {
  display: none;
}
.file-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.file-item i {
  width: 14px;
  height: 14px;
  color: var(--amuz-red);
  flex-shrink: 0;
}
.file-item-name {
  font-size: 13px;
  flex: 1;
  font-weight: 500;
}
.file-item-size {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.file-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 2px;
  line-height: 0;
  transition: var(--transition);
}
.file-item-remove:hover {
  color: var(--error);
}

/* submit */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  margin-top: 8px;
}
#btn-submit {
  background: var(--amuz-red);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 13px 32px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
#btn-submit:hover:not(:disabled) {
  background: var(--amuz-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 57, 70, 0.3);
}
#btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
#btn-reset {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 24px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}
#btn-reset:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}

/* spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.spinner.show {
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* success banner */
.btn-confirm-danger {
  background: var(--amuz-red);
  color: #fff;
}
.btn-confirm-warning {
  background: #b45309;
  color: #fff;
}
.btn-confirm-default {
  background: var(--ink);
  color: #fff;
}

#success-banner {
  display: none;
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 24px;
  align-items: flex-start;
  gap: 14px;
}
#success-banner.show {
  display: flex;
}
#success-banner i {
  color: var(--success);
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 1px;
}
#success-banner h3 {
  font-size: 14px;
  margin-bottom: 3px;
  color: #15803d;
  font-weight: 800;
}
#success-banner p {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}

/* ═══ CALENDAR MODULE ═══ */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.calendar-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}
.calendar-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-select {
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-select:focus {
  border-color: var(--amuz-red);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

#calendar-container {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Widok listy — ogranicz wysokość i włącz scroll */
.fc-list-view .fc-scroller,
.fc .fc-list {
  max-height: calc(100vh - 260px) !important;
  overflow-y: auto !important;
}
.calendar-legend {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* FullCalendar overrides — light theme */
.fc {
  --fc-border-color: var(--line);
  --fc-today-bg-color: rgba(230, 57, 70, 0.05);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--surface);
  --fc-list-event-hover-bg-color: rgba(230, 57, 70, 0.04);
  font-family: var(--font-main) !important;
}
.fc .fc-toolbar-title {
  font-family: var(--font-main);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}
.fc .fc-button {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-soft) !important;
  font-family: var(--font-main) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  transition: var(--transition) !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  box-shadow: none !important;
}
.fc .fc-button:hover {
  border-color: var(--amuz-red) !important;
  color: var(--amuz-red-text) !important;
}
.fc .fc-button-active {
  background: rgba(230, 57, 70, 0.08) !important;
  border-color: rgba(230, 57, 70, 0.3) !important;
  color: var(--amuz-red-text) !important;
}
/* Weekend — nagłówki kolumn sob. i niedz. na czerwono */
.fc .fc-day-sat .fc-col-header-cell-cushion,
.fc .fc-day-sun .fc-col-header-cell-cushion {
  color: var(--amuz-red-text) !important;
  font-weight: 800;
}
/* Weekend — tło komórek dni */
.fc .fc-day-sat,
.fc .fc-day-sun {
  background: rgba(230, 57, 70, 0.025);
}

.fc .fc-col-header-cell-cushion {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}
.fc .fc-daygrid-day-number {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  color: var(--amuz-red-text);
  font-weight: 800;
}
.fc .fc-event {
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  border: none !important;
}
.fc .fc-daygrid-body {
  font-size: 13px;
}
.fc-event-zaplanowane {
  background: #e63946 !important;
  color: #fff !important;
}
.fc-event-nowe {
  background: #2563eb !important;
  color: #fff !important;
}
.fc-event-dyplomowy,
.fc-event-magisterski {
  background: #b45309 !important;
  color: #fff !important;
}
.fc-event-licencjacki {
  background: #7c3aed !important;
  color: #fff !important;
}
/* Robocze — szary, nadpisuje kolor typu */
.fc-event-pending,
.fc-event-pending.fc-event-zaplanowane,
.fc-event-pending.fc-event-nowe,
.fc-event-pending.fc-event-dyplomowy,
.fc-event-pending.fc-event-magisterski,
.fc-event-pending.fc-event-licencjacki {
  background: #fef08a !important;
  border-color: #eab308 !important;
  color: #713f12 !important;
  opacity: 0.9;
}
/* Zrealizowane — wyciszone szarym tłem, bez opacity (opacity psuło kontrast
   tekstu do 2.3:1; teraz #475569 na #e2e8f0 = 6.2:1) */
.fc-event-zrealizowane,
.fc-event-zrealizowane.fc-event-zaplanowane,
.fc-event-zrealizowane.fc-event-nowe,
.fc-event-zrealizowane.fc-event-dyplomowy,
.fc-event-zrealizowane.fc-event-magisterski,
.fc-event-zrealizowane.fc-event-licencjacki {
  background: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}
.fc-event-zrealizowane * {
  color: #475569 !important;
}

/* ═══ FullCalendar — widok listowy ═══ */

/* FC ustawia background-color jako inline style na <tr> — nadpisujemy bezpośrednio */
tr.fc-list-event,
tr.fc-list-event.fc-list-event-harness,
.fc-list-event-harness {
  background-color: transparent !important;
  --fc-neutral-bg-color: transparent;
}
tr.fc-list-event:hover,
tr.fc-list-event:hover td {
  background-color: var(--surface) !important;
}
tr.fc-list-event td,
tr.fc-list-event th {
  background-color: transparent !important;
  background: transparent !important;
  color: var(--ink) !important;
  border: none !important;
  box-shadow: none !important;
}
tr.fc-list-event {
  border-bottom: 1px solid var(--line) !important;
}

/* Ukryj dot */
.fc-list-event-dot {
  display: none !important;
}
/* Zeruj kolumnę dot całkowicie */
.fc-list-event-graphic {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  overflow: hidden;
}

/* Stała szerokość kolumny czasu — wyrównuje tytuły */
.fc-list-event-time {
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap;
  width: 120px !important;
  min-width: 120px !important;
}

/* Kolumna tytułu — tytuł po lewej, badge po prawej */
.fc-list-event-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px !important;
}
.fc-list-event-title a {
  color: var(--ink) !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 13px;
}

/* Badge z typem */
.fc-list-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}
.fc-list-badge-zaplanowane {
  background: rgba(230, 57, 70, 0.1);
  color: #c81a27;
  border: 1px solid rgba(230, 57, 70, 0.3);
}
.fc-list-badge-nowe {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.3);
}
.fc-list-badge-dyplomowy {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.fc-list-badge-licencjacki {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.3);
}
.fc-list-badge-magisterski {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border: 1px solid rgba(217, 119, 6, 0.3);
}
.fc-list-badge-inne {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* Nagłówki dni */
.fc-list-day-cushion {
  background: var(--surface) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft) !important;
  padding: 8px 14px !important;
}
.fc-list-day-side-text,
.fc-list-day-text {
  text-decoration: none !important;
  color: var(--ink-soft) !important;
}

/* Scroll widoku listy */
.fc .fc-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

/* ═══ fc-popover — styl motywu ═══ */
.fc-popover {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  background: var(--card) !important;
  font-family: var(--font-main) !important;
  overflow: hidden;
}
.fc-popover-header {
  background: var(--surface) !important;
  color: var(--ink) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid var(--line) !important;
}
.fc-popover-body {
  padding: 6px 8px !important;
  background: var(--card) !important;
}
.fc-popover .fc-event {
  margin-bottom: 3px;
}

/* ═══ EVENT MODAL ═══ */
.event-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.event-modal-overlay.show {
  display: flex;
}

#event-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#event-modal.show {
  display: flex;
}
.event-modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.event-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 6px;
  line-height: 0;
  transition: var(--transition);
  border-radius: var(--radius-sm);
}
.event-modal-close:hover {
  color: var(--ink);
  background: var(--surface);
}
.event-modal-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.event-modal-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
}
.event-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.event-detail-item label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: block;
  margin-bottom: 3px;
  font-weight: 800;
}
.event-detail-item span {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.event-detail-full {
  grid-column: 1/-1;
}

/* ═══ LIST MODULE ═══ */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.list-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}
.list-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.list-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.list-search-icon {
  position: absolute;
  left: 12px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.list-search {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px 8px 34px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: var(--transition);
  width: 220px;
}
.list-search::placeholder {
  color: var(--muted);
}
.list-search:focus {
  border-color: var(--amuz-red);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
  width: 280px;
}

#events-table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.events-table {
  width: 100%;
  border-collapse: collapse;
}
.events-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.events-table th:hover {
  color: var(--amuz-red-text);
}
.events-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-weight: 500;
}
.events-table tr:last-child td {
  border-bottom: none;
}
.events-table tbody tr {
  cursor: pointer;
  transition: var(--transition);
}
.events-table tbody tr:hover {
  background: rgba(230, 57, 70, 0.03);
}

.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.type-zaplanowane {
  background: rgba(230, 57, 70, 0.1);
  color: #c81a27;
}
.type-nowe {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
}
.type-dyplomowy {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}
.type-licencjacki {
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
}
.type-magisterski {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
}

.units-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.unit-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}
.sort-icon {
  opacity: 0.4;
  font-size: 10px;
}
.table-empty {
  text-align: center;
  padding: 60px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.table-empty i {
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  display: block;
  opacity: 0.3;
}
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--amuz-red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ═══ DETAIL MODAL ═══ */
#detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
#detail-modal.show {
  display: flex;
}
.detail-modal-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 700px;
  width: 100%;
  margin: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.detail-section {
  margin-bottom: 28px;
}
.detail-section h4 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amuz-red-text);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(230, 57, 70, 0.15);
}
.detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.detail-field label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 3px;
  font-weight: 800;
}
.detail-field span {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.detail-field.full {
  grid-column: 1/-1;
}

/* ═══ MY EVENTS — CARDS ═══ */
.mine-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.mine-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.mine-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}
.mine-card.type-zaplanowane::before {
  background: #e63946;
}
.mine-card.type-nowe::before {
  background: #2563eb;
}
.mine-card.type-dyplomowy::before {
  background: #b45309;
}
.mine-card.type-licencjacki::before {
  background: #7c3aed;
}
.mine-card.type-magisterski::before {
  background: #b45309;
}
.mine-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.mine-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.mine-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}
.mine-card-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 2px;
}
.mine-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.mine-card-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mine-card-field .lbl {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mine-card-field .val {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.mine-card-units {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.mine-card-submitted {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
}
.mine-empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-weight: 600;
}
.mine-empty-state svg {
  opacity: 0.25;
  margin: 0 auto 16px;
  display: block;
}
.mine-empty-state h3 {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 800;
}
.mine-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}
#mine-module {
  max-width: none;
}
.mine-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.mine-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

/* ═══ TOAST ═══ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success {
  background: #15803d;
}
.toast.error {
  background: var(--amuz-red);
}

/* ═══ PROGRESS BAR ═══ */
#form-progress {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  padding: 0 0 20px;
  margin: 0 0 8px;
}
#form-progress-track {
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
#form-progress-fill {
  height: 100%;
  background: var(--amuz-red);
  border-radius: 999px;
  width: 0%;
  transition: width 0.5s ease;
}

/* ═══ DRAFT INDICATOR ═══ */
#draft-saved-indicator {
  display: none;
  margin-left: 10px;
  font-size: 11px;
  color: #15803d;
  font-weight: 700;
}

/* ═══ CLEAR BTN ═══ */
#btn-clear-form {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
#btn-clear-form:hover {
  border-color: var(--error);
  color: var(--error);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .module-inner,
  .module-inner.wide {
    padding: 20px 16px 60px;
  }
  #app-header,
  #nav-tabs {
    padding-left: 16px;
    padding-right: 16px;
  }
  .field-row,
  .field-row.triple {
    grid-template-columns: 1fr;
  }
  .event-detail-grid,
  .detail-fields {
    grid-template-columns: 1fr;
  }
  .header-subtitle,
  .header-title-full {
    display: none;
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
  .events-table th:nth-child(n + 5),
  .events-table td:nth-child(n + 5) {
    display: none;
  }
  .mine-cards-grid {
    grid-template-columns: 1fr;
  }
  .mine-card-meta {
    grid-template-columns: 1fr;
  }
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ═══ KATEDRA SELECT ═══ */
.ksel-wrap {
  position: relative;
  display: block;
}

/* Wariant filtra (pill) */
.ksel-btn-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 32px 8px 14px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.ksel-btn-filter:hover,
.ksel-btn-filter.open {
  border-color: var(--amuz-red);
  color: var(--amuz-red-text);
}

/* Wariant pola formularza */
.ksel-btn-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 36px 10px 14px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  text-align: left;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.ksel-btn-field:focus,
.ksel-btn-field.open {
  border-color: var(--amuz-red);
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}
.ksel-btn-field .ksel-label {
  color: var(--ink);
}
.ksel-btn-field:not(:has(.ksel-dot)) .ksel-label {
  color: var(--muted);
}

.ksel-chevron {
  display: none;
}

/* Dropdown */
.ksel-dropdown {
  display: none;
  position: absolute;
  min-width: 320px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 999;
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}
.ksel-dropdown.open {
  display: block;
}

/* Opcje */
.ksel-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s;
}
.ksel-option:hover {
  background: var(--surface);
}
.ksel-option.ksel-selected {
  background: rgba(230, 57, 70, 0.06);
  font-weight: 700;
}
.ksel-option-empty {
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px solid var(--line);
}

/* Kropka wydziału */
.ksel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ksel-dot-btn {
  width: 9px;
  height: 9px;
}
.ksel-opt-text {
  flex: 1;
  line-height: 1.35;
}

/* Okres przejściowy terminów (DEADLINE_GRACE_END) — ramka informacyjna */
.grace-notice {
  margin: 10px 0;
  padding: 8px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
[data-theme="dark"] .grace-notice {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
  color: #fcd34d;
}

/* Pasek "Jest nowa wersja SOWA" (checkAppVersion w app.js) */
.version-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px;
  background: #1f2937;
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 600;
}
.version-bar button {
  padding: 6px 12px;
  background: var(--amuz-red);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
[data-theme="dark"] .version-bar {
  background: #f8fafc;
  color: #0f172a;
}

/* Strona główna — typy wydarzeń i terminy zgłoszeń (renderDashboardTypes w app.js) */
.dash-types {
  margin-top: 36px;
}
.dash-types-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 12px;
}
.dash-types-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.dash-types-head span {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}
.dash-types .grace-notice {
  margin: 0 0 12px;
}
.dash-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dash-type {
  --type-color: #c1121f;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--type-color);
  border-radius: var(--radius-md);
  padding: 16px 18px 18px;
}
.dash-type-nowe {
  --type-color: #2563eb;
}
.dash-type-koncert-dyplomowy {
  --type-color: #b45309;
}
.dash-type-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.dash-type-days {
  margin: 6px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--type-color);
}
.dash-type-days strong {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-right: 4px;
}
.dash-type p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
[data-theme="dark"] .dash-type {
  --type-color: #f87171;
}
[data-theme="dark"] .dash-type-nowe {
  --type-color: #60a5fa;
}
[data-theme="dark"] .dash-type-koncert-dyplomowy {
  --type-color: #fbbf24;
}
@media (max-width: 640px) {
  .dash-types-grid {
    grid-template-columns: 1fr;
  }
}
