/* =========================================================================
   app.css — layout shell a rozvržení obrazovek ECDL systému.
   Staví na proměnných a komponentách z base.css.
   ========================================================================= */

:root { --row-pad: 9px 14px; } /* kompaktní hustota */

/* ----- Shell ----- */
.shell { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ----- Sidebar ----- */
.sidebar {
  width: 250px; flex: 0 0 250px; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.sidebar__logo { width: 34px; height: 34px; border-radius: 9px; background: #fff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.sidebar__name { font-weight: 800; font-size: 15px; letter-spacing: .01em; }
.sidebar__sub { font-size: 11px; color: rgba(255,255,255,.6); font-weight: 500; }
.sidebar__label { font-size: 10px; letter-spacing: .09em; text-transform: uppercase; color: rgba(255,255,255,.4); font-weight: 700; padding: 6px 12px; }
.sidebar__spacer { flex: 1; }
.sidebar__footer { border-top: 1px solid rgba(255,255,255,.12); margin: 10px 8px 0; padding-top: 12px; padding-left: 12px; font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,.45); }
.sidebar-overlay { display: none; }

/* ----- Topbar ----- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 13px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.topbar__burger { display: none; background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; align-items: center; justify-content: center; flex: 0 0 auto; color: var(--text); }
.topbar__titles { flex: 1; min-width: 0; }
.topbar__title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__sub { font-size: 12.5px; color: var(--text-soft); margin-top: 1px; }
.topbar__user { display: flex; align-items: center; gap: 9px; padding-left: 6px; border-left: 1px solid var(--border); flex: 0 0 auto; }
.topbar__user-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.topbar__user-meta { font-size: 11.5px; color: var(--text-soft); }
.topbar__logout { flex: 0 0 auto; }

/* ----- Hlavní obsah ----- */
.content { padding: 26px 30px; flex: 1; min-width: 0; }

/* ----- Dashboard ----- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 18px; }
.dash-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; }
.panel-title { font-weight: 800; font-size: 14.5px; margin-bottom: 13px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.list-row:first-of-type { border-top: none; }
.date-block { text-align: center; flex: 0 0 auto; width: 46px; }
.date-block__day { font-size: 18px; font-weight: 800; color: var(--primary); line-height: 1; }
.date-block__mon { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.row-grow { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 13px; }
.row-sub { font-size: 11.5px; color: var(--text-soft); }

/* ----- Toolbar (termíny) ----- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 15px; }
.toolbar__spacer { flex: 1; }
.search-wrap { position: relative; flex: 0 0 auto; }
.search-wrap .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ----- Karty termínů ----- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.term-card { background: var(--surface); border: 1px solid var(--border); border-radius: 13px; padding: 16px; display: flex; flex-direction: column; }
.term-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.term-card__date { font-size: 19px; font-weight: 800; color: var(--primary); line-height: 1.05; }
.term-card__when { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.term-card__meta { font-size: 12.5px; color: var(--text-soft); display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.term-card__foot { margin-top: auto; }
.cap-line { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-soft); margin-bottom: 4px; }

/* ----- Tabulkové buňky se speciálním obsahem ----- */
.cell-strong { font-weight: 700; font-size: 13.5px; }
.cell-when { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.free-num { font-size: 13px; font-weight: 700; }

/* ----- Kalendář ----- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-nav { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; color: var(--text); line-height: 1; }
.cal-title { font-size: 16px; font-weight: 800; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { text-align: center; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.cal-cell { min-height: 88px; border: 1px solid var(--border-soft); border-radius: 8px; padding: 5px; background: var(--surface); }
.cal-cell.is-empty { background: var(--surface-alt); }
.cal-cell__day { font-size: 11px; color: var(--muted); text-align: right; font-weight: 600; }
.cal-term { border-radius: 6px; padding: 3px 6px; font-size: 10px; font-weight: 700; cursor: pointer; margin-top: 3px; font-family: var(--mono); line-height: 1.3; }

/* ----- Modal detail termínu ----- */
.modal__date { font-size: 21px; font-weight: 800; line-height: 1.1; }
.modal__when { font-size: 12.5px; color: rgba(255,255,255,.7); font-family: var(--mono); margin-top: 3px; }
.modal-info { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.modal-info__label { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.modal-info__value { font-size: 13.5px; font-weight: 600; margin-top: 3px; }
.info-block { border-radius: 11px; padding: 15px; margin-bottom: 14px; }
.mod-pick { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; cursor: pointer; margin-bottom: 8px; }
.mod-pick.is-checked { border-color: var(--accent); background: var(--accent-soft); }
.mod-pick__box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border); background: transparent; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.mod-pick.is-checked .mod-pick__box { border-color: var(--accent); background: var(--accent); }
.mod-pick__code { font-weight: 700; font-family: var(--mono); font-size: 12px; color: var(--accent); }

/* ----- Login ----- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
.login-card { background: var(--surface); width: 380px; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-card); padding: 28px; box-shadow: 0 12px 40px rgba(0,0,0,.08); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.login-brand .sidebar__logo { background: var(--primary); color: #fff; }
.login-title { font-size: 18px; font-weight: 800; }
.login-field { display: block; margin-bottom: 14px; }
.login-field span { display: block; font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 5px; }
.login-field .input { width: 100%; }
.login-error { background: var(--danger-bg); color: var(--danger-fg); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: var(--r-btn); margin-bottom: 14px; }
.login-hint { font-size: 11.5px; color: var(--muted); margin-top: 16px; line-height: 1.5; }

/* =========================================================================
   Responsivita
   ========================================================================= */
@media (max-width: 1100px) { .cards-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 900px)  { .dash-grid { grid-template-columns: 1fr; } }

@media (max-width: 760px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: auto; z-index: 50;
    box-shadow: 0 0 50px rgba(0,0,0,.35); transform: translateX(-100%);
    transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(10,20,30,.5); z-index: 45; animation: fadeIn .15s ease; }
  .topbar__burger { display: flex; }
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar__sub { display: none; }
  .topbar__user-info { display: none; }
}
