:root {
  --tk-navy: #001a33;
  --tk-navy-deep: #000d1a;
  --tk-navy-soft: #0a2744;
  --tk-cyan: #00d2ff;
  --tk-cyan-dark: #00a8cc;
  --tk-cyan-soft: #e6f9ff;
  --tk-blue: #1a6fb5;
  --tk-bg: #f4f7fb;
  --tk-surface: #ffffff;
  --tk-border: #d9e2ec;
  --tk-text: #12263a;
  --tk-muted: #5b6b7c;
  --tk-sidebar-width: 260px;
  --tk-header-height: 64px;
  --tk-radius: 12px;
  --tk-shadow: 0 8px 24px rgba(0, 26, 51, 0.08);
  --tk-font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--tk-font);
  color: var(--tk-text);
  background: var(--tk-bg);
  min-height: 100vh;
}

a { color: var(--tk-blue); text-decoration: none; }
a:hover { color: var(--tk-cyan-dark); }

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(0, 210, 255, 0.18), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(26, 111, 181, 0.22), transparent 45%),
    linear-gradient(160deg, #001a33 0%, #0a2744 45%, #001528 100%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--tk-surface);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 2rem;
}

.auth-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0 auto 1.5rem;
}

.auth-title {
  font-weight: 700;
  color: var(--tk-navy);
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--tk-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.btn-taskino {
  background: linear-gradient(135deg, var(--tk-cyan) 0%, var(--tk-blue) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-taskino:hover,
.btn-taskino:focus {
  background: linear-gradient(135deg, var(--tk-cyan-dark) 0%, #155a94 100%);
  color: #fff;
}

.btn-outline-taskino {
  border: 1px solid var(--tk-cyan-dark);
  color: var(--tk-navy);
  background: transparent;
}

.btn-outline-taskino:hover {
  background: var(--tk-cyan-soft);
  color: var(--tk-navy);
}

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

.sidebar {
  width: var(--tk-sidebar-width);
  background: linear-gradient(180deg, var(--tk-navy) 0%, var(--tk-navy-deep) 100%);
  color: #fff;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease;
}

.sidebar-brand {
  height: var(--tk-header-height);
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  width: 100%;
}

.sidebar-brand img {
  max-height: 40px;
  width: auto;
  max-width: 100%;
  filter: none;
}

.sidebar-nav {
  overflow-y: auto;
  padding: 1rem 0.75rem 2rem;
  flex: 1;
}

.sidebar-section {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  padding: .75rem .75rem .35rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: rgba(255,255,255,.82);
  padding: .55rem .75rem;
  border-radius: 8px;
  margin-bottom: .15rem;
  font-size: .92rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(0, 210, 255, 0.16);
  color: #fff;
}

.sidebar-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }

.app-main {
  margin-left: var(--tk-sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  height: var(--tk-header-height);
  background: var(--tk-surface);
  border-bottom: 1px solid var(--tk-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-content {
  padding: 1.25rem;
  flex: 1;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--tk-navy);
  margin: 0;
}

.page-subtitle {
  color: var(--tk-muted);
  margin: .15rem 0 0;
}

.stat-card {
  background: var(--tk-surface);
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--tk-shadow);
  height: 100%;
}

.stat-card .stat-label {
  color: var(--tk-muted);
  font-size: .85rem;
  margin-bottom: .35rem;
}

.stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--tk-navy);
  line-height: 1.1;
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--tk-cyan-soft);
  color: var(--tk-cyan-dark);
  font-size: 1.2rem;
}

.panel {
  background: var(--tk-surface);
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius);
  box-shadow: var(--tk-shadow);
}

.panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--tk-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-body { padding: 1.25rem; }

.badge-priority-low { background: #6c757d; }
.badge-priority-normal { background: var(--tk-blue); }
.badge-priority-high { background: #f0ad4e; color: #212529; }
.badge-priority-urgent { background: #dc3545; }

.progress-thin { height: 6px; border-radius: 99px; }

.table-taskino thead th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tk-muted);
  border-bottom-width: 1px;
  white-space: nowrap;
}

.table-taskino tbody td {
  vertical-align: middle;
  font-size: .92rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--tk-muted);
}

.empty-state i {
  font-size: 2.5rem;
  color: var(--tk-cyan);
  display: block;
  margin-bottom: .75rem;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--tk-cyan-soft);
  color: var(--tk-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}

.avatar-lg { width: 64px; height: 64px; font-size: 1.2rem; }

.kanban-board {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  min-height: 60vh;
}

.kanban-column {
  min-width: 280px;
  max-width: 320px;
  background: #eef3f8;
  border-radius: var(--tk-radius);
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: .85rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--tk-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-column-body {
  padding: .75rem;
  flex: 1;
  min-height: 120px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--tk-border);
  border-radius: 10px;
  padding: .85rem;
  margin-bottom: .65rem;
  cursor: grab;
  box-shadow: 0 2px 8px rgba(0,26,51,.04);
}

.kanban-card:active { cursor: grabbing; }
.kanban-card .code { font-size: .75rem; color: var(--tk-muted); }
.kanban-card .title { font-weight: 600; color: var(--tk-navy); margin: .25rem 0 .5rem; }

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  padding-bottom: 1.25rem;
  border-left: 2px solid var(--tk-border);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tk-cyan);
}

.notification-item.unread {
  background: var(--tk-cyan-soft);
}

.toast-container { z-index: 1090; }

.multi-picker-box {
  max-height: 220px;
  overflow-y: auto;
  background: var(--tk-surface);
  border-color: var(--tk-border) !important;
}

.multi-picker-item:hover {
  background: var(--tk-cyan-soft);
}

.multi-picker-item.is-hidden {
  display: none !important;
}

.multi-picker-owner .form-check-input:disabled {
  opacity: 0.35;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1035;
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .app-main { margin-left: 0; }
}

/* Help assistant mascot — bottom-right, peeks in and out */
@keyframes tk-help-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes tk-help-pop {
  0% { opacity: 0; transform: translateX(1.5rem) scale(0.92); }
  70% { transform: translateX(-4px) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes tk-help-ring {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.35); opacity: 0; }
}

.tk-help {
  position: fixed !important;
  left: auto !important;
  right: 1.25rem !important;
  bottom: 1.25rem !important;
  top: auto !important;
  z-index: 2000 !important;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
  width: auto;
  max-width: calc(100vw - 1.5rem);
  pointer-events: none;
  font-family: var(--tk-font);
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.45s ease;
}

.tk-help.is-away:not(.is-open):not(.is-dismissed) {
  transform: translateX(calc(100% - 3rem));
  opacity: 0.88;
}

.tk-help.is-away:not(.is-open):not(.is-dismissed):hover,
.tk-help.is-away:not(.is-open):not(.is-dismissed):focus-within {
  transform: translateX(0);
  opacity: 1;
}

.tk-help.is-pop-in .tk-help-launcher-wrap {
  animation: tk-help-pop 0.55s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.tk-help.is-dismissed .tk-help-launcher-wrap,
.tk-help.is-dismissed .tk-help-panel {
  display: none !important;
}

.tk-help.is-dismissed .tk-help-restore {
  display: flex;
  pointer-events: auto;
}

.tk-help > * {
  pointer-events: auto;
}

.tk-help-launcher-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.4rem 0.45rem 0.4rem 0.85rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(230, 249, 255, 0.98) 100%);
  border-radius: 999px;
  box-shadow:
    0 14px 36px rgba(0, 26, 51, 0.14),
    0 0 0 1px rgba(0, 210, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.tk-help-dismiss {
  position: absolute;
  top: -7px;
  right: -5px;
  z-index: 3;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--tk-muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 26, 51, 0.18);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.tk-help-launcher-wrap:hover .tk-help-dismiss,
.tk-help.is-open .tk-help-dismiss,
.tk-help.is-away .tk-help-dismiss {
  opacity: 1;
  transform: scale(1);
}

.tk-help-dismiss:hover {
  color: #fff;
  background: #e74c3c;
  transform: scale(1.08);
}

.tk-help-launcher {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: right;
}

.tk-help-mascot-ring {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.tk-help-mascot-ring::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--tk-cyan);
  opacity: 0;
  animation: tk-help-ring 2.4s ease-out infinite;
}

.tk-help.is-away:not(.is-open) .tk-help-mascot-ring::before {
  animation: none;
}

.tk-help-mascot,
.tk-help-mascot-sm {
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 26, 51, 0.28);
  object-fit: cover;
  flex-shrink: 0;
}

.tk-help-mascot {
  width: 76px;
  height: 76px;
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
  border: 3px solid #fff;
  animation: tk-help-bob 3.2s ease-in-out infinite;
}

.tk-help-launcher:hover .tk-help-mascot,
.tk-help.is-open .tk-help-mascot {
  animation: none;
  transform: translateY(-4px) scale(1.05);
}

.tk-help-bubble {
  max-width: 190px;
  background: linear-gradient(135deg, var(--tk-navy) 0%, #0a3a66 100%);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 8px 20px rgba(0, 26, 51, 0.2);
  position: relative;
}

.tk-help-bubble::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: #0a3a66;
  transform: rotate(45deg);
  border-radius: 1px;
}

.tk-help.is-open .tk-help-bubble {
  display: none;
}

.tk-help-restore {
  display: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--tk-cyan) 0%, var(--tk-blue) 100%);
  box-shadow: 0 10px 24px rgba(0, 26, 51, 0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tk-help-restore:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 14px 28px rgba(0, 26, 51, 0.28);
}

.tk-help-restore-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.tk-help-panel {
  width: min(360px, calc(100vw - 1.5rem));
  height: min(520px, calc(100vh - 7rem));
  background: #fff;
  border: 1px solid var(--tk-border);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 26, 51, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tk-help-panel[hidden] {
  display: none !important;
}

.tk-help-header {
  background: linear-gradient(135deg, var(--tk-navy) 0%, #0a3a66 100%);
  color: #fff;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tk-help-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  background: #f7fafc;
}

.tk-help-msg {
  max-width: 92%;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.tk-help-msg.bot {
  background: #fff;
  border: 1px solid var(--tk-border);
  color: var(--tk-text);
}

.tk-help-msg.user {
  margin-left: auto;
  background: var(--tk-navy);
  color: #fff;
}

.tk-help-msg strong {
  font-weight: 700;
}

.tk-help-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--tk-border);
  background: #fff;
  max-height: 110px;
  overflow-y: auto;
}

.tk-help-chip {
  border: 1px solid var(--tk-border);
  background: var(--tk-cyan-soft);
  color: var(--tk-navy);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.tk-help-chip:hover {
  border-color: var(--tk-cyan);
}

.tk-help-form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid var(--tk-border);
  background: #fff;
}

.form-label {
  font-weight: 600;
  color: var(--tk-navy);
  font-size: .86rem;
}

.form-control,
.form-select {
  border-color: var(--tk-border);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--tk-cyan);
  box-shadow: 0 0 0 .2rem rgba(0, 210, 255, .18);
}

.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.form-section {
  background: var(--tk-surface);
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius);
  box-shadow: var(--tk-shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.form-section-header {
  padding: 1rem 1.2rem .85rem;
  border-bottom: 1px solid var(--tk-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  background: linear-gradient(180deg, #fbfcfe 0%, #fff 100%);
}

.form-section-header h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tk-navy);
  margin: 0;
}

.form-section-header p {
  margin: .2rem 0 0;
  color: var(--tk-muted);
  font-size: .82rem;
}

.form-section-body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: .65rem;
  padding: .9rem 0 0;
  margin-top: .5rem;
  background: linear-gradient(180deg, transparent, var(--tk-bg) 28%);
  z-index: 5;
}

.task-form .multi-picker-box {
  max-height: 168px;
}

.subtask-composer-list {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.subtask-row {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .75rem;
  border: 1px dashed var(--tk-border);
  border-radius: 10px;
  background: #f8fbfd;
}

.subtask-row-index {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--tk-cyan-soft);
  color: var(--tk-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.4rem;
  flex-shrink: 0;
}

.subtask-row-fields { flex: 1; min-width: 0; }

.subtask-row-remove {
  margin-top: 1.35rem;
  flex-shrink: 0;
}

.notification-dropdown {
  min-width: 360px;
  max-width: min(420px, 92vw);
  overflow: hidden;
  border: 1px solid var(--tk-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 26, 51, .14);
}

.notification-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--tk-border);
  font-weight: 700;
  font-size: .9rem;
  color: var(--tk-navy);
}

.notification-dropdown-list {
  max-height: 380px;
  overflow-y: auto;
}

.notification-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--tk-muted);
  font-size: .88rem;
}

.notification-drop-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--tk-border);
  color: var(--tk-text);
  text-decoration: none;
}

.notification-drop-item:hover {
  background: #f7fafc;
  color: var(--tk-navy);
}

.notification-drop-item.is-unread {
  background: var(--tk-cyan-soft);
}

.notification-drop-title {
  font-weight: 600;
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.notification-drop-body,
.notification-drop-time {
  font-size: .78rem;
  color: var(--tk-muted);
}

.notification-drop-body {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-dropdown-foot {
  display: block;
  text-align: center;
  padding: .7rem 1rem;
  border-top: 1px solid var(--tk-border);
  font-size: .85rem;
  font-weight: 600;
}

.notification-row {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--tk-border);
  color: inherit;
  text-decoration: none;
}

.notification-row:hover {
  background: #f7fafc;
  color: inherit;
}

.notification-row.is-unread {
  background: var(--tk-cyan-soft);
}

.notification-row-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  margin-top: .45rem;
  flex-shrink: 0;
}

.notification-row.is-unread .notification-row-dot {
  background: var(--tk-cyan-dark);
}

.notification-row-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  flex: 1;
  min-width: 0;
}

.notification-row-title {
  font-weight: 700;
  color: var(--tk-navy);
  overflow-wrap: anywhere;
}

.notification-row-text,
.notification-row-meta {
  font-size: .85rem;
  color: var(--tk-muted);
}

.subtask-card {
  border: 1px solid var(--tk-border);
  border-radius: 10px;
  padding: .85rem;
  margin-bottom: .7rem;
  background: #fff;
}

.subtask-card.is-done {
  background: #f7fafc;
}

@media (max-width: 575.98px) {
  .tk-help-bubble { display: none; }
  .tk-help { right: 0.85rem !important; bottom: 0.85rem !important; }
  .tk-help-launcher-wrap { padding: 0.25rem; border-radius: 50%; }
  .tk-help-dismiss { top: -4px; right: -4px; opacity: 1; transform: scale(1); }
  .notification-dropdown { min-width: 280px; }
  .subtask-row { flex-wrap: wrap; }
  .subtask-row-remove { margin-top: 0; }
  .subtask-row-index { margin-top: 0; }
}
