:root {
  --bg: #0d1321;
  --panel: #172033;
  --panel-alt: #1d2940;
  --text: #edf2f7;
  --muted: #9fb0ca;
  --border: rgba(255,255,255,0.08);
  --accent: #5aa2ff;
  --success: #29c36a;
  --danger: #f05f6f;
  --warning: #ffb454;
  --shadow: 0 18px 40px rgba(0,0,0,0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: linear-gradient(180deg, #0c1220, #111b2f 55%, #0c1220);
  color: var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

.sidebar {
  padding: 28px 22px;
  border-right: 1px solid var(--border);
  background: rgba(10, 16, 29, 0.92);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.brand { font-size: 1.7rem; font-weight: 800; }
.brand-sub { color: var(--muted); margin-top: 4px; }
.nav { display: grid; gap: 10px; margin: 28px 0; }
.nav a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.nav a:hover { background: rgba(90,162,255,0.15); }
.user-box {
  padding: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: grid;
  gap: 8px;
}
.user-box span { color: var(--muted); text-transform: capitalize; }
.main { padding: 24px 28px 28px; }
.auth-main {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
}
.auth-card, .panel, .stat-card {
  background: rgba(23, 32, 51, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.auth-card {
  width: min(480px, 92vw);
  padding: 32px;
  border-radius: 24px;
}
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 18px;
}
.notif-dropdown { position: relative; }
.notif-dropdown summary {
  list-style: none;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
}
.notif-dropdown summary::-webkit-details-marker { display: none; }
.notif-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(420px, 90vw);
  z-index: 10;
}
.notif-menu-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.notif-menu-list { display: grid; gap: 10px; }
.notif-item { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.03); }
.notif-item span, .notif-item small { color: var(--muted); }
.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.page-header h1 { margin: 0 0 6px; font-size: 2rem; }
.page-header p { margin: 0; color: var(--muted); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card {
  border-radius: 22px;
  padding: 18px 20px;
}
.stat-card span { display: block; color: var(--muted); margin-bottom: 10px; }
.stat-card strong { font-size: 1.8rem; }
.stat-card.warning { border-color: rgba(255,180,84,0.4); }
.stat-card.danger { border-color: rgba(240,95,111,0.4); }
.panel-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.panel-grid.two-thirds { grid-template-columns: 2fr 1fr; }
.panel {
  border-radius: 22px;
  padding: 22px;
  margin-bottom: 24px;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.panel h2, .panel h3 { margin-top: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 13px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(90,162,255,0.16);
  color: #d8e8ff;
  font-size: 0.86rem;
}
.pill.danger { background: rgba(240,95,111,0.18); color: #ffd9df; }
.pill.warning { background: rgba(255,180,84,0.18); color: #ffe6bd; }
.pill.success { background: rgba(41,195,106,0.16); color: #d7ffe8; }
.tag-pill { margin: 0 6px 6px 0; }
.tag-group { display: flex; gap: 6px; flex-wrap: wrap; }
.timeline { display: grid; gap: 14px; }
.timeline-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
}
.timeline-item p { margin: 8px 0; color: #d8dfed; }
.timeline-item small { color: var(--muted); }
.stack { display: grid; gap: 14px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full { grid-column: 1 / -1; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 600; }
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  color: var(--text);
}
textarea { resize: vertical; }
.btn {
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: white;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text);
}
.btn-danger { background: var(--danger); }
.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.flash.success { background: rgba(41,195,106,0.14); }
.flash.error { background: rgba(240,95,111,0.14); }
.filters {
  display: grid;
  gap: 12px;
}
.filters.advanced { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.description { white-space: pre-wrap; line-height: 1.6; color: #d8dfed; }
.actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.inline-actions { align-self: end; }
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.checkbox-inline input { width: auto; }
.archive-form { margin-top: 16px; }
.nav-badge { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:999px; background: var(--accent); color:white; font-size:0.75rem; }
.notification-unread { border-color: rgba(90,162,255,0.45); background: rgba(90,162,255,0.08); }
.top-gap { margin-top: 12px; }
.table-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.split-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.empty-state { color: var(--muted); margin: 0; }
.calendar-list { display: grid; gap: 18px; }
.calendar-day h2 { margin: 0 0 12px; font-size: 1.1rem; }
small { color: var(--muted); }

@media (max-width: 1180px) {
  .filters.advanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .panel-grid, .panel-grid.two-thirds, .two-col, .filters.advanced { grid-template-columns: 1fr; }
}

.separator { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  padding: 2rem 1rem;
  background: rgba(10, 17, 40, 0.9);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
  color: #fff;
}

.brand p {
  margin: 0.35rem 0 0;
  color: #a9b6d3;
  font-size: 1rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-link {
  display: block;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user {
  margin-top: auto;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.main {
  min-width: 0;
  padding: 2rem;
}

.auth-main {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}

.top-gap {
  margin-top: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.brand-logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

.brand-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
}

.brand-sub {
  text-align: center;
  margin-bottom: 1.25rem;
}


.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.kpi-card {
  background: linear-gradient(180deg, rgba(23, 32, 51, 0.96), rgba(20, 28, 46, 0.96));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.kpi-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}
.kpi-card strong {
  display: block;
  font-size: 1.95rem;
  margin-bottom: 6px;
}
.kpi-card small {
  color: var(--muted);
}
.kpi-card.active { border-color: rgba(90,162,255,0.35); }
.kpi-card.success { border-color: rgba(41,195,106,0.32); }
.kpi-card.warning { border-color: rgba(255,180,84,0.36); }
.kpi-card.danger { border-color: rgba(240,95,111,0.36); }
.muted-text { color: var(--muted); }


.btn-small {
  padding: 9px 12px;
  font-size: 0.86rem;
}

.muted {
  color: var(--muted);
}

.filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 18px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}

.board-column {
  background: rgba(23, 32, 51, 0.55);
  border: 1px solid var(--border);
  border-radius: 24px;
  min-height: 540px;
  display: flex;
  flex-direction: column;
}

.board-column-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 10px;
  border-bottom: 1px solid var(--border);
}

.board-column-head h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.board-column-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.board-dropzone {
  flex: 1;
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 420px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.board-dropzone.drag-over {
  background: rgba(90, 162, 255, 0.08);
}

.board-empty {
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 18px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  background: rgba(255,255,255,0.025);
}

.kanban-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.16);
  cursor: grab;
}

.kanban-card.dragging {
  opacity: 0.55;
}

.kanban-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.kanban-card-text {
  color: #d8dfed;
  line-height: 1.5;
  white-space: pre-wrap;
  margin: 12px 0;
}

.kanban-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

@media (max-width: 1680px) {
  .board-grid {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
  }
}

@media (max-width: 1180px) {
  .board-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
}

@media (max-width: 760px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
}


.public-page-body {
  display: block;
  min-height: 100vh;
  background: linear-gradient(180deg, #0c1220, #111b2f 55%, #0c1220);
}
.public-page-wrap {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}
.public-page-wide {
  align-items: stretch;
}
.public-card {
  width: min(1100px, 100%);
  background: rgba(23, 32, 51, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 28px;
}
.public-card-narrow {
  width: min(640px, 100%);
}
.two-up-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
  margin-bottom: 24px;
}
.attachment-link {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
}
.timeline-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.public-info-banner {
  margin-bottom: 24px;
}
@media (max-width: 980px) {
  .two-up-grid {
    grid-template-columns: 1fr;
  }
}
