/* =============================================
   TKI PLANER – STYLE GŁÓWNE
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --tki-red:    #c0392b;
  --tki-dark:   #1a1a2e;
  --tki-mid:    #16213e;
  --tki-accent: #e74c3c;
  --tki-gold:   #f39c12;
  --tki-green:  #27ae60;
  --tki-blue:   #2980b9;
  --bg:         #f0f2f5;
  --card:       #ffffff;
  --border:     #e0e4ea;
  --text:       #2c3e50;
  --text-light: #7f8c8d;
  --sidebar-w:  260px;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-md:  0 4px 24px rgba(0,0,0,.12);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

/* Wrapper Vue app — zastępuje bezpośredni flex na body */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--tki-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.logo-icon { font-size: 32px; }
.logo-title { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.logo-sub   { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .2s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: rgba(192,57,43,.18);
  color: #fff;
  border-left-color: var(--tki-accent);
}
.nav-item i { width: 18px; text-align: center; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 11px;
  color: rgba(255,255,255,.4);
  line-height: 1.7;
}

/* ---- MAIN ---- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.btn-menu {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: var(--text-light); display: none;
}
.topbar-title { font-size: 18px; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; gap: 8px; }

/* ---- VIEW CONTAINER ---- */
.view-container { padding: 28px; flex: 1; }
.view { display: none; }
.view.active { display: block; }

/* ---- DASHBOARD ---- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid transparent;
}
.stat-waiting  { border-left-color: var(--tki-gold); }
.stat-events   { border-left-color: var(--tki-blue); }
.stat-confirmed{ border-left-color: var(--tki-green); }
.stat-total    { border-left-color: var(--tki-red); }

.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.stat-waiting  .stat-icon { background: #fff8e8; color: var(--tki-gold); }
.stat-events   .stat-icon { background: #e8f4fd; color: var(--tki-blue); }
.stat-confirmed .stat-icon{ background: #eafaf1; color: var(--tki-green); }
.stat-total    .stat-icon { background: #fdecea; color: var(--tki-red); }

.stat-value { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* ---- VIEW HEADER BAR ---- */
.view-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.view-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--tki-dark);
  margin: 0;
}
.view-header-sub {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 3px;
}

/* ---- BUTTON SIZES ---- */
.btn-lg {
  padding: 11px 22px;
  font-size: 14px;
  border-radius: 10px;
}

/* ---- TOPBAR ADD BUTTON ---- */
.topbar-add-btn {
  font-size: 13px;
  padding: 8px 16px;
}

/* ---- EMPTY CTA ---- */
.empty-cta {
  text-align: center;
  padding: 60px 20px;
}
.empty-cta-icon {
  font-size: 56px;
  margin-bottom: 14px;
  line-height: 1;
}
.empty-cta h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.empty-cta p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- SECTION TITLE ---- */
.section-title {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}
.section-desc { color: var(--text-light); margin-bottom: 16px; font-size: 13px; }

/* dashboard events list */
.events-dashboard-list { display: flex; flex-direction: column; gap: 12px; }
.dash-event-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: box-shadow .2s;
  border: 1px solid var(--border);
}
.dash-event-card:hover { box-shadow: var(--shadow-md); }
.dash-event-date {
  min-width: 80px;
  text-align: center;
  background: var(--tki-dark);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
}
.dash-event-date .day  { font-size: 26px; font-weight: 700; line-height: 1; }
.dash-event-date .month{ font-size: 11px; text-transform: uppercase; opacity: .7; }
.dash-event-date .time { font-size: 12px; margin-top: 4px; opacity: .8; }
.dash-event-info       { flex: 1; }
.dash-event-name       { font-weight: 700; font-size: 15px; }
.dash-event-status     { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.dash-event-progress   { min-width: 180px; }

/* ---- TOOLBAR ---- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; margin-bottom: 18px;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px; flex: 1; max-width: 360px;
}
.search-box i { color: var(--text-light); }
.search-box input {
  border: none; outline: none; font-size: 14px; width: 100%;
  font-family: inherit; color: var(--text);
}
.filter-row { display: flex; gap: 8px; }
.filter-row select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; font-size: 13px; background: var(--card);
  color: var(--text); font-family: inherit; cursor: pointer; outline: none;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none; font-family: inherit;
  transition: filter .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--tki-accent); color: #fff; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-success   { background: var(--tki-green); color: #fff; }
.btn-warning   { background: var(--tki-gold); color: #fff; }
.btn-danger    { background: var(--tki-red); color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--tki-accent); color: var(--tki-accent); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 7px 10px; }

/* ---- TABLE ---- */
.table-wrapper {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f7f8fb; padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px; border-bottom: 1px solid #f0f2f5;
  font-size: 13px; vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- BADGES ---- */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-wait      { background: #fff3cd; color: #856404; }
.badge-provisional { background: #cce5ff; color: #004085; }
.badge-confirmed { background: #d4edda; color: #155724; }
.badge-draft     { background: #e2e3e5; color: #383d41; }
.badge-event-confirmed { background: #d1ecf1; color: #0c5460; }
.badge-final     { background: #d4edda; color: #155724; }
.badge-wymyslanka{ background: #fde8ff; color: #6a0099; }
.badge-hejter    { background: #ffe8e8; color: #990000; }

/* ---- EVENTS GRID ---- */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.event-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow .2s;
}
.event-card:hover { box-shadow: var(--shadow-md); }
.event-card-header {
  padding: 16px 20px;
  display: flex; align-items: flex-start; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.event-card-title { font-weight: 700; font-size: 15px; }
.event-card-date  { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.event-card-body  { padding: 16px 20px; }
.event-card-footer{
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* ---- PROGRESS BAR ---- */
.progress-wrap { margin: 8px 0; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-light); margin-bottom: 4px;
}
.progress-bar-outer {
  height: 10px; background: #e9ecef; border-radius: 20px; overflow: hidden;
}
.progress-bar-inner {
  height: 100%; border-radius: 20px;
  transition: width .4s, background .3s;
}
.progress-bar-inner.ok      { background: var(--tki-green); }
.progress-bar-inner.warning { background: var(--tki-gold); }
.progress-bar-inner.full    { background: var(--tki-accent); }
.progress-bar-inner.over    { background: #c0392b; }

.progress-prov {
  height: 6px; border-radius: 20px;
  background: rgba(41,128,185,.35);
  margin-top: 2px;
}

/* ---- ASSIGNED GROUPS in EVENT DETAIL ---- */
.assigned-group-item {
  background: #f7f8fb; border-radius: 8px; padding: 12px 16px;
  margin-bottom: 8px; display: flex; align-items: center; gap: 12px;
  border-left: 3px solid var(--tki-blue);
}
.assigned-group-item.confirmed { border-left-color: var(--tki-green); }
.assigned-group-info { flex: 1; font-size: 13px; }
.assigned-group-name { font-weight: 600; }
.assigned-group-meta { color: var(--text-light); font-size: 12px; }
.assigned-group-actions { display: flex; gap: 6px; }

/* ---- WAITING LIST ---- */
.waiting-list { display: flex; flex-direction: column; gap: 10px; }
.waiting-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  border-left: 3px solid var(--tki-gold);
  border: 1px solid var(--border);
}
.waiting-item.provisional { border-left-color: var(--tki-blue); }
.waiting-info { flex: 1; font-size: 13px; }
.waiting-name { font-weight: 600; }
.waiting-meta { color: var(--text-light); font-size: 12px; margin-top: 2px; }
.waiting-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---- MODAL ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius);
  width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .2s ease;
}
.modal-wide { max-width: 780px; }
@keyframes modalIn {
  from { transform: scale(.94) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-light); padding: 4px;
  border-radius: 6px; transition: background .15s;
}
.modal-close:hover { background: var(--border); }
.modal-body  { padding: 20px 24px; }
.modal-footer{ padding-top: 16px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); margin-top: 16px; }

/* ---- FORM ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.span2 { grid-column: span 2; }
.form-group label {
  font-size: 12px; font-weight: 600; color: var(--text-light);
  text-transform: uppercase; letter-spacing: .4px;
  display: flex; flex-direction: column; gap: 2px;
}
.form-hint {
  font-size: 11px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--text-light); opacity: .75;
}
.form-group input,
.form-group select,
.form-group textarea {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit;
  color: var(--text); outline: none; transition: border .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--tki-accent); box-shadow: 0 0 0 3px rgba(231,76,60,.1); }
.form-group textarea { resize: vertical; }

/* Form section headers */
.form-section-label {
  font-size: 12px; font-weight: 700; color: var(--tki-dark);
  text-transform: uppercase; letter-spacing: .6px;
  padding: 6px 0 4px;
  border-bottom: 2px solid var(--tki-accent);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.form-section-label i { color: var(--tki-accent); }

/* Show type display box */
.show-type-display {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 14px;
  background: #f7f8fb; color: var(--text-light);
  min-height: 40px; display: flex; align-items: center;
  font-style: italic;
}
.show-type-display.has-value {
  font-style: normal; font-weight: 600; color: var(--text);
  background: #fff;
}

/* ---- TIME SHORTCUTS ---- */
.time-shortcuts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.time-shortcut-label {
  font-size: 11px;
  color: var(--text-light);
  margin-right: 2px;
}

/* ---- ASSIGN MODAL ---- */
.assign-info {
  background: #f0f2f5; border-radius: 8px; padding: 10px 14px;
  font-size: 13px; margin-bottom: 14px;
}
.assign-event-list { display: flex; flex-direction: column; gap: 10px; }
.assign-event-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 18px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: border .15s, background .15s;
}
.assign-event-item:hover { background: #f7f8fb; border-color: var(--tki-accent); }
.assign-event-item.incompatible { opacity: .45; cursor: not-allowed; pointer-events: none; }
.assign-event-info { flex: 1; }

/* ---- TOAST ---- */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1a1a2e; color: #fff; padding: 13px 24px;
  border-radius: 30px; font-size: 14px; z-index: 9999;
  transition: transform .3s, opacity .3s; opacity: 0; pointer-events: none;
  max-width: 420px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--tki-green); }
.toast.error   { background: var(--tki-red); }
.toast.warning { background: var(--tki-gold); }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-light);
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; opacity: .3; }
.empty-state p  { font-size: 15px; }

/* ---- SEPARATOR ---- */
.separator { height: 1px; background: var(--border); margin: 16px 0; }

/* ---- COUNTDOWN ---- */
.countdown { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* ---- DETAIL SECTIONS ---- */
.detail-section { margin-bottom: 20px; }
.detail-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 10px; }

/* ---- CAPACITY LEGEND ---- */
.capacity-legend {
  display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text-light);
  margin-top: 6px;
}
.cap-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px;
}

/* ---- GCAL EXPORT ---- */
.gcal-box {
  background: #f0f2f5; border-radius: 10px; padding: 16px;
  font-size: 13px; line-height: 1.7;
}
.gcal-box pre {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; white-space: pre-wrap; font-size: 12px; margin-top: 8px;
  max-height: 200px; overflow-y: auto; font-family: monospace;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .btn-menu { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.span2 { grid-column: span 1; }
}
@media (max-width: 600px) {
  .view-container { padding: 16px; }
  .events-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
}

/* tag wstępne/potwierdzone w liście grup */
.tag-prov { color: var(--tki-blue); font-weight: 600; font-size: 11px; }
.tag-conf { color: var(--tki-green); font-weight: 600; font-size: 11px; }

/* separator event detail */
.event-detail-top {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.event-detail-info-box {
  background: #f7f8fb; border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 1.8;
}
.info-label { font-weight: 600; font-size: 11px; color: var(--text-light); text-transform: uppercase; }
