/* ============================================
   Aria-IF DSI — Design system
   Couleurs : logo INITIAFOOD
     - INITIA : rose magenta  #E91E63
     - FOOD   : vert lime     #A4C400
   Fond : noir profond
   ============================================ */

:root {
  /* Palette */
  --bg-0: #0a0a0a;
  --bg-1: #111113;
  --bg-2: #18181c;
  --bg-3: #22222a;
  --bg-elev: #1c1c22;
  --border: #2a2a32;
  --border-strong: #3a3a45;

  --text-0: #f5f5f7;
  --text-1: #d0d0d6;
  --text-2: #a0a0a8;
  --text-3: #606068;

  --pink: #E91E63;
  --pink-hover: #ff2a73;
  --pink-soft: rgba(233, 30, 99, 0.12);
  --pink-glow: rgba(233, 30, 99, 0.35);

  --lime: #A4C400;
  --lime-hover: #b6d400;
  --lime-soft: rgba(164, 196, 0, 0.12);

  --orange: #FFA726;
  --orange-soft: rgba(255, 167, 38, 0.12);
  --gray-status: #808080;
  --gray-status-soft: rgba(128, 128, 128, 0.15);

  --danger: #ff5252;
  --danger-soft: rgba(255, 82, 82, 0.12);

  /* Espacement */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.6);
  --glow-pink: 0 0 24px var(--pink-glow);
  --glow-lime: 0 0 24px rgba(164,196,0,0.35);

  /* Typo */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Menlo, Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(circle at 15% 0%, var(--pink-soft) 0%, transparent 40%),
    radial-gradient(circle at 85% 100%, var(--lime-soft) 0%, transparent 40%),
    var(--bg-0);
  background-attachment: fixed;
}

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

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

.hidden { display: none !important; }

/* ============================================
   VIEW: LOGIN
   ============================================ */

.view-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

.login-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-7) var(--space-6);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pink) 0%, var(--pink) 50%, var(--lime) 50%, var(--lime) 100%);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-5);
}

.login-logo svg {
  width: 220px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.login-tagline {
  font-size: 11px;
  color: var(--text-2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-top: var(--space-2);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 var(--space-1) 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  margin: 0 0 var(--space-6) 0;
}

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

.login-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: 13px;
  text-align: center;
}

.login-footer {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block;
}
.dot-pink { background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.dot-lime { background: var(--lime); box-shadow: 0 0 8px var(--lime); }

/* ============================================
   FIELDS & FORMS
   ============================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.required { color: var(--pink); }

.input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
select,
textarea {
  background: var(--bg-2);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--pink);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px var(--pink-soft);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a0a0a8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.field-row .field { min-width: 160px; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--bg-3);
  color: var(--text-0);
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--pink);
  color: white;
  box-shadow: 0 4px 14px var(--pink-soft);
}
.btn-primary:hover { background: var(--pink-hover); box-shadow: 0 6px 20px var(--pink-glow); }

.btn-secondary {
  background: var(--lime);
  color: #0a0a0a;
  box-shadow: 0 4px 14px var(--lime-soft);
}
.btn-secondary:hover { background: var(--lime-hover); }

.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); color: var(--text-0); border-color: var(--border-strong); }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

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

.view-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-logo {
  height: 32px;
  width: auto;
}

.app-header-divider {
  width: 1px; height: 24px;
  background: var(--border);
}

.app-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.3px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 4px 10px 4px 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.user-chip-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--pink), var(--lime));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0a0a0a;
}

.user-chip-name {
  font-size: 13px;
  font-weight: 500;
}

.app-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  overflow-y: auto;
  max-height: calc(100vh - 57px);
  position: sticky;
  top: 57px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  position: relative;
}

.sidebar-link:hover { background: var(--bg-2); color: var(--text-0); }
.sidebar-link.active {
  background: var(--pink-soft);
  color: var(--pink);
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--pink);
  border-radius: 0 2px 2px 0;
}

.sidebar-link .badge {
  margin-left: auto;
  background: var(--bg-3);
  color: var(--text-1);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.sidebar-link.active .badge {
  background: var(--pink);
  color: white;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-2) 14px;
}

.filter-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}
.filter-pill:hover { background: var(--bg-2); }
.filter-pill.active { background: var(--bg-2); color: var(--text-0); }
.filter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.filter-pill .filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
}

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

.content {
  padding: var(--space-6);
  overflow-x: hidden;
  min-width: 0;
}

.content-page {
  max-width: 1100px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.content-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text-0) 0%, var(--text-1) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.content-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 0 0;
}

.content-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}

.content-actions .input,
.content-actions select { min-width: 180px; }
.content-actions input[type="search"] { min-width: 240px; }

/* ============================================
   STATS GRID
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
  line-height: 1;
}

.stat-card-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
}

.stat-open .stat-card-bar { background: var(--pink); box-shadow: var(--glow-pink); }
.stat-open .stat-card-value { color: var(--pink); }

.stat-in-progress .stat-card-bar { background: var(--orange); box-shadow: 0 0 24px rgba(255,167,38,0.35); }
.stat-in-progress .stat-card-value { color: var(--orange); }

.stat-waiting .stat-card-bar { background: var(--gray-status); }
.stat-waiting .stat-card-value { color: var(--gray-status); }

.stat-resolved .stat-card-bar { background: var(--lime); box-shadow: var(--glow-lime); }
.stat-resolved .stat-card-value { color: var(--lime); }

/* ============================================
   SECTIONS
   ============================================ */

.section-block { margin-bottom: var(--space-6); }

.section-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-block-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

/* ============================================
   TICKET LIST / CARDS
   ============================================ */

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ticket-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}

.ticket-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.ticket-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--gray-status);
}
.ticket-card.priority-urgent::before { background: var(--pink); box-shadow: var(--glow-pink); }
.ticket-card.priority-high::before { background: var(--orange); }
.ticket-card.priority-normal::before { background: var(--gray-status); }
.ticket-card.priority-low::before { background: var(--lime); }

.ticket-card-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.ticket-card-id {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
  flex-shrink: 0;
}

.ticket-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  flex: 1;
  line-height: 1.4;
}

.ticket-card-priority {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.ticket-card-description {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin: var(--space-2) 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-3);
  font-size: 12px;
  color: var(--text-2);
}

.ticket-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ticket-meta-item svg { opacity: 0.6; }

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
}

.status-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-open        { background: var(--pink-soft);     color: var(--pink); }
.status-in_progress { background: var(--orange-soft);   color: var(--orange); }
.status-waiting     { background: var(--gray-status-soft); color: var(--text-1); }
.status-resolved    { background: var(--lime-soft);     color: var(--lime); }
.status-closed      { background: rgba(60,60,70,0.3);   color: var(--text-3); }

/* Priority badge */
.priority-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
}
.priority-urgent { color: var(--pink); }
.priority-high   { color: var(--orange); }
.priority-normal { color: var(--gray-status); }
.priority-low    { color: var(--lime); }

/* Category pill */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-1);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--text-3);
}
.empty-state-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: var(--space-3);
}

/* ============================================
   FORMS
   ============================================ */

.form-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

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

.ticket-detail {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-5);
  align-items: start;
}

.ticket-main {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.ticket-detail-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.ticket-detail-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 var(--space-2) 0;
  letter-spacing: -0.02em;
}

.ticket-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ticket-detail-description {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  margin: var(--space-4) 0;
}

.ticket-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.sidebar-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-3) 0;
}

.sidebar-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 6px 0;
  font-size: 13px;
}

.sidebar-card-row label {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}

.sidebar-card-row .sidebar-card-value {
  color: var(--text-0);
  font-weight: 500;
}

.sidebar-card-row select,
.sidebar-card-row input {
  padding: 6px 10px;
  font-size: 12px;
  min-width: 0;
  flex: 1;
  max-width: 160px;
}

/* Timeline */
.timeline {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.timeline-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--space-4) 0;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
}

.timeline-item {
  display: flex;
  gap: var(--space-3);
  position: relative;
  padding-left: var(--space-5);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px; top: 20px; bottom: -16px;
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }

.timeline-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 2px solid var(--border);
}

.timeline-dot.event-created   { background: var(--pink);  border-color: var(--pink); }
.timeline-dot.event-status    { background: var(--orange); border-color: var(--orange); }
.timeline-dot.event-priority  { background: var(--orange); border-color: var(--orange); }
.timeline-dot.event-assign    { background: var(--lime);  border-color: var(--lime); }
.timeline-dot.event-comment   { background: var(--bg-1);  border-color: var(--pink); }
.timeline-dot.event-edit      { background: var(--bg-1);  border-color: var(--text-2); }

.timeline-body { flex: 1; }

.timeline-line {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.5;
}

.timeline-line strong { color: var(--text-0); font-weight: 600; }

.timeline-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.timeline-note {
  background: var(--bg-2);
  border-left: 2px solid var(--pink);
  padding: var(--space-2) var(--space-3);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: var(--space-2);
  font-size: 13px;
  color: var(--text-1);
  white-space: pre-wrap;
}

/* Comment form */
.comment-form {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.comment-form textarea {
  min-height: 60px;
  margin-bottom: var(--space-2);
}

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

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  min-width: 280px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
  animation: slideIn 0.2s ease;
}

.toast::before {
  content: '';
  width: 4px; align-self: stretch;
  border-radius: 2px;
  background: var(--pink);
}
.toast.toast-success::before { background: var(--lime); }
.toast.toast-error::before { background: var(--danger); }
.toast.toast-info::before { background: var(--orange); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 900px) {
  .app-main { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
  }
  .sidebar-nav { flex-direction: row; overflow-x: auto; }
  .sidebar-section { display: none; }
  .ticket-detail { grid-template-columns: 1fr; }
  .content { padding: var(--space-4); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .content-title { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .content-header { flex-direction: column; align-items: stretch; }
  .content-actions { width: 100%; }
  .field-row { flex-direction: column; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }
}
/* ============================================
   Profile page
   ============================================ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
  align-items: start;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.field-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Audit list
   ============================================ */
.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 500px;
  overflow-y: auto;
}

.audit-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.audit-row:last-child { border-bottom: none; }

.audit-row-icon {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  margin-top: 6px;
  flex-shrink: 0;
}
.audit-row-icon.audit-login_success,
.audit-row-icon.audit-login_success_2fa { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.audit-row-icon.audit-login_failed,
.audit-row-icon.audit-2fa_failed,
.audit-row-icon.audit-password_change_failed { background: var(--danger); }
.audit-row-icon.audit-account_locked,
.audit-row-icon.audit-login_blocked { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.audit-row-icon.audit-totp_enabled { background: var(--lime); }
.audit-row-icon.audit-totp_disabled { background: var(--orange); }
.audit-row-icon.audit-password_changed { background: var(--pink); }
.audit-row-icon.audit-tickets_exported { background: var(--text-1); }
.audit-row-icon.audit-ticket_deleted { background: var(--danger); }

.audit-row-body { flex: 1; min-width: 0; }

.audit-row-event {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-0);
  line-height: 1.4;
}

.audit-row-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

/* Hide login-2fa by default */
#login-2fa { display: flex; }
#login-2fa.hidden { display: none; }
#login-form.hidden { display: none; }

/* User chip clickable */
.user-chip[data-action]:hover {
  background: var(--bg-3);
  border-color: var(--border-strong);
}
