/* ============================================================
   NubeTickets - Nube Platform Support Portal
   Brand: #0D2D5E (Navy) on White | Guadalajara, Jalisco
   Works Nonlinear Like You
   ============================================================ */

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

:root {
  --navy:          #0D2D5E;
  --navy-light:    #1B4F8A;
  --navy-lighter:  #2C6EBB;
  --navy-pale:     #EBF3FF;
  --accent:        #1E88E5;
  --accent-hover:  #1565C0;
  --accent-glow:   rgba(30,136,229,.4);
  --white:         #FFFFFF;
  --surface:       #F7FAFD;
  --surface-2:     #EEF4FB;
  --border:        #D4E2F1;
  --border-light:  #E8F0FA;
  --text-primary:  #0A1929;
  --text-secondary:#4A6080;
  --text-muted:    #7A9BB8;

  --green:         #10B981;
  --green-pale:    #D1FAE5;
  --amber:         #F59E0B;
  --amber-pale:    #FEF3C7;
  --red:           #EF4444;
  --red-pale:      #FEE2E2;
  --purple:        #8B5CF6;
  --purple-pale:   #EDE9FE;
  --blue:          #3B82F6;
  --blue-pale:     #DBEAFE;
  --gray:          #6B7280;
  --gray-pale:     #F3F4F6;

  --radius:        10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Refined multi-layer shadows for depth */
  --shadow-sm:     0 1px 2px rgba(13,45,94,.04), 0 1px 3px rgba(13,45,94,.06);
  --shadow:        0 2px 8px rgba(13,45,94,.06), 0 4px 16px rgba(13,45,94,.08);
  --shadow-lg:     0 4px 12px rgba(13,45,94,.08), 0 12px 32px rgba(13,45,94,.12);
  --shadow-xl:     0 8px 24px rgba(13,45,94,.12), 0 24px 56px rgba(13,45,94,.16);
  --shadow-glow:   0 0 0 1px rgba(30,136,229,.1), 0 8px 24px rgba(30,136,229,.18);

  --transition:    0.22s cubic-bezier(0.4,0,0.2,1);
  --ease-out:      cubic-bezier(0.16,1,0.3,1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--white);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1,h2,h3,h4,h5,h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -.01em;
}
h1 { font-size: 1.875rem; letter-spacing: -.02em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

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

p { color: var(--text-secondary); }

/* ============================================================
   GLOBAL ANIMATIONS — subtle vector flows
   ============================================================ */
@keyframes fadeIn   { from { opacity:0 } to { opacity:1 } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(8px) } to { opacity:1; transform:translateY(0) } }
@keyframes slideIn  { from { opacity:0; transform:translateX(-8px) } to { opacity:1; transform:translateX(0) } }
@keyframes scaleIn  { from { opacity:0; transform:scale(.96) } to { opacity:1; transform:scale(1) } }
@keyframes shimmer  { 0% { background-position:-200% 0 } 100% { background-position:200% 0 } }
@keyframes drawSvg  { from { stroke-dashoffset:300 } to { stroke-dashoffset:0 } }
@keyframes glowPulse{ 0%,100% { box-shadow:0 0 0 0 var(--accent-glow) } 50% { box-shadow:0 0 0 6px transparent } }
@keyframes rotate   { to { transform:rotate(360deg) } }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #0A1F44 0%, var(--navy) 35%, var(--navy-light) 70%, #2C6EBB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem;
}
.auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 15% 30%, rgba(30,136,229,.22) 0%, transparent 60%),
    radial-gradient(ellipse 55% 40% at 85% 70%, rgba(44,110,187,.18) 0%, transparent 60%);
  animation: meshPulse 10s ease-in-out infinite alternate;
}
@keyframes meshPulse {
  0%   { opacity: .6; transform: scale(1); }
  100% { opacity: 1;  transform: scale(1.04); }
}

/* SVG grid pattern overlay — futuristic touch */
.auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M40 0H0v40' stroke='rgba(255,255,255,.03)' fill='none' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
}

.particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.particle {
  position: absolute;
  width: 3px; height: 3px;
  background: rgba(255,255,255,.3);
  border-radius: 50%;
  animation: floatUp linear infinite;
  box-shadow: 0 0 8px rgba(255,255,255,.5);
}
.particle:nth-child(1)  { left:8%;  animation-duration:14s; animation-delay:0s;    }
.particle:nth-child(2)  { left:22%; animation-duration:18s; animation-delay:2s;    width:4px; height:4px; }
.particle:nth-child(3)  { left:35%; animation-duration:11s; animation-delay:1s;    }
.particle:nth-child(4)  { left:50%; animation-duration:16s; animation-delay:3s;    width:5px; height:5px; }
.particle:nth-child(5)  { left:65%; animation-duration:13s; animation-delay:.5s;   }
.particle:nth-child(6)  { left:78%; animation-duration:19s; animation-delay:4s;    }
.particle:nth-child(7)  { left:88%; animation-duration:12s; animation-delay:1.5s;  width:4px; height:4px; }
.particle:nth-child(8)  { left:95%; animation-duration:15s; animation-delay:2.5s;  }
@keyframes floatUp {
  0%   { transform: translateY(110vh) scale(1);   opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .4; }
  100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

.geo-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.07);
  animation: rotate linear infinite;
  pointer-events: none;
}
.geo-circle.c1 { width:420px; height:420px; top:-110px; right:-80px; animation-duration:70s; }
.geo-circle.c2 { width:260px; height:260px; bottom:-60px; left:-60px; animation-duration:50s; animation-direction:reverse; border-color: rgba(255,255,255,.04); }
.geo-circle.c3 { width:180px; height:180px; top:30%; left:8%;   animation-duration:40s; border-style:dashed; border-color: rgba(255,255,255,.05); }

.auth-card {
  position: relative;
  z-index: 10;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,.15);
  animation: scaleIn .5s var(--ease-out) both;
}

.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.75rem; }
.auth-logo img { height: 52px; width: auto; margin-bottom: .65rem; }
.auth-logo .slogan {
  font-size: .72rem; font-weight: 500; color: var(--text-muted);
  letter-spacing: .12em; text-transform: uppercase;
}
.auth-title {
  font-size: 1.45rem; font-weight: 700;
  color: var(--navy); text-align: center; margin-bottom: .3rem; letter-spacing: -.01em;
}
.auth-subtitle {
  font-size: .85rem; color: var(--text-secondary);
  text-align: center; margin-bottom: 1.5rem;
}

/* ============================================================
   FORMS — more compact, refined
   ============================================================ */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .35rem;
  letter-spacing: .005em;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: .6rem .85rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: all var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px rgba(30,136,229,.13), 0 1px 2px rgba(30,136,229,.06);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%234A6080' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}
.form-hint { font-size: .74rem; color: var(--text-muted); margin-top: .25rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .85rem; }
@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.35rem;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  letter-spacing: .005em;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(13,45,94,.18), 0 4px 16px rgba(13,45,94,.22);
}
.btn-primary:hover { box-shadow: 0 4px 12px rgba(13,45,94,.25), 0 8px 24px rgba(13,45,94,.3); color: var(--white); transform: translateY(-1px); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #1565C0 100%);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(30,136,229,.18), 0 4px 16px rgba(30,136,229,.22);
}
.btn-accent:hover { color: var(--white); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,136,229,.25), 0 8px 24px rgba(30,136,229,.3); }

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--navy-pale); color: var(--navy); }

.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface); color: var(--navy); }

.btn-danger { background: var(--red); color: white; box-shadow: 0 2px 6px rgba(239,68,68,.2); }
.btn-danger:hover { background: #dc2626; color: white; transform: translateY(-1px); }

.btn-success { background: var(--green); color: white; box-shadow: 0 2px 6px rgba(16,185,129,.2); }
.btn-success:hover { background: #059669; color: white; transform: translateY(-1px); }

.btn-sm { padding: .38rem .85rem; font-size: .8rem; gap: .35rem; }
.btn-lg { padding: .8rem 1.85rem; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { padding: .45rem; border-radius: 8px; }

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .85rem 1.05rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  margin-bottom: 1.1rem;
  animation: fadeUp .3s var(--ease-out) both;
}
.alert-success { background: var(--green-pale); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error   { background: var(--red-pale);   color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: var(--blue-pale);  color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: var(--amber-pale); color: #92400E; border: 1px solid #FDE68A; }
.alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

/* ============================================================
   MAIN SHELL - Sidebar + Content
   ============================================================ */
.shell { display: flex; min-height: 100vh; }

/* Sidebar — modernized with subtle gradient & SVG accent */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0A2247 0%, var(--navy) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M30 0H0v30' stroke='rgba(255,255,255,.025)' fill='none' stroke-width='1'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}
.sidebar > * { position: relative; z-index: 1; }

.sidebar-brand {
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand img {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}
.sidebar-slogan {
  font-size: .62rem;
  color: rgba(255,255,255,.4);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: .35rem;
  font-weight: 500;
}

.sidebar-section { padding: 1rem 0 .35rem; }
.sidebar-section-label {
  font-size: .66rem;
  font-weight: 700;
  color: rgba(255,255,255,.38);
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 0 1.25rem .5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 1rem;
  color: rgba(255,255,255,.7);
  font-size: .87rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  position: relative;
  margin: .12rem .75rem;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .85; }
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: white;
  text-decoration: none;
}
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  background: linear-gradient(135deg, rgba(30,136,229,.18) 0%, rgba(255,255,255,.05) 100%);
  color: white;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(30,136,229,.18);
}
.nav-item.active svg { opacity: 1; color: #67B0FF; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), #67B0FF);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(103,176,255,.6);
}

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  padding: .08rem .42rem;
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding: .85rem .75rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem .7rem;
  border-radius: var(--radius);
  transition: background var(--transition);
  text-decoration: none;
}
.sidebar-user:hover { background: rgba(255,255,255,.07); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #67B0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(30,136,229,.3);
}
.sidebar-user .user-info .name { font-size: .82rem; font-weight: 600; color: white; display: block; }
.sidebar-user .user-info .role { font-size: .68rem; color: rgba(255,255,255,.5); }

/* Main content area */
.main {
  margin-left: 248px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--white) 0%, #FAFCFE 100%);
}

/* Top bar */
.topbar {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  padding: .85rem 1.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.breadcrumb { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb .sep { opacity: .5; }

.topbar-right { display: flex; align-items: center; gap: .65rem; }

/* Notification bell */
.notif-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.notif-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-pale); transform: scale(1.05); }
.notif-dot {
  position: absolute;
  top: -2px; right: -2px;
  width: 18px; height: 18px;
  background: var(--red);
  color: white;
  font-size: .64rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + .65rem);
  right: 0;
  width: 360px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  overflow: hidden;
  animation: fadeUp .22s var(--ease-out) both;
}
.notif-dropdown.open { display: block; }
.notif-header {
  padding: .9rem 1.15rem .65rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notif-header h4 { font-size: .88rem; color: var(--navy); }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: .85rem 1.15rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--surface); }
.notif-item.unread { background: var(--navy-pale); position: relative; }
.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
.notif-item .notif-title { font-size: .84rem; font-weight: 600; color: var(--navy); margin-bottom: .18rem; }
.notif-item .notif-msg   { font-size: .76rem; color: var(--text-secondary); }
.notif-item .notif-time  { font-size: .7rem;  color: var(--text-muted); margin-top: .22rem; }
.notif-empty { padding: 2rem; text-align: center; color: var(--text-muted); font-size: .85rem; }

/* Page content */
.page {
  padding: 1.75rem;
  flex: 1;
  animation: fadeIn .25s ease both;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .85rem;
}
.page-header h1 { font-size: 1.4rem; color: var(--navy); }

/* ============================================================
   CARDS — refined depth, futuristic edges
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-header {
  padding: 1.05rem 1.4rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: .98rem; font-weight: 700; color: var(--navy); letter-spacing: -.005em; }
.card-body { padding: 1.35rem 1.4rem; }

/* Stats cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-out);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }
.stat-card:hover::after  { transform: scaleX(1); }

.stat-card.blue::after   { background: linear-gradient(90deg, var(--blue), #60A5FA); }
.stat-card.green::after  { background: linear-gradient(90deg, var(--green), #34D399); }
.stat-card.amber::after  { background: linear-gradient(90deg, var(--amber), #FBBF24); }
.stat-card.red::after    { background: linear-gradient(90deg, var(--red), #F87171); }
.stat-card.purple::after { background: linear-gradient(90deg, var(--purple), #A78BFA); }

.stat-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .2rem;
}
.stat-icon.navy   { background: var(--navy-pale);   color: var(--navy); }
.stat-icon.blue   { background: var(--blue-pale);   color: var(--blue); }
.stat-icon.green  { background: var(--green-pale);  color: var(--green); }
.stat-icon.amber  { background: var(--amber-pale);  color: var(--amber); }
.stat-icon.red    { background: var(--red-pale);    color: var(--red); }
.stat-icon.purple { background: var(--purple-pale); color: var(--purple); }

.stat-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -.02em;
}
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-light); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  padding: .8rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
tbody td {
  padding: .8rem 1rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--surface); }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  padding: .22rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-gray   { background: var(--gray-pale);   color: var(--gray); }
.badge-blue   { background: var(--blue-pale);   color: #1D4ED8; }
.badge-purple { background: var(--purple-pale); color: #6D28D9; }
.badge-green  { background: var(--green-pale);  color: #065F46; }
.badge-navy   { background: var(--navy-pale);   color: var(--navy); }
.badge-amber  { background: var(--amber-pale);  color: #92400E; }
.badge-red    { background: var(--red-pale);    color: #991B1B; }

.badge-critical {
  background: var(--purple-pale);
  color: #6D28D9;
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge {
  0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,.35); }
  50%      { box-shadow: 0 0 0 4px rgba(139,92,246,0); }
}

/* ============================================================
   TICKET STATUS TIMELINE
   ============================================================ */
.status-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 1.5rem 1.25rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--border-light);
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 88px;
}
.timeline-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.timeline-step.done:not(:last-child)::after { background: var(--green); }
.timeline-step.active:not(:last-child)::after {
  background: linear-gradient(90deg, var(--accent) 0%, var(--border) 100%);
}

.step-circle {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: all .4s var(--ease-out);
}
.step-circle svg { width: 15px; height: 15px; }

.timeline-step.done .step-circle {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
.timeline-step.active .step-circle {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  animation: stepPulse 2.5s ease-in-out infinite;
}
@keyframes stepPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(30,136,229,.45); }
  50%      { box-shadow: 0 0 0 10px rgba(30,136,229,0); }
}

.step-label {
  margin-top: .55rem;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}
.timeline-step.done .step-label  { color: var(--green); }
.timeline-step.active .step-label { color: var(--accent); }

/* ============================================================
   TICKET CARD
   ============================================================ */
.ticket-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.35rem;
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
  margin-bottom: .65rem;
}
.ticket-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateX(2px);
  text-decoration: none;
}
.ticket-card-body { flex: 1; min-width: 0; }
.ticket-card-number { font-size: .72rem; font-weight: 700; color: var(--text-muted); margin-bottom: .22rem; letter-spacing: .02em; }
.ticket-card-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticket-card-meta {
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
  font-size: .76rem;
  color: var(--text-muted);
}
.ticket-card-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .45rem;
  flex-shrink: 0;
}

/* Priority bar */
.priority-bar {
  width: 4px;
  border-radius: 999px;
  align-self: stretch;
  flex-shrink: 0;
}
.priority-bar.low      { background: var(--green); }
.priority-bar.medium   { background: var(--amber); }
.priority-bar.high     { background: var(--red); }
.priority-bar.critical { background: var(--purple); animation: pulseBadge 2s infinite; }

/* ============================================================
   COMMENT THREAD
   ============================================================ */
.comment-thread { display: flex; flex-direction: column; gap: .85rem; }
.comment { display: flex; gap: .75rem; }
.comment-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #67B0FF);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(30,136,229,.25);
}
.comment-avatar.agent {
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  box-shadow: 0 2px 6px rgba(13,45,94,.25);
}
.comment-bubble {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  padding: .8rem 1rem;
  font-size: .88rem;
}
.comment-bubble.internal {
  background: #FFFBEB;
  border-color: #FDE68A;
}
.comment-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .35rem;
  flex-wrap: wrap;
}
.comment-author { font-size: .8rem; font-weight: 700; color: var(--navy); }
.comment-time   { font-size: .7rem; color: var(--text-muted); }
.comment-content { color: var(--text-secondary); white-space: pre-wrap; line-height: 1.55; }

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: .85rem 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  flex-wrap: wrap;
}
.filters-bar .form-input,
.filters-bar .form-select {
  padding: .45rem .8rem;
  font-size: .84rem;
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: 1.1rem 0 .25rem;
}
.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-pale); }
.pagination .current { background: var(--navy); color: white; border-color: var(--navy); }

/* ============================================================
   PERFORMANCE BAR
   ============================================================ */
.perf-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  min-width: 80px;
}
.perf-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--navy));
  border-radius: 999px;
  transition: width .8s var(--ease-out);
}

/* ============================================================
   MOBILE SIDEBAR
   ============================================================ */
.sidebar-toggle {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--navy);
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
    backdrop-filter: blur(3px);
  }
  .sidebar-overlay.open { display: block; }
}
@media (max-width: 640px) {
  .page { padding: 1.1rem; }
  .topbar { padding: .75rem 1.1rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .status-timeline { padding: 1rem .6rem; }
}

/* ============================================================
   HERO SECTION TAG (Auth)
   ============================================================ */
.brand-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .28rem .7rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: rgba(255,255,255,.9);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.brand-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: pulseDot 2s infinite;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-navy    { color: var(--navy); }
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: .85rem; }
.text-xs      { font-size: .72rem; }
.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 1.25rem 0;
}

.empty-state { text-align: center; padding: 3rem 1.75rem; }
.empty-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--text-muted);
}
.empty-state h3 { font-size: .98rem; color: var(--text-secondary); margin-bottom: .4rem; }
.empty-state p  { font-size: .84rem; color: var(--text-muted); max-width: 320px; margin: 0 auto 1.25rem; }

/* Animated gradient line */
.gradient-line {
  height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--accent), var(--navy-lighter), var(--accent), var(--navy));
  background-size: 300% auto;
  animation: gradientShift 4s linear infinite;
}
@keyframes gradientShift {
  to { background-position: 300% center; }
}

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: rotate .7s linear infinite;
  display: inline-block;
}
.spinner.dark {
  border-color: var(--border);
  border-top-color: var(--navy);
}

/* Tooltip */
[data-tooltip] { position: relative; cursor: default; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: white;
  font-size: .7rem;
  font-weight: 500;
  padding: .28rem .6rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 999;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   FORM CONTAINER ANIMATION
   ============================================================ */
.form-card-anim { animation: fadeUp .35s var(--ease-out) both; }
.field-anim { animation: fadeUp .3s var(--ease-out) both; }
.field-anim:nth-child(1) { animation-delay: .04s; }
.field-anim:nth-child(2) { animation-delay: .08s; }
.field-anim:nth-child(3) { animation-delay: .12s; }
.field-anim:nth-child(4) { animation-delay: .16s; }
.field-anim:nth-child(5) { animation-delay: .20s; }
.field-anim:nth-child(6) { animation-delay: .24s; }
.field-anim:nth-child(7) { animation-delay: .28s; }

/* ============================================================
   COMPACT VARIANTS — forms that don't need scrolling
   ============================================================ */
.page-compact { padding: 1.25rem 1.75rem; }
.card-compact .card-header { padding: .85rem 1.25rem; }
.card-compact .card-body { padding: 1.1rem 1.25rem; }
.form-group-compact { margin-bottom: .8rem; }
.form-row-compact { gap: .75rem; margin-bottom: .8rem; }

/* Sticky form actions on small forms */
.form-actions-sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--white) 70%, rgba(255,255,255,0));
  padding-top: 1rem;
  margin-top: .5rem;
  z-index: 5;
}

/* ============================================================
   TICKET DETAIL GRID — responsive (no horizontal scroll)
   Main column + side column that collapses on tablet/mobile.
   ============================================================ */
.ticket-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 980px) {
  .ticket-detail-grid { grid-template-columns: 1fr; }
}

/* Attachment list row */
.attach-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--border-light);
}
.attach-row:last-child { border-bottom: none; }
.attach-ico {
  width: 34px; height: 34px;
  background: var(--navy-pale);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--navy);
}
.attach-name {
  font-size: .83rem; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-meta { font-size: .72rem; color: var(--text-muted); margin-top: .1rem; }
.attach-dl {
  flex-shrink: 0; display: flex; align-items: center; gap: .3rem;
  font-size: .76rem; font-weight: 600; color: var(--accent);
  padding: .3rem .6rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border-light);
}
.attach-dl:hover { background: var(--navy-pale); }

/* Comment attachment chip */
.comment-attach {
  display: inline-flex; align-items: center; gap: .35rem;
  margin-top: .5rem; padding: .3rem .6rem;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 8px; font-size: .76rem; font-weight: 600; color: var(--accent);
}
