/* File: public_html/assets/css/main.css
 * Purpose: Base styles for layout, nav, cards. BC palette. Light background per brandbook.
 * Context: Karta Pracy v5
 * Output: CSS
 * Version: 0.1.1 (2026-01-07)
 */
:root{
  /* BC palette */
  --bg: #EAE6DD;      /* light background (brandbook) */
  --text: #0B0B0B;    /* black for text/logo only */
  --steel: #3A3A3A;
  --gold: #C4A15A;
  --brass: #A68648;
  --blue: #546C7B;
  --ash: #EAE6DD;
  --ok: #1F6B4A;
  --bad: #4C1E1E;

  --surface: #FFFFFF; /* cards */
  --line: rgba(11,11,11,.12);
  --line2: rgba(11,11,11,.18);

  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.10);
  --max: 1100px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{ color: inherit; text-decoration:none; }
.muted{ color: rgba(11,11,11,.65); }

.app{ min-height:100%; display:flex; flex-direction:column; }

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(234,230,221,.92);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.brand{ display:flex; align-items:center; gap:12px; }
.brand__logo{ width:34px; height:34px; display:block; }
.brand__name{ font-weight:800; letter-spacing:.3px; }

.topbar__right{ display:flex; align-items:center; gap:10px; }

.userbox{
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.65);
}
.userbox__name{ font-size: 13px; font-weight: 800; }
.userbox__role{ font-size: 12px; color: rgba(11,11,11,.60); }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 2px solid rgba(11,11,11,.18);
  background: var(--gold);
  color: #0B0B0B;
  font-weight: 800;
  cursor: pointer;
}
.btn--ghost{
  background: transparent;
  color: var(--text);
  border-color: rgba(11,11,11,.18);
}
.btn:hover{ filter: brightness(1.02); }

.burger{
  display:none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(11,11,11,.18);
  background: rgba(255,255,255,.55);
  cursor:pointer;
}
.burger span{
  display:block;
  height:2px;
  margin: 6px 10px;
  background: var(--text);
  opacity:.9;
}

.nav{
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.55);
}
.nav__inner{
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}
.nav__link{
  padding: 10px 12px;
  border-radius: 999px;
  border: 2px solid rgba(11,11,11,.14);
  background: rgba(255,255,255,.65);
}
.nav__link:hover{ border-color: rgba(84,108,123,.55); }
.nav__link.is-active{
  border-color: rgba(196,161,90,.95);
  box-shadow: 0 0 0 2px rgba(196,161,90,.25) inset;
}

.main{
  max-width: var(--max);
  width:100%;
  margin: 18px auto;
  padding: 0 16px 24px;
  flex: 1 0 auto;
}

.card{
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.card__body{ padding: 18px; }

h1{ margin: 0 0 12px; font-size: 22px; }
p{ margin: 10px 0; }

.alert{
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid rgba(11,11,11,.14);
  margin-bottom: 12px;
  background: rgba(255,255,255,.75);
}
.alert--ok{ border-color: rgba(31,107,74,.55); }
.alert--err{ border-color: rgba(76,30,30,.55); }

.form{ display:grid; gap: 10px; max-width: 420px; }
.label{ font-size: 13px; color: rgba(11,11,11,.70); }
.input,.select{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 2px solid rgba(11,11,11,.18);
  background: rgba(255,255,255,.90);
  color: var(--text);
}

/* Responsive hamburger */
@media (max-width: 820px){
  .burger{ display:inline-block; }
  .nav{ display:none; }
  .nav.is-open{ display:block; }
  .nav__inner{ flex-direction: column; align-items: stretch; }
  .nav__link{ border-radius: 14px; }
}

.footer{
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(255,255,255,.55);
}
.footer__inner{
  max-width: var(--max);
  margin: 0 auto;
  display:flex;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: rgba(11,11,11,.72);
  font-size: 13px;
}

/* Calendar */
.cal__head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cal__nav{ display:flex; align-items:center; gap: 10px; }
.cal__label{
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(255,255,255,.75);
}

.cal{
  display:grid;
  gap: 10px;
}
.cal__dow{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  font-weight: 800;
  color: rgba(11,11,11,.65);
  font-size: 13px;
  padding: 0 2px;
}
.cal__week{
  display:grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.cal__day{
  display:block;
  min-height: 78px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: rgba(255,255,255,.90);
  padding: 10px;
  position: relative;
  transition: transform .05s ease, border-color .15s ease;
}
.cal__day:hover{
  border-color: rgba(84,108,123,.65);
  transform: translateY(-1px);
}
.cal__day.is-weekend{
  border-color: rgba(11,11,11,.18);
  background: rgba(255,255,255,.70);
}
.cal__day.is-today{
  border-color: rgba(196,161,90,.95);
  box-shadow: 0 0 0 2px rgba(196,161,90,.22) inset;
}
.cal__day.has-note .cal__dot{
  position:absolute;
  right: 10px;
  bottom: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--gold);
  border: 2px solid rgba(11,11,11,.18);
}
.cal__num{ font-weight: 900; }

/* Form extras */
.textarea{
  width:100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 2px solid rgba(11,11,11,.18);
  background: rgba(255,255,255,.90);
  color: var(--text);
  resize: vertical;
}
.row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }

.cal__empty{
  min-height: 78px;
  border-radius: 14px;
  border: 1px dashed rgba(11,11,11,.12);
  background: rgba(255,255,255,.35);
}


/* Day frame colors */
.cal__day{ border-color:#3A3A3A; }          /* normal */
.cal__day.is-weekend{ border-color:#9ED9A3;} /* Saturday */
/* holiday */
.cal__day.is-today{ border-width:4px; }      /* today */


/* Calendar mobile fit */
@media (max-width: 520px){
  .card__body{ padding: 14px; }
  .cal__dow, .cal__week{ gap: 8px; }
  .cal__day, .cal__empty{ min-height: 68px; border-radius: 12px; }
  .cal__day{ padding: 8px; }
}
@media (max-width: 390px){
  .card__body{ padding: 12px; }
  .cal__dow, .cal__week{ gap: 6px; }
  .cal__day, .cal__empty{ min-height: 62px; border-radius: 12px; }
  .cal__day{ padding: 7px; }
  .cal__dow{ font-size: 12px; }
}


/* Profile layout helpers */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 820px){
  .grid2{ grid-template-columns: 1fr; }
}
.h2{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}
.small{ font-size: 13px; }
.kv{ display:grid; gap: 8px; }
.kv__row{
  display:flex;
  justify-content:space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(11,11,11,.12);
  background: rgba(234,230,221,.35);
}
.kv__k{ color: rgba(11,11,11,.65); font-weight: 800; }
.kv__v{ font-weight: 900; }


/* Tasks table + mobile cards */
.tablewrap{ width:100%; overflow:auto; }
.table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 760px;
}
.table th, .table td{
  text-align:left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(11,11,11,.12);
  vertical-align: top;
}
.table thead th{
  font-size: 13px;
  color: rgba(11,11,11,.65);
  font-weight: 900;
}
.t-right{ text-align:right; }

.btn--sm{ padding: 8px 10px; font-size: 13px; }

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(11,11,11,.14);
  background: rgba(234,230,221,.35);
  font-weight: 900;
  font-size: 12px;
}
.pill--p1{ background: rgba(84,108,123,.18); }
.pill--p2{ background: rgba(84,108,123,.14); }
.pill--p3{ background: rgba(234,230,221,.55); }
.pill--p4{ background: rgba(196,161,90,.18); }
.pill--p5{ background: rgba(196,161,90,.28); }

.pill--s1{ border-color: rgba(58,58,58,.35); }
.pill--s2{ border-color: rgba(84,108,123,.55); }
.pill--s3{ border-color: rgba(31,107,74,.55); }
.pill--s4{ border-color: rgba(196,161,90,.65); }
.pill--s5{ border-color: rgba(58,58,58,.55); }
.pill--s6{ border-color: rgba(76,30,30,.55); }

.filters{ display:flex; gap: 10px; flex-wrap: wrap; align-items:center; }
.chk{ display:flex; gap: 8px; align-items:center; font-weight: 800; color: rgba(11,11,11,.72); }
.chk input{ width: 18px; height: 18px; }

/* Mobile: table -> cards */
@media (max-width: 820px){
  .table{ min-width: 0; }
  .table thead{ display:none; }
  .table, .table tbody, .table tr, .table td{ display:block; width:100%; }
  .table tr{
    border: 1px solid rgba(11,11,11,.12);
    border-radius: 14px;
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255,255,255,.75);
  }
  .table td{
    border: 0;
    padding: 8px 6px;
    display:flex;
    justify-content:space-between;
    gap: 12px;
  }
  .table td::before{
    content: attr(data-label);
    color: rgba(11,11,11,.60);
    font-weight: 900;
  }
  .t-right{ text-align:left; }
}


/* Day edit tabs */
.tabs{ display:flex; gap:10px; margin-bottom: 10px; flex-wrap:wrap; }
.tab{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(11,11,11,.14);
  background: rgba(255,255,255,.65);
  font-weight: 900;
}
.tab.is-active{
  border-color: rgba(196,161,90,.95);
  box-shadow: 0 0 0 2px rgba(196,161,90,.22) inset;
}

.cal__day.is-weekend.is-sun{ border-color:#1F6B4A; } /* Sunday */


/* Holiday (DB) – dark red border */
.cal__day.is-holiday{
  border-color:#7A1E1E;
}
.cal__day.is-holiday.is-today{
  box-shadow: 0 0 0 2px rgba(122,30,30,.18) inset;
}




/* ===== KP v5 — status dnia pracownika (kp_days.status) ===== */
.cal__day.ds-1 { background:#3fa65b; }    /* 1 wolny – zielony */
.cal__day.ds-2 { background:#3a3a3a; }    /* 2 roboczy – ciemnoszary */
.cal__day.ds-3 { background:#d6d6d6; }    /* 3 delegacja – jasnoszary */
.cal__day.ds-4 { background:#f2a33a; }    /* 4 urlop – pomarańczowy */
.cal__day.ds-5 { background:#e36b6b; }    /* 5 chorobowe – jasnoczerwony */
.cal__day.ds-6 { background:#7b2d7b; color:#fff; } /* 6 święto – purpura */
.cal__day.ds-7 { background:#f4d23c; }    /* 7 bezpłatne – żółty */
/* brak statusu = neutralny */
