/* ==========================================================================
   Antigravity Jira — Professional Light Theme Design System
   Inspired by Atlassian Jira & Linear
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Backgrounds */
  --bg-body: #F4F5F7;
  --bg-white: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-surface: #FAFBFC;
  --bg-hover: #F0F1F4;
  --bg-active: #E9EAEF;
  --bg-input: #FAFBFC;
  --bg-card: #FFFFFF;
  --bg-column: #F0F1F4;
  --bg-login: #FAFBFC;
  --bg-modal-overlay: rgba(9, 30, 66, 0.54);
  --bg-badge: #DFE1E6;

  /* Borders */
  --border: #DFE1E6;
  --border-focus: #4C9AFF;
  --border-input: #DFE1E6;

  /* Primary — Jira Blue */
  --primary: #0052CC;
  --primary-hover: #0747A6;
  --primary-light: #DEEBFF;
  --primary-text: #0052CC;
  --primary-subtle: rgba(0, 82, 204, 0.08);

  /* Status Colors */
  --status-todo: #97A0AF;
  --status-todo-bg: #F4F5F7;
  --status-progress: #0065FF;
  --status-progress-bg: #DEEBFF;
  --status-ai: #00B8D9;
  --status-ai-bg: #E6FCFF;
  --status-review: #FF8B00;
  --status-review-bg: #FFF7E6;
  --status-done: #36B37E;
  --status-done-bg: #E3FCEF;

  /* Priority Colors */
  --priority-urgent: #DE350B;
  --priority-urgent-bg: #FFEBE6;
  --priority-high: #FF8B00;
  --priority-high-bg: #FFF7E6;
  --priority-medium: #0065FF;
  --priority-medium-bg: #DEEBFF;
  --priority-low: #6B778C;
  --priority-low-bg: #F4F5F7;

  /* Text */
  --text-primary: #172B4D;
  --text-secondary: #5E6C84;
  --text-tertiary: #97A0AF;
  --text-link: #0052CC;
  --text-inverse: #FFFFFF;

  /* Typography */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;

  /* Radii */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(9, 30, 66, 0.08);
  --shadow-md: 0 3px 8px rgba(9, 30, 66, 0.12);
  --shadow-lg: 0 8px 16px rgba(9, 30, 66, 0.15);
  --shadow-card: 0 1px 3px rgba(9, 30, 66, 0.1), 0 0 1px rgba(9, 30, 66, 0.08);
  --shadow-overlay: 0 12px 24px -6px rgba(9, 30, 66, 0.25), 0 0 0 1px rgba(9, 30, 66, 0.08);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.2s ease;

  /* Sidebar */
  --sidebar-width: 240px;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

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

html, body {
  height: 100%;
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #F4F5F7 0%, #DEEBFF 50%, #E6FCFF 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: var(--space-xl);
}

.login-card {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 40px 36px;
  box-shadow: var(--shadow-overlay);
  text-align: center;
}

.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  color: white;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-lg);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2xl);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.login-field {
  text-align: left;
}

.login-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.login-field input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color var(--transition-fast);
  outline: none;
}

.login-field input:focus {
  border-color: var(--border-focus);
  background: var(--bg-white);
}

.login-btn {
  width: 100%;
  padding: 11px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background var(--transition-fast);
}

.login-btn:hover {
  background: var(--primary-hover);
}

.login-error {
  color: var(--priority-urgent);
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 20px;
}

/* ==========================================================================
   APP SHELL LAYOUT
   ========================================================================== */

.app-container {
  display: none;
  height: 100vh;
  overflow: hidden;
}

.app-container.active {
  display: flex;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 12px 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  transition: var(--transition-fast);
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-btn .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nav-btn .nav-badge {
  margin-left: auto;
  background: var(--status-ai-bg);
  color: var(--status-ai);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
}

.avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.avatar-circle-sm {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}

.avatar-circle-xs {
  width: 20px;
  height: 20px;
  font-size: 0.58rem;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 5px 10px;
  font-weight: 500;
  transition: var(--transition-fast);
}

.btn-logout:hover {
  background: var(--priority-urgent-bg);
  color: var(--priority-urgent);
  border-color: var(--priority-urgent);
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-body);
}

/* Top Header Bar */
.top-bar {
  height: 56px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-bar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.breadcrumb a {
  color: var(--text-secondary);
  font-weight: 500;
}

.breadcrumb-sep {
  color: var(--text-tertiary);
}

.project-filter {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-white);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

.project-filter:focus {
  border-color: var(--border-focus);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input {
  position: relative;
}

.search-input input {
  padding: 6px 12px 6px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.82rem;
  width: 200px;
  outline: none;
  transition: var(--transition-fast);
}

.search-input input:focus {
  border-color: var(--border-focus);
  width: 260px;
  background: var(--bg-white);
}

.search-input .search-icon-el {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-primary-action {
  background: var(--primary);
  color: white;
}

.btn-primary-action:hover {
  background: var(--primary-hover);
}

.btn-default {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-default:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--priority-urgent);
}

.btn-danger:hover {
  background: var(--priority-urgent-bg);
  border-color: var(--priority-urgent);
}

.btn-ai {
  background: linear-gradient(135deg, #00B8D9 0%, #0065FF 100%);
  color: white;
  border: none;
}

.btn-ai:hover {
  opacity: 0.9;
}

/* ==========================================================================
   VIEWS CONTAINER
   ========================================================================== */

.views-container {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.view-panel {
  display: none;
  height: 100%;
}

.view-panel.active {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   KANBAN BOARD
   ========================================================================== */

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.kanban-column {
  background: var(--bg-column);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 400px;
  max-height: calc(100vh - 160px);
}

.column-header {
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.column-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.status-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.marker-todo { background: var(--status-todo); }
.marker-progress { background: var(--status-progress); }
.marker-ai { background: var(--status-ai); }
.marker-review { background: var(--status-review); }
.marker-done { background: var(--status-done); }

.column-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--bg-badge);
  padding: 2px 7px;
  border-radius: 10px;
}

.column-body {
  flex: 1;
  padding: 4px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 80px;
}

.column-body.drag-over {
  background: var(--primary-subtle);
  border-radius: var(--radius-md);
}

/* Task Card */
.task-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  border: 1px solid transparent;
  transition: var(--transition-fast);
  position: relative;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.task-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.task-card.ai-card {
  border-left: 3px solid var(--status-ai);
}

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

.task-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-link);
}

.task-project-badge {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: var(--bg-badge);
  color: var(--text-secondary);
}

.task-project-badge.code-badge {
  background: var(--status-ai-bg);
  color: var(--status-ai);
}

.task-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-priority {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pr-urgent { background: var(--priority-urgent-bg); color: var(--priority-urgent); }
.pr-high { background: var(--priority-high-bg); color: var(--priority-high); }
.pr-medium { background: var(--priority-medium-bg); color: var(--priority-medium); }
.pr-low { background: var(--priority-low-bg); color: var(--priority-low); }

.task-ai-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--status-ai);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--status-ai);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* PR Link in card */
.task-pr-link {
  display: block;
  font-size: 0.72rem;
  color: var(--text-link);
  margin-bottom: 6px;
  font-weight: 500;
}

/* ==========================================================================
   PROJECTS & BACKLOG VIEW
   ========================================================================== */

.projects-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: 100%;
  align-items: start;
}

.panel {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.panel-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-body {
  padding: 8px;
}

.project-card {
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: 4px;
}

.project-card:hover, .project-card.selected {
  background: var(--primary-light);
}

.project-card .proj-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.project-card .proj-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.project-card .proj-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 4px 0;
}

.type-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.pill-manual { background: var(--priority-high-bg); color: var(--priority-high); }
.pill-code { background: var(--status-ai-bg); color: var(--status-ai); }

/* Team Member Card */
.member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 2px;
}

.member-card:hover {
  background: var(--bg-hover);
}

.member-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.member-meta {
  font-size: 0.7rem;
  color: var(--text-tertiary);
}

/* Backlog Table */
.table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--border);
  background: var(--bg-surface);
}

.data-table td {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: var(--bg-hover);
}

/* ==========================================================================
   AI CONSOLE VIEW
   ========================================================================== */

.console-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: 100%;
}

.job-card {
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 2px solid transparent;
  margin-bottom: 4px;
}

.job-card:hover {
  background: var(--bg-hover);
}

.job-card.active {
  background: var(--status-ai-bg);
  border-color: var(--status-ai);
}

.terminal {
  background: #1E1E2E;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #313244;
}

.terminal-bar {
  background: #181825;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #313244;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.td-red { background: #F38BA8; }
.td-yellow { background: #F9E2AF; }
.td-green { background: #A6E3A1; }

.terminal-bar-title {
  font-size: 0.78rem;
  color: #A6ADC8;
  font-family: var(--font-mono);
}

.terminal-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #CDD6F4;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.log-entry {
  display: flex;
  gap: 12px;
  line-height: 1.6;
}

.log-time {
  color: #585B70;
  font-size: 0.72rem;
  white-space: nowrap;
}

.log-step-name {
  color: #89B4FA;
  font-weight: 600;
}

.log-msg-info { color: #CDD6F4; }
.log-msg-success { color: #A6E3A1; }
.log-msg-error { color: #F38BA8; }

.log-file-tag {
  display: inline-block;
  background: rgba(249, 226, 175, 0.15);
  color: #F9E2AF;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  margin-top: 4px;
}

.log-test-block {
  background: rgba(166, 227, 161, 0.1);
  border-left: 3px solid #A6E3A1;
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.75rem;
  color: #A6E3A1;
  white-space: pre-wrap;
  margin-top: 4px;
}

/* ==========================================================================
   MY TASKS VIEW
   ========================================================================== */

.tasks-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.task-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition-fast);
}

.task-item:last-child {
  border-bottom: none;
}

.task-item:hover {
  background: var(--bg-hover);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-modal-overlay);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding-top: 80px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-overlay);
  margin-bottom: 80px;
}

.modal.modal-wide {
  max-width: 720px;
}

.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-head h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-tertiary);
  line-height: 1;
  padding: 4px;
  border-radius: var(--radius-sm);
}

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

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Forms */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--bg-input);
  outline: none;
  transition: border-color var(--transition-fast);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-focus);
  background: var(--bg-white);
}

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

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ==========================================================================
   TICKET DETAIL MODAL
   ========================================================================== */

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 20px;
}

.detail-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.detail-desc-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 60px;
}

.comments-feed {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  display: flex;
  gap: 8px;
}

.comment-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.comment-meta strong {
  color: var(--text-primary);
}

.comment-text {
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-top: 2px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.comment-form input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  outline: none;
}

.comment-form input:focus {
  border-color: var(--border-focus);
}

/* Detail Sidebar */
.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.detail-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-primary);
  background: var(--bg-white);
  outline: none;
}

.detail-select:focus {
  border-color: var(--border-focus);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  max-width: 360px;
}

.toast.toast-success { border-left: 4px solid var(--status-done); }
.toast.toast-error { border-left: 4px solid var(--priority-urgent); }
.toast.toast-info { border-left: 4px solid var(--primary); }

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ==========================================================================
   SCROLLBAR
   ========================================================================== */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-badge); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }
