/* =========================
   DESIGN TOKENS
========================= */
:root {
  --bg-app: #f4f6f8;
  --bg-panel: #ffffff;
  --bg-sidebar: #0f1115;
  --bg-sidebar-2: #171a21;
  --border: #e4e7eb;

  --text-main: #1f2933;
  --text-muted: #6b7280;

  --green: #2e7d32;
  --orange: #ef6c00;
  --blue: #1565c0;
  --danger: #d32f2f;
}

/* =========================
   BASE
========================= */
html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg-app);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

/* =========================
   LAYOUT
========================= */
.layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* =========================
   SIDEBAR
========================= */
aside {
  width: 220px;
  background: linear-gradient(180deg, var(--bg-sidebar), var(--bg-sidebar-2));
  color: #e5e7eb;
  padding: 20px 18px;
  box-shadow: 2px 0 14px rgba(0,0,0,.25);
  overflow-y: auto;
}

aside h1,
aside h2,
aside h3 {
  margin-top: 0;
  color: #fff;
  font-weight: 600;
}

aside button {
  width: 100%;
  margin-bottom: 8px;
}

aside a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
}

aside a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

/* =========================
   MAIN
========================= */
main {
  flex: 1;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================
   FILTERS
========================= */
.filters {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  z-index: 2;
}

/* =========================
   TASK LIST
========================= */
#list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================
   TASK ROW
========================= */
.row {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .15s ease;
}

.row:hover {
  background: #f9fafb;
}

.row small {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

/* =========================
   STATUS
========================= */
.status {
  font-size: 12px;
  font-weight: 600;
}

.status.OPEN { color: var(--green); }
.status.IN_PROGRESS { color: var(--orange); }
.status.DONE { color: var(--blue); }

/* =========================
   ROW DETAILS
========================= */
.row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #f3f4f6;
  border-radius: 8px;
  flex-shrink: 0;
}

/* =========================
   OVERLAY
========================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,.35);
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 9;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* =========================
   DRAWER
========================= */
.drawer {
  position: fixed;
  top: 0;
  left: 220px;
  right: 0;
  height: 100%;
  background: var(--bg-panel);
  z-index: 10;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
  border-left: 1px solid var(--border);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  font-size: 15px;
  font-weight: 600;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* =========================
   FORMS
========================= */
input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 14px;
}

textarea {
  min-height: 280px;
}

/* =========================
   BUTTONS
========================= */
button {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f9fafb;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #f3f4f6;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions .danger {
  background: var(--danger);
  color: #fff;
  border: none;
}

/* =========================
   MOBILE
========================= */
.menu-btn {
  display: none;
}

/* =========================
   MOBILE OPTIMIZATION
========================= */
@media (max-width: 768px) {

  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
  }

  .layout {
    flex-direction: column;
    height: auto;
  }

  main {
    padding-top: 64px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* SIDEBAR */
  aside {
    position: fixed;
    inset: 0 auto 0 0;
    width: 85%;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 30;
  }

  aside.open {
    transform: translateX(0);
  }

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  right: 12px;
  z-index: 40;
  font-size: 22px;
  background: #111827;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
}

  /* TASK CARD */
  .row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 10px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
  }

  /* DRAWER MOBILE */
  .drawer {
    left: 0;
    width: 100%;
    transform: translateY(100%);
    border-left: none;
  }

  .drawer.open {
    transform: translateY(0);
  }

  .drawer-actions button {
    width: 100%;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  /* NO HORIZONTAL SCROLL */
  .drawer-body img,
  .drawer-body table,
  .drawer-body * {
    max-width: 100%;
    box-sizing: border-box;
  }

  .drawer-body pre,
  .drawer-body code {
    white-space: pre-wrap;
    word-break: break-word;
  }
}
/* ===== PRIORITY COLORS ===== */
.priority.HIGH {
  color: #d32f2f;      /* czerwony */
  font-weight: 600;
}

.priority.CRITICAL {
  color: #b71c1c;      /* ciemny czerwony */
  font-weight: 700;
  text-transform: uppercase;
}
