/* ==========================================================================
   VIA Schweiz — Design System & Agile Backlog Stylesheet
   ========================================================================== */

:root {
  /* VIA Official Brand Palette */
  --via-ink: #17222b;
  --via-ink-light: #22323f;
  --via-muted: #738087;
  --via-paper: #f4f6f6;
  --via-white: #ffffff;
  
  --via-cyan: #56bfd7;
  --via-cyan-dark: #168aa6;
  --via-cyan-soft: #e3f6fa;
  --via-cyan-glow: rgba(86, 191, 215, 0.25);

  --via-red: #e84c4f;
  --via-red-soft: #fde9e9;
  --via-green: #188a53;
  --via-green-soft: #e2f5eb;
  --via-amber: #d99d27;
  --via-amber-soft: #fff3ce;
  --via-purple: #8b5cf6;

  --via-line: #e4e8e9;
  --via-line-dark: rgba(255, 255, 255, 0.1);
  --via-shadow: 0 16px 40px rgba(23, 34, 43, 0.08);
  --via-shadow-card: 0 2px 8px rgba(23, 34, 43, 0.05);
  --via-shadow-elevated: 0 12px 30px rgba(23, 34, 43, 0.12);

  /* Typography */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Manrope', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Geometry & Radii */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--via-paper);
  color: var(--via-ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Top Announcement Bar (VIA Signature)
   ========================================================================== */
.via-top-announcement {
  background: var(--via-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-content {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.swiss-flag-bullet {
  font-size: 13px;
  margin-right: 6px;
}

.announcement-text {
  font-family: var(--font-heading);
}

.announcement-badge {
  background: var(--via-cyan-dark);
  color: #fff;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
  background: var(--via-white);
  border-bottom: 1px solid var(--via-line);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(23, 34, 43, 0.03);
}

.header-brand {
  display: flex;
  align-items: center;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--via-cyan-dark);
  clip-path: polygon(0 0, 32% 0, 50% 57%, 68% 0, 100% 0, 67% 100%, 33% 100%);
  transition: transform var(--transition-fast);
}

.brand-link:hover .brand-mark {
  transform: scale(1.05);
}

.brand-mark-small {
  width: 22px;
  height: 25px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--via-cyan-dark);
  clip-path: polygon(0 0, 32% 0, 50% 57%, 68% 0, 100% 0, 67% 100%, 33% 100%);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--via-ink);
}

.brand-tag {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--via-cyan-dark);
  background: var(--via-cyan-soft);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  letter-spacing: -0.01em;
}

.brand-slogan {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--via-muted);
  text-transform: uppercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.view-switcher {
  display: flex;
  background: var(--via-paper);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--via-line);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--via-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--via-ink);
}

.tab-btn.active {
  background: var(--via-white);
  color: var(--via-cyan-dark);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* ==========================================================================
   Buttons & UI Elements (VIA Swiss Aesthetic)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
}

.btn-via-primary {
  background: var(--via-cyan-dark);
  color: #fff;
  border-color: var(--via-cyan-dark);
  box-shadow: 0 2px 8px rgba(22, 138, 166, 0.25);
}

.btn-via-primary:hover {
  background: #11738c;
  border-color: #11738c;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--via-white);
  color: var(--via-ink);
  border-color: var(--via-line);
}

.btn-secondary:hover {
  background: #fafbfb;
  border-color: var(--via-cyan-dark);
  color: var(--via-cyan-dark);
}

.btn-export {
  border-color: #bfe5ed;
  background: var(--via-cyan-soft);
  color: var(--via-cyan-dark);
}

.btn-export:hover {
  background: #cfeed6;
  border-color: var(--via-cyan);
}

.btn-ghost {
  background: transparent;
  color: var(--via-muted);
}

.btn-ghost:hover {
  background: var(--via-paper);
  color: var(--via-ink);
}

.btn-danger {
  background: var(--via-red-soft);
  color: var(--via-red);
  border-color: rgba(232, 76, 79, 0.2);
}

.btn-danger:hover {
  background: var(--via-red);
  color: #fff;
}

.btn-icon {
  background: var(--via-white);
  color: var(--via-muted);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-xs);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  color: var(--via-cyan-dark);
  border-color: var(--via-cyan-dark);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.via-ai-badge {
  background: linear-gradient(135deg, #168aa6, #56bfd7);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ==========================================================================
   Filter & Search Toolbar
   ========================================================================== */
.toolbar-section {
  background: var(--via-white);
  border-bottom: 1px solid var(--via-line);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
  max-width: 480px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--via-muted);
}

.search-box input {
  width: 100%;
  background: var(--via-paper);
  border: 1px solid var(--via-line);
  color: var(--via-ink);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.5rem 2.2rem 0.5rem 2.4rem;
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--via-cyan-dark);
  background: #fff;
  box-shadow: 0 0 0 2px var(--via-cyan-glow);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--via-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--via-muted);
}

.filter-select {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  color: var(--via-ink);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--via-cyan-dark);
}

.board-quick-metrics {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.via-stat-chip {
  background: var(--via-cyan-soft);
  border: 1px solid #c9eaf1;
  color: var(--via-cyan-dark);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   Main Workspace & Kanban Columns
   ========================================================================== */
.main-workspace {
  flex: 1;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
}

.kanban-columns-container {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  min-height: calc(100vh - 190px);
}

/* Individual Kanban Column (VIA Style) */
.kanban-column {
  background: #eaeff0;
  border: 1px solid var(--via-line);
  border-radius: var(--radius-sm);
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
  box-shadow: var(--via-shadow-card);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.kanban-column.drag-over {
  border-color: var(--via-cyan-dark);
  background: #e0f2f6;
}

.column-header {
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f6;
  border-bottom: 1px solid var(--via-line);
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

.column-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.column-indicator {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-xs);
}

.column-name {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--via-ink);
}

.column-badge {
  background: var(--via-white);
  color: var(--via-muted);
  border: 1px solid var(--via-line);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.stat-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--via-muted);
}

.column-cards-list {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 80px;
}

.column-cards-list::-webkit-scrollbar {
  width: 5px;
}
.column-cards-list::-webkit-scrollbar-thumb {
  background: #c5d0d4;
  border-radius: 2px;
}

.column-quick-add {
  padding: 0.65rem 0.75rem;
  background: #f1f5f6;
  border-top: 1px solid var(--via-line);
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.btn-column-add {
  width: 100%;
  background: var(--via-white);
  border: 1px dashed #b9c6cb;
  color: var(--via-muted);
  padding: 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-column-add:hover {
  background: var(--via-cyan-soft);
  color: var(--via-cyan-dark);
  border-color: var(--via-cyan-dark);
}

/* ==========================================================================
   Ticket Cards (VIA Swiss Agile Cards)
   ========================================================================== */
.ticket-card {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-xs);
  padding: 0.85rem 0.95rem;
  box-shadow: 0 1px 3px rgba(23, 34, 43, 0.06);
  cursor: grab;
  user-select: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ticket-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--via-shadow-elevated);
  border-color: var(--via-cyan);
}

.ticket-card.is-dragging {
  opacity: 0.35;
  cursor: grabbing;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.card-key {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--via-cyan-dark);
  background: var(--via-cyan-soft);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid #bfe5ed;
  font-size: 0.75rem;
}

.card-priority-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-priority-badge.urgent { background: var(--via-red-soft); color: var(--via-red); border: 1px solid #f9c5c7; }
.card-priority-badge.high   { background: #fef0e6; color: #d9631e; border: 1px solid #fed2b7; }
.card-priority-badge.medium { background: var(--via-amber-soft); color: #8d6500; border: 1px solid #ffe699; }
.card-priority-badge.low    { background: var(--via-green-soft); color: var(--via-green); border: 1px solid #bde7d1; }

.card-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--via-ink);
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-chip {
  background: #edf1f2;
  color: var(--via-muted);
  border: 1px solid var(--via-line);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

/* Criteria checklist progress on card */
.card-criteria-progress {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.73rem;
  color: var(--via-muted);
}

.criteria-mini-bar {
  flex: 1;
  height: 4px;
  background: #e4e8e9;
  border-radius: 2px;
  overflow: hidden;
}

.criteria-mini-fill {
  height: 100%;
  background: var(--via-green);
  border-radius: 2px;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f0f3f4;
  padding-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--via-muted);
}

.card-type-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
}

.card-points-badge {
  background: var(--via-ink);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}

.card-assignee {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--via-ink);
  font-weight: 600;
}

.assignee-avatar-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--via-cyan-dark);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   List / Table View
   ========================================================================== */
.table-card {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-xs);
  overflow: hidden;
  box-shadow: var(--via-shadow-card);
}

.backlog-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.backlog-table th {
  background: #f7f9f9;
  color: var(--via-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--via-line);
}

.backlog-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--via-line);
  color: var(--via-ink);
  vertical-align: middle;
}

.backlog-table tr:hover td {
  background: #f9fbfb;
  cursor: pointer;
}

/* ==========================================================================
   Metrics View
   ========================================================================== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-xs);
  padding: 1.5rem;
  box-shadow: var(--via-shadow-card);
}

.metric-eyebrow, .card-eyebrow {
  color: var(--via-cyan-dark);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.metric-title {
  color: var(--via-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--via-ink);
  margin: 6px 0;
}

.metric-sub {
  color: var(--via-muted);
  font-size: 0.8rem;
}

.progress-bar-bg {
  height: 7px;
  background: #edf1f2;
  border-radius: 3px;
  margin-top: 0.75rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--via-cyan-dark), var(--via-cyan));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.analytics-card {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-xs);
  padding: 1.5rem;
  box-shadow: var(--via-shadow-card);
}

.analytics-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.dist-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.bar-label {
  width: 120px;
  color: var(--via-muted);
  font-weight: 600;
}

.bar-track {
  flex: 1;
  height: 10px;
  background: #edf1f2;
  border-radius: 5px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 5px;
}

.bar-val {
  width: 55px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--via-ink);
}

/* ==========================================================================
   MODAL: Add / Edit Ticket with Split AI Copilot (VIA Swiss Theme)
   ========================================================================== */
dialog {
  padding: 0;
  border: none;
  background: transparent;
  margin: auto;
  outline: none;
}

dialog::backdrop {
  background: rgba(23, 34, 43, 0.75);
  backdrop-filter: blur(6px);
}

dialog#ticketModal {
  max-width: 95vw;
  max-height: 90vh;
  width: 860px;
  height: auto;
  margin: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--via-line);
}

.modal-body-form {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-height: calc(90vh - 70px);
}

.ticket-modal .modal-wrapper {
  background: var(--via-white);
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--via-shadow);
  overflow: hidden;
}

.settings-modal .modal-wrapper-compact {
  background: var(--via-white);
  border: 1px solid var(--via-line);
  border-radius: var(--radius-md);
  width: 540px;
  max-width: 95vw;
  display: flex;
  flex-direction: column;
  box-shadow: var(--via-shadow);
}

.modal-header {
  padding: 0.85rem 1.75rem;
  background: #f7f9fa;
  border-bottom: 1px solid var(--via-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title-group h2 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ticket-key-pill {
  font-family: var(--font-mono);
  background: var(--via-cyan-soft);
  color: var(--via-cyan-dark);
  border: 1px solid #bfe5ed;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-modal-action {
  background: #fff;
  border: 1px solid var(--via-line);
  color: var(--via-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-modal-action:hover {
  background: var(--via-cyan-soft);
  color: var(--via-cyan-dark);
  border-color: var(--via-cyan);
}

.close-modal-btn {
  background: #fff;
  border: 1px solid var(--via-line);
  color: var(--via-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.close-modal-btn:hover {
  color: var(--via-red);
  border-color: var(--via-red);
  background: var(--via-red-soft);
}

/* Split Pane Body */
.modal-body-split {
  display: grid;
  grid-template-columns: 0.95fr 1.25fr;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 60px);
}

/* Edit Mode: Clean focused single-pane layout when opening an existing ticket */
dialog#ticketModal.edit-mode .modal-body-split {
  grid-template-columns: 1fr;
}

dialog#ticketModal.edit-mode .ai-pane {
  display: none !important;
}

dialog#ticketModal.edit-mode .form-pane {
  border-right: none;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 3rem;
}

dialog#ticketModal.windowed.edit-mode {
  width: 920px;
}

.modal-pane {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.form-pane {
  border-right: 1px solid var(--via-line);
  background: var(--via-white);
}

.ai-pane {
  background: #17222b;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--via-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.form-label.required::after {
  content: " *";
  color: var(--via-red);
}

.label-with-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.label-with-badge .form-label {
  margin-bottom: 0;
}

.field-badge.required {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field-error-text {
  display: none;
  color: #f87171;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.35rem;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.3;
}

.field-error-text.visible {
  display: flex;
}

.quick-suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--via-cyan);
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  background: rgba(86, 191, 215, 0.15);
  border-color: var(--via-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.label-hint {
  font-size: 0.72rem;
  color: var(--via-muted);
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--via-line);
  color: var(--via-ink);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-xs);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input.is-invalid, .form-select.is-invalid, .form-textarea.is-invalid, .criteria-list-container.is-invalid {
  border-color: #ef4444 !important;
  background: #fff8f8 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
  animation: shake-field 0.3s ease-in-out;
}

@keyframes shake-field {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--via-cyan-dark);
  box-shadow: 0 0 0 2px var(--via-cyan-glow);
}

.form-textarea {
  resize: vertical;
  line-height: 1.55;
}

.form-row {
  display: grid;
  gap: 0.75rem;
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-4 { grid-template-columns: repeat(4, 1fr); }

/* Acceptance Criteria Checklist Manager */
.criteria-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.criteria-count {
  font-size: 0.75rem;
  color: var(--via-muted);
}

.criteria-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  max-height: 170px;
  overflow-y: auto;
}

.criteria-item-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--via-paper);
  border: 1px solid var(--via-line);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}

.criteria-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--via-cyan-dark);
}

.criteria-text-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--via-ink);
  font-size: 0.85rem;
  outline: none;
}

.criteria-text-input.completed {
  text-decoration: line-through;
  color: var(--via-muted);
}

.btn-remove-criteria {
  background: transparent;
  border: none;
  color: var(--via-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.btn-remove-criteria:hover {
  color: var(--via-red);
}

.add-criteria-row {
  display: flex;
  gap: 0.5rem;
}

.modal-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--via-line);
}

.actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* ==========================================================================
   AI Copilot Pane Styles (Dark VIA Ink Theme)
   ========================================================================== */
.ai-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-status-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.via-ai-avatar {
  background: var(--via-cyan);
  color: var(--via-ink);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 0 12px var(--via-cyan-glow);
}

.ai-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.ai-subtitle {
  font-size: 0.75rem;
  color: #9ca8ae;
}

.ai-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ai-header-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c5d0d4;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-ai-header-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-apply-ai {
  background: var(--via-cyan);
  color: var(--via-ink);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 15px var(--via-cyan-glow);
  animation: pulse-glow-via 2s infinite;
}

.btn-apply-batch {
  background: linear-gradient(135deg, #e5a429, #f59e0b);
  color: #17222b;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(229, 164, 41, 0.4);
  animation: pulse-glow-batch 2s infinite;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

@keyframes pulse-glow-batch {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(229, 164, 41, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(229, 164, 41, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(229, 164, 41, 0.4); }
}

@keyframes pulse-glow-via {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(86, 191, 215, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 20px rgba(86, 191, 215, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 10px rgba(86, 191, 215, 0.4); }
}

.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ai-chip {
  background: rgba(86, 191, 215, 0.12);
  border: 1px solid rgba(86, 191, 215, 0.25);
  color: #c9eaf1;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-chip:hover {
  background: rgba(86, 191, 215, 0.25);
  color: #fff;
  border-color: var(--via-cyan);
}

.ai-chip.ai-chip-batch {
  background: rgba(229, 164, 41, 0.2);
  border-color: rgba(229, 164, 41, 0.45);
  color: #fed7aa;
  font-weight: 700;
}

.ai-chip.ai-chip-batch:hover {
  background: #e5a429;
  color: #17222b;
  box-shadow: 0 0 10px rgba(229, 164, 41, 0.5);
}

.ai-chip.ai-chip-finalize {
  background: rgba(86, 191, 215, 0.25);
  border-color: var(--via-cyan);
  color: #fff;
  font-weight: 700;
}

.ai-chip.ai-chip-finalize:hover {
  background: var(--via-cyan);
  color: var(--via-ink);
  box-shadow: 0 0 10px rgba(86, 191, 215, 0.5);
}

.ai-chat-history {
  flex: 1;
  background: #0f171e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xs);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: calc(100% - 150px);
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.user .message-bubble {
  background: var(--via-cyan-dark);
  color: #fff;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-message.assistant .message-bubble {
  background: #1f2d37;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #edf1f2;
}

.message-bubble {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  line-height: 1.45;
}

.message-bubble pre {
  background: #0b1120;
  padding: 0.6rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message-bubble code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.8rem;
}

/* In-Chat Interactive Batch & Proposal Cards */
.ai-interactive-widget {
  margin-top: 1rem;
  padding: 1rem;
  background: #141f27;
  border: 1px solid rgba(86, 191, 215, 0.3);
  border-radius: var(--radius-xs);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.ai-interactive-widget.batch {
  border-color: rgba(229, 164, 41, 0.4);
  background: #172129;
}

.ai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-widget-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-widget-primary {
  background: linear-gradient(135deg, #e5a429, #f59e0b);
  color: #17222b;
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(229, 164, 41, 0.4);
  transition: all var(--transition-fast);
}

.btn-widget-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(229, 164, 41, 0.7);
}

.ai-batch-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ai-batch-card-item {
  background: #1e2c36;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ai-batch-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-batch-card-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.86rem;
  line-height: 1.35;
}

.ai-batch-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
}

.ai-batch-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.btn-card-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #d1dbe0;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-action:hover {
  background: rgba(86, 191, 215, 0.25);
  color: #fff;
  border-color: var(--via-cyan);
}

.btn-card-action.added {
  background: rgba(24, 138, 83, 0.2) !important;
  color: #86efac !important;
  border-color: rgba(24, 138, 83, 0.5) !important;
  cursor: default !important;
}

.batch-completed-badge {
  background: rgba(24, 138, 83, 0.2);
  border: 1px solid rgba(24, 138, 83, 0.5);
  color: #86efac;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.ai-interactive-widget.batch.completed {
  border-color: rgba(24, 138, 83, 0.4);
  background: #13221b;
}

.message-bubble h3, .message-bubble h4 {
  margin: 0.4rem 0 0.2rem 0;
  color: #fff;
}

.message-bubble ul {
  padding-left: 1.2rem;
  margin: 0.4rem 0;
}

.ai-chat-input-box {
  display: flex;
  gap: 0.5rem;
  background: #0f171e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xs);
  padding: 0.4rem;
}

.ai-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 0.4rem;
  resize: none;
  outline: none;
}

.btn-send-ai {
  background: var(--via-cyan);
  border: none;
  color: var(--via-ink);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-self: flex-end;
}

.btn-send-ai:hover {
  background: #fff;
}

/* ==========================================================================
   Settings Modal & Status
   ========================================================================== */
.settings-modal .modal-body {
  padding: 1.5rem 1.75rem;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--via-muted);
  margin-bottom: 1.25rem;
}

.status-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--via-paper);
  border: 1px solid var(--via-line);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--via-green);
  box-shadow: 0 0 8px rgba(24, 138, 83, 0.5);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 100;
  pointer-events: none;
}

.toast {
  background: var(--via-ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--via-shadow);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success { border-left: 4px solid var(--via-green); }
.toast.error   { border-left: 4px solid var(--via-red); }
.toast.info    { border-left: 4px solid var(--via-cyan); }

@keyframes slideInToast {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Loading Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(23, 34, 43, 0.1);
  border-radius: 50%;
  border-top-color: var(--via-cyan-dark);
  animation: spin 0.8s linear infinite;
  margin: 2rem auto 1rem auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-state {
  text-align: center;
  color: var(--via-muted);
  padding: 3rem;
  width: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .modal-body-split {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .form-pane {
    border-right: none;
    border-bottom: 1px solid var(--via-line);
  }
  .form-row-4 {
    grid-template-columns: 1fr 1fr;
  }
  .toolbar-section {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: 100%;
  }
}

/* ==========================================================================
   ATTACHMENTS & MEDIA GALLERY STYLES
   ========================================================================== */

.attachments-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--via-line);
}

.attachment-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.attachment-dropzone:hover,
.attachment-dropzone:focus {
  border-color: var(--via-cyan);
  background: rgba(86, 191, 215, 0.05);
}

.attachment-dropzone.dragover {
  border-color: var(--via-cyan);
  background: rgba(86, 191, 215, 0.12);
  box-shadow: 0 0 16px rgba(86, 191, 215, 0.25);
  transform: scale(1.01);
}

.attachment-dropzone.highlight-dropzone {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.4);
  animation: pulse-dropzone 1s ease-in-out 3 alternate;
}

@keyframes pulse-dropzone {
  0% {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
  }
  100% {
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.55);
    border-color: #60a5fa;
  }
}

.dropzone-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(86, 191, 215, 0.12);
  color: var(--via-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dropzone-title {
  font-size: 0.9rem;
  color: var(--via-text);
}

.dropzone-sub {
  font-size: 0.75rem;
  color: var(--via-muted);
  margin-top: 0.2rem;
}

.dropzone-sub kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-family: monospace;
}

.attachment-upload-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--via-cyan);
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(86, 191, 215, 0.2);
  border-top-color: var(--via-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Attachment Grid & Cards */
.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.attachment-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.attachment-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Image thumbnail card */
.attachment-thumb-wrap {
  width: 100%;
  height: 110px;
  background: #0d141b;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.attachment-thumb-wrap:hover img {
  transform: scale(1.05);
}

/* Video thumbnail card */
.attachment-video-wrap {
  width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attachment-video-wrap video {
  width: 100%;
  max-height: 120px;
  outline: none;
}

/* Document file card */
.attachment-doc-wrap {
  width: 100%;
  height: 85px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--via-muted);
}

.attachment-doc-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.72rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.doc-pdf { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.doc-sheet { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.doc-word { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.doc-csv { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.doc-generic { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* Card footer details */
.attachment-details {
  padding: 0.5rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  background: rgba(15, 23, 30, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.attachment-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.attachment-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--via-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.attachment-name:hover {
  color: var(--via-cyan);
  text-decoration: underline;
}

.attachment-size {
  font-size: 0.68rem;
  color: var(--via-muted);
}

.attachment-delete-btn {
  background: transparent;
  border: none;
  color: var(--via-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.attachment-delete-btn:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
}

/* Kanban card attachment cover & badge */
.ticket-card-cover {
  width: 100%;
  height: 80px;
  overflow: hidden;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  margin: -0.75rem -0.75rem 0.6rem -0.75rem;
  background: #0d141b;
}

.ticket-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ticket-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--via-muted);
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

/* Lightbox Modal */
.lightbox-modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 90vw;
  max-height: 90vh;
  outline: none;
}

.lightbox-modal::backdrop {
  background: rgba(5, 10, 15, 0.85);
  backdrop-filter: blur(8px);
}

.lightbox-wrapper {
  background: var(--via-ink);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  max-width: 85vw;
  max-height: 85vh;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-filename {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--via-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-body {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: #080c10;
}

.lightbox-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-xs);
}

/* ==========================================================================
   VIA Backoffice — Authentication & Login Overlay Styles
   ========================================================================== */

.via-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.via-login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 24, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.via-login-modal {
  position: relative;
  z-index: 10001;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #1e2c38 0%, #131c24 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(86, 191, 215, 0.15);
  overflow: hidden;
  animation: modal-enter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-brand-header {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

.login-logo-mark {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #e84c4f 0%, #c53030 100%);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(232, 76, 79, 0.35);
  flex-shrink: 0;
}

.login-brand-text h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.login-brand-text h2 span {
  color: var(--via-cyan);
  font-weight: 600;
}

.login-brand-text small {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--via-muted);
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.login-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.login-badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(232, 76, 79, 0.15);
  border: 1px solid rgba(232, 76, 79, 0.3);
  color: #ff8a8d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  align-self: flex-start;
  margin-bottom: 1rem;
}

.login-body h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem;
}

.login-instructions {
  font-size: 0.9rem;
  color: #b0bec5;
  line-height: 1.5;
  margin: 0 0 1.75rem;
}

.login-instructions strong {
  color: var(--via-cyan);
  font-weight: 600;
}

.btn-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  color: #202124;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.btn-google-login:hover {
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.btn-google-login:active {
  transform: translateY(0);
}

.btn-google-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.google-icon {
  flex-shrink: 0;
}

.login-error-msg {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(232, 76, 79, 0.15);
  border: 1px solid rgba(232, 76, 79, 0.35);
  border-radius: 8px;
  color: #ff999b;
  font-size: 0.82rem;
  line-height: 1.45;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.login-footer-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--via-muted);
}

/* User Profile Chip in App Header */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.5rem 0.3rem 0.4rem;
  border-radius: 24px;
  margin-left: 0.5rem;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--via-cyan);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  max-width: 140px;
}

.user-display-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.68rem;
  color: var(--via-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(232, 76, 79, 0.15);
  border: 1px solid rgba(232, 76, 79, 0.25);
  color: #ff999b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(232, 76, 79, 0.3);
  color: #fff;
  border-color: rgba(232, 76, 79, 0.5);
}

@media (max-width: 768px) {
  .user-info-text {
    display: none;
  }
  .btn-logout span {
    display: none;
  }
}

