:root {
  --sidebar-bg: #121524;
  --sidebar-width: 240px;
  --topbar-bg: #121524;
  --topbar-height: 54px;
  --accent: #2196f3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f8;
  font-size: 0.875rem;
}

/* LAYOUT */
.wrapper {
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  min-height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
}

.sidebar-nav li a.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.84rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.sidebar-nav li a.nav-link:hover,
.sidebar-nav li a.nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border-left-color: var(--accent);
}

.nav-section {
  padding: 0.75rem 1.25rem 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* TOPBAR */
.topbar {
  background: var(--topbar-bg);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-title {
  font-size: 0.95rem;
}

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

/* CONTENT AREA */
.content-area {
  padding: 1.25rem;
  flex: 1;
}

/* STAT CARDS */
.stat-card {
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -20px; right: -20px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.stat-icon { font-size: 1.4rem; margin-bottom: 0.4rem; opacity: 0.85; }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.72rem; opacity: 0.85; margin-top: 0.2rem; }

.stat-orange  { background: linear-gradient(135deg, #f7971e, #ffd200); }
.stat-blue    { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.stat-purple  { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-gray    { background: linear-gradient(135deg, #757f9a, #d7dde8); }

/* CARDS */
.card {
  border: none;
  border-radius: 10px;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #e9ecef;
  padding: 0.8rem 1rem;
}

/* TABLES */
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; }
.table td { vertical-align: middle; }

/* COMENTARIOS DE TICKET */
.comment-item { padding: 1rem 1.25rem; border-bottom: 1px solid #eef0f5; }
.comment-item:last-child { border-bottom: none; }
.comment-attachment {
  height: 96px;
  width: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

/* BADGE PURPURA (estado "escalado", sin equivalente nativo en Bootstrap) */
.bg-purple { background-color: #764ba2 !important; }

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* MOBILE */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
}

/* SIDEBAR TOGGLE */
.sidebar-toggle {
  padding: 0.25rem 0.5rem;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}
.main-content.expanded {
  margin-left: 0;
  transition: margin-left 0.25s ease;
}

/* SCROLLBAR */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* LOGIN */
.login-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #121524 0%, #1a2140 45%, #1f5fa8 100%);
}
.login-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(33, 150, 243, 0.1);
  color: var(--accent);
}
