
/* AneksTime v1.1 visual polish - kierunek webowy: miękkie karty, pigułki i czytelniejsze akcje */
:root {
  --at-accent: #b22222;
  --at-accent-dark: #7f1d1d;
  --at-bg: #f4f6fa;
  --at-surface: rgba(255,255,255,.94);
  --at-border: #e6eaf0;
  --at-text: #111827;
  --at-muted: #64748b;
  --at-shadow: 0 14px 38px rgba(15, 23, 42, .08);
}

html { scroll-behavior: auto; }
body {
  background:
    radial-gradient(circle at top left, rgba(178,34,34,.07), transparent 34rem),
    linear-gradient(180deg, #fff 0%, var(--at-bg) 18rem, var(--at-bg) 100%) !important;
  color: var(--at-text);
}

.card, .box, .person, .emp, .kpi, .table-wrap {
  border: 1px solid var(--at-border) !important;
  box-shadow: var(--at-shadow) !important;
}

.card, .box {
  background: var(--at-surface) !important;
  border-radius: 24px !important;
}

.person, .emp, .kpi {
  background: #fff !important;
  border-radius: 18px !important;
}

input, select, textarea {
  border-color: #cfd7e3 !important;
  background: #fff !important;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(178,34,34,.55) !important;
  box-shadow: 0 0 0 4px rgba(178,34,34,.10) !important;
}

button, .toplink, .anekstime-nav-link, .anekstime-nav-logout {
  border-radius: 999px !important;
}

button.primary, button.main, .primary, .main {
  background: linear-gradient(135deg, var(--at-accent), var(--at-accent-dark)) !important;
}

button.soft, button.secondary, button.ghost, .soft, .secondary, .ghost {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

button.warn, .warn {
  background: #fff7ed !important;
  color: #9a3412 !important;
}

button.danger, .danger {
  background: #fee2e2 !important;
  color: #991b1b !important;
}

.meta, .muted, .hint, label { color: var(--at-muted) !important; }

.pill, .badge {
  letter-spacing: .01em;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}

.at-profile-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.at-mini-note {
  color: var(--at-muted);
  font-size: 12px;
  margin-top: 4px;
}

@media (max-width: 700px) {
  body { padding-left: 10px !important; padding-right: 10px !important; }
  .card, .box { border-radius: 20px !important; }
}

/* v1.2 baseline fixes */
.emp.selected { border-color: #b22222 !important; box-shadow: 0 0 0 3px rgba(178,34,34,.14) !important; }
.anekstime-admin-shortcuts a[href="/install"] { display:none; }


/* v1.3 mobile admin cards: no horizontal table scroll */


/* AneksTime v1.4.1: mobile cards, normal desktop scroll and day swipe UI */
html, body {
  max-width: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  overscroll-behavior-y: auto !important;
}
body, main, .card, .box {
  touch-action: pan-y;
}
.mt-save-pulse {
  pointer-events: auto !important;
}
.day-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  margin-top: 8px;
}
.day-nav button {
  min-height: 42px;
  padding: 9px 10px;
  font-size: 13px;
}
.swipe-hint {
  margin-top: 7px;
  font-size: 12px;
  color: var(--at-muted);
  font-weight: 800;
}
.mobile-entry-cards {
  display: none;
}
.mobile-entry-card {
  background: #fff;
  border: 1px solid var(--at-border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 10px 28px rgba(15,23,42,.07);
}
.mobile-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.mobile-entry-name {
  font-weight: 950;
  font-size: 15px;
}
.mobile-entry-date {
  color: var(--at-muted);
  font-size: 12px;
  font-weight: 850;
  margin-top: 2px;
}
.mobile-entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0;
}
.mobile-entry-field {
  border-radius: 14px;
  background: #f8fafc;
  padding: 9px;
}
.mobile-entry-field small {
  display: block;
  color: var(--at-muted);
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 2px;
}
.mobile-entry-field b {
  font-size: 15px;
}
.mobile-entry-notes {
  color: var(--at-muted);
  font-size: 13px;
  margin: 8px 0;
  line-height: 1.35;
}
.mobile-entry-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}
.mobile-entry-actions .actions {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
.mobile-entry-actions button {
  width: 100% !important;
  min-height: 46px;
  font-size: 14px !important;
}

@media (max-width: 760px) {
  body { padding-left: 0 !important; padding-right: 0 !important; }
  main { padding-left: 8px !important; padding-right: 8px !important; overflow-x: hidden !important; }
  .card, .box { padding: 12px !important; border-radius: 20px !important; overflow: visible !important; }
  .grid { grid-template-columns: 1fr !important; }
  .row { display: grid !important; grid-template-columns: 1fr !important; }
  .row button, .primary-actions button, .big-action { width: 100% !important; }
  .cards { grid-template-columns: 1fr !important; }
  .table-wrap { display: none !important; }
  .mobile-entry-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .table-meta .counter { border-radius: 16px !important; line-height: 1.35; }
  .day-nav { grid-template-columns: 1fr 1fr; }
  .day-nav button:nth-child(2) { grid-column: 1 / -1; order: 3; }
}


/* AneksTime v1.4.1: mobile vertical scroll + broader swipe area */
html, body {
  height: auto !important;
  min-height: 100% !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
body, main, section, .card, .box, .hero, .hero-row {
  touch-action: auto !important;
}
@media (max-width: 760px) {
  html, body, main {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .card, .box, .hero {
    touch-action: auto !important;
  }
  .swipe-hint {
    font-size: 11px;
    line-height: 1.3;
  }
}


/* AneksTime v1.5 CLEAN MOBILE BASELINE
   Final mobile rules: vertical scroll has priority, horizontal swipe is handled only by JS threshold. */
html,
body {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100% !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: auto !important;
}
body,
main,
section,
.card,
.box,
.hero,
.hero-row {
  touch-action: pan-y !important;
}
input,
textarea,
select,
button,
a,
summary {
  touch-action: manipulation !important;
}
.table-wrap {
  max-width: 100%;
}
.mobile-entry-cards {
  display: none;
}
@media (max-width: 900px) {
  body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
  .card,
  .box,
  .hero {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  .table-wrap {
    display: none !important;
  }
  .mobile-entry-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .mobile-entry-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  .mobile-entry-actions .actions,
  .mobile-entry-actions {
    width: 100% !important;
  }
  .mobile-entry-actions .actions button {
    width: 100% !important;
  }
  .grid,
  .row,
  .two,
  .hero-row {
    grid-template-columns: 1fr !important;
  }
  .day-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  .day-nav button:nth-child(2) {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }
  .swipe-hint::after {
    content: " Jeśli ekran nie przewija się pionowo, przesuń palcem bardziej w górę/dół niż w bok.";
  }
}


/* AneksTime v1.6 clean mobile baseline
   Pionowe przewijanie ma zawsze pierwszeństwo. Swipe dnia jest obsługiwany progiem w JS. */
html,
body {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100% !important;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: auto !important;
}
body,
main,
section,
.card,
.box,
.hero,
.hero-row {
  touch-action: auto !important;
}
input,
textarea,
select,
button,
a,
summary {
  touch-action: manipulation !important;
}
.table-wrap {
  max-width: 100%;
}
.mobile-entry-cards {
  display: none;
}
@media (max-width: 900px) {
  body {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
  .card,
  .box,
  .hero {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  .table-wrap {
    display: none !important;
  }
  .mobile-entry-cards {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .mobile-entry-card {
    width: 100% !important;
    max-width: 100% !important;
  }
  .mobile-entry-actions .actions,
  .mobile-entry-actions {
    width: 100% !important;
  }
  .mobile-entry-actions .actions button {
    width: 100% !important;
  }
  .grid,
  .row,
  .two,
  .hero-row {
    grid-template-columns: 1fr !important;
  }
  .day-nav {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
  }
  .day-nav button:nth-child(2) {
    grid-column: 1 / -1 !important;
    order: 3 !important;
  }
}
