:root {
  --color-primary: #127bcb;
  --color-primary-hover: #0e6aad;
  --color-primary-soft: #eff6ff;
  --color-primary-xs: #dbeafe;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-border: #e2e8f0;
  --color-text: #1a1a2a;
  --color-text-secondary: #4a5568;
  --color-text-muted: #718096;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --radius-sm: 6px;
  --radius-md: 8px;
  --sidebar-width: 220px;
  --sidebar-collapsed-width: 76px;
  --navbar-height: 76px;
}

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

html {
  scroll-behavior: smooth;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
.logo,
.page-title,
.stat-number,
.overpass {
  font-family: "Overpass", sans-serif;
}

.mono-text,
.task-id-chip,
.code-value,
.id-text {
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
  color: var(--color-text-secondary);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(18, 123, 203, 0.15);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #edf2f7;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.page-shell {
  min-height: 100vh;
  padding: 32px;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar-root {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 50;
}

.sidebar-panel {
  display: flex;
  height: 100vh;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 24px 16px;
}

.main-shell {
  width: 100%;
  margin-left: var(--sidebar-width);
}

.app-shell.sidebar-collapsed .sidebar-root,
.app-shell.sidebar-collapsed .sidebar-panel {
  width: var(--sidebar-collapsed-width);
}

.app-shell.sidebar-collapsed .main-shell {
  margin-left: var(--sidebar-collapsed-width);
}

.app-shell.sidebar-collapsed .sidebar-copy,
.app-shell.sidebar-collapsed .sidebar-group-label,
.app-shell.sidebar-collapsed .nav-link-text,
.app-shell.sidebar-collapsed .sidebar-user-copy,
.app-shell.sidebar-collapsed .sidebar-profile-link span:last-child {
  display: none;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo {
  width: auto;
  height: 40px;
  object-fit: contain;
}

.brand-copy {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-muted);
}

.sidebar-toggle {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

.sidebar-toggle:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.sidebar-section {
  margin-top: 24px;
}

.sidebar-group-label {
  margin: 0 0 8px;
  padding: 0 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav-link {
  display: block;
  border-radius: 4px;
  padding: 8px 16px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
}

.nav-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-link-active {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-profile-link {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 13px;
}

.sidebar-profile-link:hover {
  text-decoration: underline;
}

.navbar-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--navbar-height);
  border-bottom: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(6px);
}

.navbar-shell > div {
  padding: 18px 32px;
}

.page-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
}

.navbar-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.navbar-kicker {
  font-size: 12px;
  color: var(--color-text-muted);
}

.icon-shell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.icon-shell:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.card-surface,
.stat-card,
.glass-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.card-surface:hover,
.task-card:hover,
.stat-card:hover {
  border-color: var(--color-primary);
}

.stat-card {
  padding: 16px;
}

.stat-number {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-primary);
}

.section-label,
.section-heading-sm {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-primary,
.btn-success {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary:hover,
.btn-success:hover {
  background: var(--color-primary-hover);
}

.btn-secondary,
.btn-ghost {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn-ghost:hover {
  background: var(--color-primary-soft);
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.input-shell,
.select-shell,
.textarea-shell {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
}

.input-shell,
.select-shell {
  height: 36px;
  padding: 0 12px;
}

.textarea-shell {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

.task-description-textarea {
  min-height: 180px;
}

label > span {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.helper-text {
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.status-badge,
.role-badge,
.tag-chip,
.label-chip,
.task-label-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.mobile-card-table {
  width: 100%;
  border-collapse: collapse;
}

.mobile-card-table thead th {
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.mobile-card-table tbody tr:nth-child(even) {
  background: var(--color-surface-alt);
}

.mobile-card-table tbody tr:hover {
  background: var(--color-primary-soft);
}

.mobile-card-table tbody td {
  min-height: 44px;
  padding: 12px 14px;
  border-top: 1px solid var(--color-border);
  vertical-align: top;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(250px, 1fr));
  gap: 16px;
  overflow-x: auto;
}

.board-column {
  min-width: 250px;
}

.column-dropzone {
  min-height: 320px;
}

.column-highlight {
  border-radius: var(--radius-md);
  background: var(--color-primary-soft);
}

.task-card {
  display: block;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  min-height: 60px;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
}

.task-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.task-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.priority-dot {
  display: inline-flex;
  height: 8px;
  width: 8px;
  border-radius: 999px;
}

.priority-dot-high {
  background: var(--color-danger);
}

.priority-dot-medium {
  background: var(--color-warning);
}

.priority-dot-low {
  background: var(--color-success);
}

.task-due-overdue {
  border-left: 3px solid var(--color-danger);
}

.task-due-today {
  border-left: 3px solid var(--color-warning);
}

.task-due-soon {
  border-left: 3px solid #eab308;
}

.task-source-recurring {
  border-left-style: dashed;
}

.empty-drop-zone {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.quick-add-input {
  width: 100%;
  height: 36px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: 0 12px;
}

.quick-add-input:focus {
  border-style: solid;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 24px;
}

.detail-stack {
  display: grid;
  gap: 20px;
}

.detail-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--color-surface);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: start;
}

.detail-row-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.checklist-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e9eef5;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--color-primary);
}

.chat-thread {
  display: grid;
  gap: 12px;
}

.chat-row {
  display: flex;
}

.chat-row-own {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: 90%;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 12px;
}

.chat-bubble-own {
  background: var(--color-primary-soft);
}

.chat-bubble-other {
  background: var(--color-surface-alt);
}

.activity-timeline-marker {
  height: 8px;
  width: 8px;
  border-radius: 999px;
  background: var(--color-primary);
}

.avatar-circle,
.avatar-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-weight: 600;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.avatar-image {
  object-fit: cover;
}

.tab-button {
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  padding: 0 14px;
}

.tab-button-active {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.metric-progress {
  height: 8px;
  border-radius: 999px;
  background: #e9eef5;
  overflow: hidden;
}

.metric-progress-fill {
  height: 100%;
  background: var(--color-primary);
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.calendar-cell {
  min-height: 118px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 12px;
  cursor: pointer;
}

.calendar-cell-muted {
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
}

.calendar-cell-today {
  border-color: var(--color-primary);
}

.calendar-cell-nonworking {
  background: #f1f5f9;
}

.calendar-dot {
  display: inline-block;
  height: 8px;
  width: 8px;
  border-radius: 999px;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.slide-panel {
  position: fixed;
  top: 0;
  right: -420px;
  z-index: 80;
  width: min(100%, 400px);
  height: 100vh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  transition: right 150ms ease;
}

.slide-panel-open {
  right: 0;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.heatmap-cell {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  min-height: 34px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
}

.modal-overlay[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  width: min(100%, 720px);
  max-height: min(90vh, 900px);
  overflow-y: auto;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 24px;
  transform: translateY(8px);
  opacity: 0;
}

.modal-overlay[data-open="true"] .modal-panel {
  transform: translateY(0);
  opacity: 1;
}

.modal-close-btn {
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--color-primary);
}

#toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 120;
  display: grid;
  gap: 8px;
  width: min(92vw, 340px);
}

.toast-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateX(12px);
  opacity: 0;
}

.toast-enter {
  transform: translateX(0);
  opacity: 1;
}

.toast-exit {
  transform: translateX(12px);
  opacity: 0;
}

.toast-success {
  color: #166534;
}

.toast-warning {
  color: #92400e;
}

.toast-error {
  color: #991b1b;
}

.toast-info {
  color: var(--color-primary);
}

.toast-title {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toast-message {
  margin: 0;
  font-size: 13px;
}

.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, 90vw);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

.notification-item {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  border-top: 1px solid var(--color-border);
}

.notification-item:first-child {
  border-top: 0;
}

.notification-item-unread {
  background: var(--color-primary-soft);
}

.skeleton {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(
    -45deg,
    #f8fafc,
    #f8fafc 10px,
    #f1f5f9 10px,
    #f1f5f9 20px
  );
}

.login-split {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 40% 60%;
}

.login-left {
  position: relative;
  background: var(--color-primary);
  color: #ffffff;
  overflow: hidden;
}

.login-left::before,
.login-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.45;
}

.login-right {
  background: var(--color-bg);
}

.login-card {
  width: min(100%, 440px);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
}

.documents-content {
  white-space: pre-wrap;
  line-height: 1.6;
}

.shortcut-table,
.custom-fields-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcut-table th,
.shortcut-table td,
.custom-fields-table th,
.custom-fields-table td {
  border-top: 1px solid var(--color-border);
  padding: 10px 12px;
  text-align: left;
}

.shortcut-table thead th,
.custom-fields-table thead th {
  border-top: 0;
  background: var(--color-surface-alt);
  color: var(--color-text-muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-backlog {
  background: #f1f5f9;
  color: #64748b;
}

.status-todo {
  background: #eff6ff;
  color: #2563eb;
}

.status-progress {
  background: #fffbeb;
  color: #92400e;
}

.status-review {
  background: #f5f3ff;
  color: #6d28d9;
}

.status-pending-approval {
  background: #fefce8;
  color: #713f12;
}

.status-completed,
.status-approved {
  background: #f0fdf4;
  color: #166534;
}

.status-pending {
  background: #fffbeb;
  color: #92400e;
}

.status-rejected,
.status-late {
  background: #fef2f2;
  color: #991b1b;
}

.status-new {
  background: #eff6ff;
  color: #2563eb;
}

.list-view-table th[data-sortable="true"] {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .task-detail-grid {
    grid-template-columns: 1fr;
  }

  .board-grid {
    grid-template-columns: repeat(6, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-shell,
  .navbar-shell > div {
    padding: 16px;
  }

  .app-shell.sidebar-collapsed .main-shell,
  .main-shell {
    margin-left: 76px;
  }

  .sidebar-root,
  .sidebar-panel {
    width: 76px;
  }

  .sidebar-copy,
  .sidebar-group-label,
  .nav-link-text,
  .sidebar-user-copy,
  .sidebar-profile-link span:last-child {
    display: none;
  }

  .login-split {
    grid-template-columns: 1fr;
  }

  .login-left {
    min-height: 220px;
  }

  .calendar-month-grid,
  .calendar-week-grid {
    min-width: 860px;
  }

  .mobile-card-table thead {
    display: none;
  }

  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td {
    display: block;
    width: 100%;
  }

  .mobile-card-table tr {
    border-top: 1px solid var(--color-border);
    padding: 10px 0;
  }

  .mobile-card-table tr:first-child {
    border-top: 0;
  }

  .mobile-card-table td {
    border-top: 0;
    padding: 6px 12px;
  }

  .mobile-card-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}
