:root {
  --app-bg: #f2f4fb;
  --card-bg: #ffffff;
  --card-border: rgba(203, 213, 225, 0.65);
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --warning: #f97316;
  --warning-dark: #ea580c;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --divider: rgba(226, 232, 240, 0.8);
  --shadow-soft: 0 20px 50px -30px rgba(15, 23, 42, 0.35);
  --shadow-strong: 0 28px 60px -30px rgba(79, 70, 229, 0.35);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body.app-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  color: var(--text-main);
}

.hidden {
  display: none !important;
}

header.app-header {
  width: 100%;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  box-shadow: 0 18px 30px -25px rgba(15, 23, 42, 0.35);
}

.app-header__content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem clamp(1.25rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.app-heading {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.app-heading h1 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  font-weight: 600;
}

.app-heading p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.push-status {
  max-width: 1100px;
  margin: 0.5rem auto 0;
  padding: 0.85rem 1.25rem;
  border-radius: 0.85rem;
  font-size: 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border: 1px solid transparent;
  line-height: 1.35;
}

.push-status__body {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.push-status__message {
  flex: 1;
  min-width: 200px;
}

.push-status__detail {
  display: block;
  margin-top: 0.3rem;
  font-weight: 500;
  color: rgba(17, 24, 39, 0.72);
}

.push-status__action {
  flex-shrink: 0;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(255, 255, 255, 0.65);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.push-status__action[aria-busy="true"] {
  opacity: 0.65;
  pointer-events: none;
}

.push-status__action:hover,
.push-status__action:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  outline: none;
}

.push-status svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.push-status--info {
  background: #eef2ff;
  border-color: rgba(79, 70, 229, 0.35);
  color: var(--primary-dark);
}

.push-status--ok {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.35);
  color: #166534;
}

.push-status--warn {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

.push-status--error {
  background: #fee2e2;
  border-color: rgba(220, 38, 38, 0.35);
  color: #991b1b;
}

.badge-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-dark);
  border: 1px solid rgba(79, 70, 229, 0.15);
  font-weight: 600;
  white-space: nowrap;
}

.button-outline {
  border: 1px solid rgba(79, 70, 229, 0.25);
  background: transparent;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.button-outline:hover,
.button-outline:focus-visible {
  background: rgba(79, 70, 229, 0.1);
  outline: none;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: none;
  padding: 0.7rem 1.6rem;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.primary-button--compact {
  padding: 0.55rem 1.1rem;
  font-size: 0.8rem;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 25px 45px -35px rgba(79, 70, 229, 0.55);
  outline: none;
}

.primary-button span[aria-hidden="true"] {
  font-size: 1.1rem;
}

.hamburger-button {
  padding: 0.55rem;
  border-radius: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease;
}

.hamburger-button:hover,
.hamburger-button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.hamburger-panel {
  position: absolute;
  right: 0;
  margin-top: 0.5rem;
  width: 240px;
  background: var(--card-bg);
  border-radius: 1rem;
  border: 1px solid var(--divider);
  box-shadow: 0 30px 45px -25px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.hamburger-panel button {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  color: var(--text-main);
  transition: background 0.15s ease;
}

.hamburger-panel button:hover,
.hamburger-panel button:focus-visible {
  background: rgba(79, 70, 229, 0.08);
  outline: none;
}

.hamburger-panel button.primary-action {
  justify-content: center;
  color: #fff;
  background: var(--primary);
}

.hamburger-panel button.primary-action:hover,
.hamburger-panel button.primary-action:focus-visible {
  background: var(--primary-dark);
}

.main-section {
  flex: 1;
  width: 100%;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem);
}

.card-shell {
  background: var(--card-bg);
  border-radius: 1.5rem;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.card-header .view-toggle {
  flex: 1 1 auto;
}

.card-header .table-tools {
  flex: 0 0 auto;
}

.view-toggle {
  display: inline-flex;
  align-items: center;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem 0.25rem 0.35rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.1);
  border: 1px solid rgba(79, 70, 229, 0.18);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toggle:hover,
.toggle:focus-within {
  background: rgba(79, 70, 229, 0.15);
  border-color: rgba(79, 70, 229, 0.25);
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
}

.toggle-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.35);
  position: relative;
  transition: background 0.2s ease;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-track {
  background: var(--primary);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
}

.toggle-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.9rem;
}

.data-table thead tr:first-child th {
  padding-bottom: 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.data-table thead tr:first-child th button {
  background: transparent;
  border: none;
  color: inherit;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: inherit;
  letter-spacing: inherit;
}

.data-table thead tr:first-child th button:hover,
.data-table thead tr:first-child th button:focus-visible {
  color: var(--primary-dark);
  outline: none;
}

.table-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0;
}

.table-tools .button-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}

.filter-panel {
  background: rgba(79, 70, 229, 0.06);
  border: 1px solid rgba(79, 70, 229, 0.14);
  border-radius: 1.1rem;
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filter-grid input,
.filter-grid select {
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  padding: 0.6rem 0.9rem;
  font-size: 0.85rem;
  color: var(--text-main);
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.filter-grid input:focus,
.filter-grid select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
}

.table-row {
  --priority-color: rgba(148, 163, 184, 0.65);
  --priority-tint: rgba(148, 163, 184, 0.12);
  background: linear-gradient(135deg, var(--priority-tint) 0%, rgba(255, 255, 255, 0.98) 65%);
  box-shadow: 0 24px 38px -32px rgba(15, 23, 42, 0.35);
  border-radius: 1.1rem;
  border-left: 0.45rem solid var(--priority-color);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.table-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 26px 50px -32px rgba(15, 23, 42, 0.45);
}

.table-row td {
  background: transparent;
  padding: 1rem 1.4rem;
  border: none;
  vertical-align: middle;
  font-size: 0.88rem;
  color: var(--text-main);
}

.table-row td:first-child {
  border-top-left-radius: 1.1rem;
  border-bottom-left-radius: 1.1rem;
  font-weight: 600;
}

.table-row td:last-child {
  border-top-right-radius: 1.1rem;
  border-bottom-right-radius: 1.1rem;
  text-align: right;
}

.table-row--mine {
  background: linear-gradient(115deg, var(--priority-tint, rgba(79, 70, 229, 0.18)) 0%, rgba(255, 255, 255, 0.95) 70%);
  box-shadow: var(--shadow-strong);
}

.table-row--done {
  opacity: 0.92;
}

.table-row .meta-sub {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-row .text-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  line-height: 1.2;
}

.cell-strong {
  font-weight: 600;
  color: var(--text-main);
}

.cell-subtle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cell-subtle.upper {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--priority-color, var(--primary-dark));
  background: var(--priority-tint, rgba(148, 163, 184, 0.16));
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.priority-chip::before {
  content: '';
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--priority-color, currentColor);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.action-button {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.35rem;
  font-weight: 600;
  font-size: 0.78rem;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 15px 30px -25px rgba(79, 70, 229, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.action-button:hover,
.action-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px -24px rgba(79, 70, 229, 0.75);
  outline: none;
}

.action-button--reopen {
  background: var(--warning);
  box-shadow: 0 15px 30px -25px rgba(234, 88, 12, 0.6);
}

.action-button--reopen:hover,
.action-button--reopen:focus-visible {
  background: var(--warning-dark);
  box-shadow: 0 18px 34px -22px rgba(234, 88, 12, 0.68);
}

.mobile-task-list {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
}

.mobile-card {
  --priority-color: rgba(148, 163, 184, 0.65);
  --priority-tint: rgba(148, 163, 184, 0.18);
  --priority-contrast: var(--primary-dark);
  background: linear-gradient(135deg, var(--priority-tint) 0%, rgba(255, 255, 255, 0.98) 70%);
  border-radius: 1.1rem;
  box-shadow: 0 24px 42px -30px rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-left: 0.45rem solid var(--priority-color);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mobile-card--mine {
  border-color: rgba(79, 70, 229, 0.32);
  border-left-color: var(--priority-color, rgba(79, 70, 229, 0.45));
  box-shadow: var(--shadow-strong);
}

.mobile-card--done {
  opacity: 0.92;
}

.mobile-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.mobile-card__title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  flex: 1;
}

.mobile-card__priority {
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid currentColor;
  padding: 0.15rem 0.6rem;
  white-space: nowrap;
  color: var(--priority-color, var(--primary-dark));
  background: var(--priority-tint, rgba(148, 163, 184, 0.18));
}

.mobile-card__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-card__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mobile-card__meta span {
  background: rgba(226, 232, 240, 0.65);
  color: var(--text-main);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  line-height: 1;
}

.mobile-card__meta span:first-child {
  background: var(--priority-tint, rgba(79, 70, 229, 0.12));
  color: var(--priority-color, var(--primary-dark));
}

.mobile-card__meta span:nth-child(2) {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mobile-action-button {
  flex-shrink: 0;
  padding: 0.45rem 1.1rem;
  font-size: 0.75rem;
}

.mobile-card__detail {
  align-self: flex-start;
  background: transparent;
  border: none;
  color: var(--primary-dark);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
}

.mobile-card__detail::after {
  content: '›';
  font-size: 1.1rem;
  line-height: 1;
}

.mobile-card__detail:hover,
.mobile-card__detail:focus-visible {
  text-decoration: underline;
  outline: none;
}

.mobile-empty {
  text-align: center;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1.25rem 0;
}

.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  font-weight: 600;
  color: rgba(100, 116, 139, 0.9);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 40;
}

.detail-panel,
.form-panel {
  background: var(--card-bg);
  border-radius: 1.5rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 35px 65px -30px rgba(15, 23, 42, 0.45);
  width: min(640px, 100%);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-start;
    padding: clamp(1rem, 4vh, 1.5rem) clamp(0.75rem, 4vw, 1.25rem);
  }

  .detail-panel,
  .form-panel {
    margin: clamp(1rem, 6vh, 2rem) auto;
    border-radius: 1.25rem;
  }
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.8rem;
  line-height: 1;
  color: rgba(100, 116, 139, 0.85);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease;
}

.close-button:hover,
.close-button:focus-visible {
  color: #ef4444;
  outline: none;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--divider);
  background: #f8fafc;
  color: var(--text-muted);
}

.priority-pill {
  color: #fff;
  border: none;
}

.detail-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-validation {
  color: #16a34a;
  font-weight: 600;
}

.prose {
  color: var(--text-main);
  line-height: 1.6;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-weight: 600;
  line-height: 1.3;
  margin: 1.2rem 0 0.75rem;
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child,
.prose h4:first-child {
  margin-top: 0;
}

.prose p {
  margin-bottom: 0.75rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 0.75rem 0 0.75rem 1.25rem;
  padding: 0;
  list-style-position: outside;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose li:last-child {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid .full-span {
    grid-column: span 2;
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #f8f9ff;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  transition: border 0.15s ease, box-shadow 0.15s ease;
  color: var(--text-main);
}

.form-field textarea {
  min-height: 140px;
  resize: vertical;
}

.input-with-action,
.textarea-with-action {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.input-with-action input,
.input-with-action select,
.textarea-with-action textarea {
  flex: 1 1 auto;
}

.textarea-with-action {
  align-items: stretch;
}

.attachment-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 1.25rem;
  border-radius: 1rem;
  border: 2px dashed rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.08);
  color: var(--text-main);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.attachment-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  pointer-events: none;
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone--active {
  border-color: rgba(79, 70, 229, 0.7);
  background: rgba(79, 70, 229, 0.12);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
  outline: none;
}

.attachment-dropzone--has-file {
  border-style: solid;
  background: rgba(79, 70, 229, 0.08);
}

.attachment-dropzone__icon {
  width: 2.75rem;
  height: 2.75rem;
  fill: currentColor;
}

.attachment-dropzone__hint {
  font-size: 0.85rem;
  font-weight: 500;
}

.attachment-dropzone__limit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.attachment-dropzone__button {
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.45rem 1.1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  transition: all 0.2s ease;
}

.attachment-dropzone__button:hover,
.attachment-dropzone__button:focus-visible {
  background: rgba(79, 70, 229, 0.18);
  outline: none;
}

.attachment-error {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #b91c1c;
  font-weight: 600;
}

.attachment-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.9rem;
  background: rgba(79, 70, 229, 0.12);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.attachment-preview__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.attachment-preview__thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(79, 70, 229, 0.25);
}

.attachment-preview__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview__icon {
  font-size: 1.5rem;
}

.attachment-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.attachment-preview__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
  word-break: break-word;
}

.attachment-preview__size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.attachment-preview__remove {
  border: none;
  background: transparent;
  font-size: 1rem;
  color: rgba(15, 23, 42, 0.6);
  cursor: pointer;
  border-radius: 999px;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.attachment-preview__remove:hover,
.attachment-preview__remove:focus-visible {
  background: rgba(15, 23, 42, 0.08);
  color: var(--primary-dark);
  outline: none;
}

.detail-attachment {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-attachment__preview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-attachment__image {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #ffffff;
  cursor: zoom-in;
}

.detail-attachment__image:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.detail-attachment__file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.12);
}

.detail-attachment__icon {
  font-size: 1.6rem;
}

.detail-attachment__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-attachment__name {
  font-weight: 600;
}

.detail-attachment__size {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.detail-attachment__link {
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, 0.35);
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-dark);
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.detail-attachment__link:hover,
.detail-attachment__link:focus-visible {
  background: rgba(79, 70, 229, 0.18);
  outline: none;
}

.detail-comments {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.detail-comments__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.detail-comments__title {
  font-size: 1rem;
  font-weight: 600;
}

.detail-comments__toggle {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.65);
  color: var(--primary-dark);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.detail-comments__toggle:hover,
.detail-comments__toggle:focus-visible {
  background: rgba(79, 70, 229, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.detail-comments__list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.detail-comments__empty {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.detail-comment {
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-comment__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.detail-comment__author {
  font-weight: 600;
  color: var(--text-main);
}

.detail-comment__time {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-comment__text {
  color: var(--text-main);
  line-height: 1.45;
  white-space: pre-wrap;
}

.detail-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.detail-comment-form[data-submitting="true"] {
  opacity: 0.65;
}

.detail-comment-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-comment-form__field span {
  font-weight: 600;
  color: var(--text-muted);
}

.detail-comment-form__field textarea {
  width: 100%;
  min-height: 96px;
  padding: 0.75rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.detail-comment-form__field textarea:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.detail-comment-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.detail-comment-form__actions .primary-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.attachment-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  z-index: 60;
}

.attachment-lightbox__inner {
  position: relative;
  width: min(960px, 100%);
  max-height: min(90vh, 720px);
}

.attachment-lightbox__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 1.25rem;
  background: #0f172a;
  box-shadow: 0 40px 80px -35px rgba(15, 23, 42, 0.65);
}

.attachment-lightbox__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.65);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.attachment-lightbox__close:hover,
.attachment-lightbox__close:focus-visible {
  background: rgba(59, 130, 246, 0.9);
  transform: scale(1.05);
  outline: none;
}

@media (max-width: 640px) {
  .attachment-lightbox__inner {
    max-height: 82vh;
  }
}

.attachment-indicator,
.comment-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
}

.comment-indicator {
  color: #2563eb;
}

.voice-button,
.assistant-record-button {
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #4338ca);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -12px rgba(37, 99, 235, 0.75);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.assistant-record-button {
  width: auto;
  min-height: 2.5rem;
  gap: 0.4rem;
  padding: 0 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.voice-button svg,
.assistant-record-button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.assistant-record-button svg {
  margin-right: 0.35rem;
}

.voice-button:hover,
.voice-button:focus-visible,
.assistant-record-button:hover,
.assistant-record-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -10px rgba(37, 99, 235, 0.8);
}

.voice-button:focus-visible,
.assistant-record-button:focus-visible {
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.voice-button[disabled],
.assistant-record-button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
  background: rgba(148, 163, 184, 0.4);
  color: rgba(15, 23, 42, 0.55);
}

.voice-button.is-recording,
.assistant-record-button.is-recording {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 12px 30px -10px rgba(239, 68, 68, 0.75);
}

.assistant-audio-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.assistant-clear-button {
  padding: 0.35rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 999px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  background: #fff;
}

.form-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .form-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.button-ghost {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  padding: 0.65rem 1.45rem;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.button-ghost:hover,
.button-ghost:focus-visible {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-main);
  outline: none;
}

.form-error {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
}

.form-hint,
.form-success,
.form-error {
  margin-top: 0.5rem;
}

.form-hint {
  font-size: 0.85rem;
  color: rgba(15, 23, 42, 0.55);
}

.form-success {
  font-size: 0.85rem;
  font-weight: 600;
  color: #15803d;
}

.assistant-panel {
  gap: 1.5rem;
}

.assistant-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.assistant-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.assistant-transcript {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.assistant-transcript h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.assistant-transcript p {
  margin: 0;
  white-space: pre-wrap;
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.9rem;
}

.modal-backdrop.is-loading .form-panel {
  opacity: 0.75;
  pointer-events: none;
}

.login-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 60;
}

.login-panel {
  width: min(360px, 100%);
  background: var(--card-bg);
  border-radius: 1.5rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 35px 60px -30px rgba(15, 23, 42, 0.4);
  padding: clamp(1.75rem, 5vw, 2.4rem);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-panel h2 {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.login-panel p {
  font-size: 0.9rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.login-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.login-input {
  border-radius: 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #eef2ff;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
  background: #fff;
}

.login-submit {
  border-radius: 0.95rem;
  border: none;
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.login-submit:hover,
.login-submit:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 28px 45px -30px rgba(79, 70, 229, 0.55);
  outline: none;
}

.login-error {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
  text-align: center;
}

@media (max-width: 640px) {
  .app-header__content {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem 1.1rem;
    gap: 0.5rem;
  }
  .app-heading {
    display: none;
  }
  .app-header__actions {
    align-self: stretch;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }
  .app-header__actions .badge-user {
    flex: 0 1 auto;
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
  #btn-assistant-mobile {
    flex: 0 0 auto;
    font-size: 0.75rem;
    padding: 0.4rem 0.9rem;
  }
  #btn-assistant-mobile span[aria-hidden="true"] {
    font-size: 0.95rem;
  }
  #btn-logout {
    display: none !important;
  }
}

@media (max-width: 720px) {
  .card-header {
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }
  .card-header .view-toggle {
    flex: 1 1 auto;
  }
  .card-header .table-tools {
    flex: 0 0 auto;
  }
  .card-header .table-tools .button-outline {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
  }
  .table-wrapper {
    overflow: visible;
  }
  .data-table {
    display: none;
  }
  .mobile-task-list {
    display: flex;
  }
  .table-tools {
    justify-content: flex-end;
  }
  .filter-panel {
    padding: 1rem;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .mobile-card__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .mobile-action-button {
    width: 100%;
    justify-content: center;
  }
}

.prose pre,
.prose code {
  background: #111827;
  color: #f8fafc;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
}

.sort-indicator {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.45);
  position: relative;
}

.sort-indicator::before,
.sort-indicator::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 6px;
  height: 1px;
  background: currentColor;
  transform: translateX(-50%);
  opacity: 0;
}

.sort-indicator::before {
  top: 2px;
}

.sort-indicator::after {
  bottom: 2px;
}

.sort-indicator[data-direction='asc']::before {
  transform: translateX(-50%) rotate(45deg);
}

.sort-indicator[data-direction='asc']::after {
  transform: translateX(-50%) rotate(-45deg);
}

.sort-indicator[data-direction='desc']::before {
  transform: translateX(-50%) rotate(-45deg);
}

.sort-indicator[data-direction='desc']::after {
  transform: translateX(-50%) rotate(45deg);
}

.sort-indicator[data-direction]::before,
.sort-indicator[data-direction]::after {
  opacity: 1;
}
