/* Parla BT — Firebase Ticket V2 Support Portal */
/* Sidebar layout · no external CSS dependencies (Font Awesome in HTML only) */

/* ─── Design tokens ─────────────────────────────────────────────────────── */
:root {
  /* Brand */
  --sv2-navy: #1a2332;
  --sv2-navy-mid: #243044;
  --sv2-navy-light: #2d3d56;
  --sv2-navy-muted: #3d5068;
  --sv2-accent: #2563eb;
  --sv2-accent-hover: #1d4ed8;
  --sv2-accent-soft: #eff6ff;
  --sv2-accent-muted: #93c5fd;

  /* Semantic */
  --sv2-success: #059669;
  --sv2-success-soft: #d1fae5;
  --sv2-warning: #d97706;
  --sv2-warning-soft: #fef3c7;
  --sv2-danger: #dc2626;
  --sv2-danger-soft: #fee2e2;
  --sv2-info: #0284c7;
  --sv2-info-soft: #e0f2fe;

  /* Neutrals */
  --sv2-white: #ffffff;
  --sv2-gray-50: #f8fafc;
  --sv2-gray-100: #f1f5f9;
  --sv2-gray-200: #e2e8f0;
  --sv2-gray-300: #cbd5e1;
  --sv2-gray-400: #94a3b8;
  --sv2-gray-500: #64748b;
  --sv2-gray-600: #475569;
  --sv2-gray-700: #334155;
  --sv2-gray-800: #1e293b;
  --sv2-gray-900: #0f172a;

  /* Layout */
  --sv2-sidebar-width: 260px;
  --sv2-sidebar-collapsed: 72px;
  --sv2-topbar-height: 60px;
  --sv2-radius-sm: 6px;
  --sv2-radius: 10px;
  --sv2-radius-lg: 14px;
  --sv2-radius-full: 9999px;

  /* Shadows */
  --sv2-shadow-xs: 0 1px 2px rgba(26, 35, 50, 0.04);
  --sv2-shadow-sm: 0 2px 8px rgba(26, 35, 50, 0.06);
  --sv2-shadow: 0 4px 24px rgba(26, 35, 50, 0.08);
  --sv2-shadow-md: 0 8px 32px rgba(26, 35, 50, 0.1);
  --sv2-shadow-lg: 0 16px 48px rgba(26, 35, 50, 0.14);
  --sv2-shadow-sidebar: 4px 0 24px rgba(0, 0, 0, 0.12);

  /* Typography */
  --sv2-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --sv2-font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;

  /* Transitions */
  --sv2-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --sv2-duration: 0.2s;
  --sv2-duration-slow: 0.3s;

  /* Z-index scale */
  --sv2-z-sidebar: 200;
  --sv2-z-overlay: 250;
  --sv2-z-topbar: 100;
  --sv2-z-modal: 1000;
  --sv2-z-loading: 2000;
  --sv2-z-toast: 3000;
}

/* ─── Base / reset ──────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.sv2-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sv2-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--sv2-gray-800);
  background: var(--sv2-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sv2-body img {
  max-width: 100%;
  height: auto;
}

/* ─── App shell ─────────────────────────────────────────────────────────── */
.sv2-app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────── */
.sv2-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sv2-sidebar-width);
  background: var(--sv2-navy);
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  flex-direction: column;
  z-index: var(--sv2-z-sidebar);
  box-shadow: var(--sv2-shadow-sidebar);
  transition: width var(--sv2-duration-slow) var(--sv2-ease),
              transform var(--sv2-duration-slow) var(--sv2-ease);
  overflow: hidden;
}

.sv2-sidebar.collapsed {
  width: var(--sv2-sidebar-collapsed);
}

.sv2-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: var(--sv2-topbar-height);
  flex-shrink: 0;
}

.sv2-sidebar-brand img,
.sv2-sidebar-brand .sv2-brand-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  border-radius: var(--sv2-radius-sm);
}

.sv2-sidebar-brand .sv2-brand-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sv2-white);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--sv2-duration) var(--sv2-ease);
}

.sv2-sidebar.collapsed .sv2-brand-text,
.sv2-sidebar.collapsed .sv2-nav-item span,
.sv2-sidebar.collapsed .sv2-nav-section-label,
.sv2-sidebar.collapsed .sv2-sidebar-footer .sv2-user-info {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.sv2-sidebar.collapsed .sv2-nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.sv2-sidebar.collapsed .sv2-nav-item i {
  margin: 0;
  font-size: 1.15rem;
}

.sv2-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.75rem 0.625rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.sv2-nav::-webkit-scrollbar {
  width: 4px;
}

.sv2-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--sv2-radius-full);
}

.sv2-nav-section-label {
  display: block;
  padding: 0.75rem 0.75rem 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  transition: opacity var(--sv2-duration) var(--sv2-ease);
}

.sv2-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  margin-bottom: 2px;
  border-radius: var(--sv2-radius-sm);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  text-align: left;
  transition: background var(--sv2-duration) var(--sv2-ease),
              color var(--sv2-duration) var(--sv2-ease);
  white-space: nowrap;
}

.sv2-nav-item i {
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  font-size: 1rem;
  opacity: 0.85;
}

.sv2-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sv2-white);
}

.sv2-nav-item.active {
  background: var(--sv2-accent);
  color: var(--sv2-white);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.sv2-nav-item.active i {
  opacity: 1;
}

.sv2-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sv2-sidebar-footer .sv2-user-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sv2-sidebar-footer .sv2-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--sv2-radius-full);
  background: var(--sv2-navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sv2-white);
  flex-shrink: 0;
}

.sv2-sidebar-footer .sv2-user-info {
  overflow: hidden;
  transition: opacity var(--sv2-duration) var(--sv2-ease);
}

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

.sv2-sidebar-footer .sv2-user-email {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sv2-sidebar-footer .sv2-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--sv2-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--sv2-duration) var(--sv2-ease),
              color var(--sv2-duration) var(--sv2-ease);
}

.sv2-sidebar-footer .sv2-logout-btn:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
  color: #fca5a5;
}

.sv2-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: calc(var(--sv2-z-sidebar) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sv2-duration-slow) var(--sv2-ease),
              visibility var(--sv2-duration-slow) var(--sv2-ease);
  backdrop-filter: blur(2px);
}

.sv2-sidebar-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ─── Main content area ─────────────────────────────────────────────────── */
.sv2-main {
  flex: 1;
  margin-left: var(--sv2-sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--sv2-duration-slow) var(--sv2-ease);
}

.sv2-sidebar.collapsed ~ .sv2-main,
.sv2-app.sidebar-collapsed .sv2-main {
  margin-left: var(--sv2-sidebar-collapsed);
}

.sv2-topbar {
  position: sticky;
  top: 0;
  z-index: var(--sv2-z-topbar);
  height: var(--sv2-topbar-height);
  background: var(--sv2-white);
  border-bottom: 1px solid var(--sv2-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  box-shadow: var(--sv2-shadow-xs);
}

.sv2-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.sv2-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sv2-topbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  background: var(--sv2-white);
  color: var(--sv2-gray-600);
  cursor: pointer;
  font-size: 1rem;
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-topbar-toggle:hover {
  background: var(--sv2-gray-100);
}

.sv2-topbar-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sv2-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sv2-content {
  flex: 1;
  padding: 1.5rem;
}

/* ─── Auth pages ────────────────────────────────────────────────────────── */
.sv2-auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.sv2-auth-brand {
  background: linear-gradient(
    145deg,
    var(--sv2-navy) 0%,
    var(--sv2-navy-mid) 45%,
    var(--sv2-navy-light) 100%
  );
  color: var(--sv2-white);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.sv2-auth-brand::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.sv2-auth-brand h1 {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.25;
  position: relative;
}

.sv2-auth-brand p {
  opacity: 0.85;
  line-height: 1.65;
  max-width: 420px;
  margin: 0;
  position: relative;
}

.sv2-auth-brand ul {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.sv2-auth-brand li {
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9375rem;
}

.sv2-auth-brand li i {
  color: var(--sv2-accent-muted);
  width: 1.25rem;
  text-align: center;
}

.sv2-auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--sv2-gray-50);
}

.sv2-card {
  background: var(--sv2-white);
  border-radius: var(--sv2-radius-lg);
  box-shadow: var(--sv2-shadow-md);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--sv2-gray-100);
}

.sv2-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sv2-navy);
}

.sv2-card .sv2-subtitle {
  color: var(--sv2-gray-500);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.sv2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--sv2-radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--sv2-duration) var(--sv2-ease),
              border-color var(--sv2-duration) var(--sv2-ease),
              color var(--sv2-duration) var(--sv2-ease),
              box-shadow var(--sv2-duration) var(--sv2-ease),
              transform 0.1s var(--sv2-ease);
}

.sv2-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.sv2-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sv2-btn-primary {
  background: var(--sv2-accent);
  color: var(--sv2-white);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.sv2-btn-primary:hover:not(:disabled) {
  background: var(--sv2-accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.sv2-btn-secondary {
  background: var(--sv2-gray-100);
  color: var(--sv2-gray-800);
  border-color: var(--sv2-gray-200);
}

.sv2-btn-secondary:hover:not(:disabled) {
  background: var(--sv2-gray-200);
}

.sv2-btn-outline {
  background: transparent;
  color: var(--sv2-accent);
  border-color: var(--sv2-accent);
}

.sv2-btn-outline:hover:not(:disabled) {
  background: var(--sv2-accent-soft);
}

.sv2-btn-danger {
  background: var(--sv2-danger);
  color: var(--sv2-white);
}

.sv2-btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.sv2-btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
}

.sv2-btn-icon {
  padding: 0.5rem;
  width: 36px;
  height: 36px;
}

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.sv2-form-group {
  margin-bottom: 1rem;
}

.sv2-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--sv2-gray-700);
}

.sv2-form-group input,
.sv2-form-group select,
.sv2-form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--sv2-gray-800);
  background: var(--sv2-white);
  transition: border-color var(--sv2-duration) var(--sv2-ease),
              box-shadow var(--sv2-duration) var(--sv2-ease);
}

.sv2-form-group input::placeholder,
.sv2-form-group textarea::placeholder {
  color: var(--sv2-gray-400);
}

.sv2-form-group input:focus,
.sv2-form-group select:focus,
.sv2-form-group textarea:focus {
  outline: none;
  border-color: var(--sv2-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sv2-form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.sv2-form-group.has-error input,
.sv2-form-group.has-error select,
.sv2-form-group.has-error textarea,
.has-error .sv2-form-group input,
.has-error .sv2-form-group select,
.has-error .sv2-form-group textarea {
  border-color: var(--sv2-danger);
}

.sv2-form-group.has-error input:focus,
.sv2-form-group.has-error select:focus,
.sv2-form-group.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.sv2-field-error {
  font-size: 0.8125rem;
  color: var(--sv2-danger);
  margin-top: 0.25rem;
}

.sv2-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.sv2-toggle-password {
  position: relative;
}

.sv2-toggle-password input {
  padding-right: 2.75rem;
}

.sv2-toggle-password button {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--sv2-gray-400);
  cursor: pointer;
  padding: 0.375rem;
  font-size: 0.9375rem;
  line-height: 1;
}

.sv2-toggle-password button:hover {
  color: var(--sv2-gray-600);
}

/* ─── Stats grid ──────────────────────────────────────────────────────────── */
.sv2-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sv2-stat-card {
  background: var(--sv2-white);
  border-radius: var(--sv2-radius);
  padding: 1.25rem 1.375rem;
  box-shadow: var(--sv2-shadow-sm);
  border: 1px solid var(--sv2-gray-100);
  border-left: 4px solid var(--sv2-accent);
  transition: box-shadow var(--sv2-duration) var(--sv2-ease);
}

.sv2-stat-card:hover {
  box-shadow: var(--sv2-shadow);
}

.sv2-stat-card.open {
  border-left-color: #3b82f6;
}

.sv2-stat-card.in_progress {
  border-left-color: var(--sv2-warning);
}

.sv2-stat-card.waiting {
  border-left-color: #a855f7;
}

.sv2-stat-card.resolved,
.sv2-stat-card.success {
  border-left-color: var(--sv2-success);
}

.sv2-stat-card.critical,
.sv2-stat-card.danger {
  border-left-color: var(--sv2-danger);
}

.sv2-stat-card .sv2-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--sv2-navy);
  line-height: 1.2;
}

.sv2-stat-card .sv2-stat-label {
  font-size: 0.8125rem;
  color: var(--sv2-gray-500);
  margin-top: 0.25rem;
  font-weight: 500;
}

.sv2-stat-card .sv2-stat-icon {
  float: right;
  font-size: 1.25rem;
  color: var(--sv2-gray-300);
}

/* ─── Sections ────────────────────────────────────────────────────────────── */
.sv2-section {
  background: var(--sv2-white);
  border-radius: var(--sv2-radius);
  box-shadow: var(--sv2-shadow-sm);
  border: 1px solid var(--sv2-gray-100);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.sv2-section-header {
  padding: 1rem 1.375rem;
  border-bottom: 1px solid var(--sv2-gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: var(--sv2-white);
}

.sv2-section-header h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--sv2-navy);
}

.sv2-section-body {
  padding: 1.25rem 1.375rem;
}

/* ─── Tables ──────────────────────────────────────────────────────────────── */
.sv2-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.sv2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.sv2-table th,
.sv2-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--sv2-gray-100);
  vertical-align: middle;
}

.sv2-table th {
  background: var(--sv2-gray-50);
  font-weight: 600;
  color: var(--sv2-gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sv2-table tbody tr {
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-table tbody tr:hover {
  background: var(--sv2-accent-soft);
}

.sv2-table tbody tr:last-child td {
  border-bottom: none;
}

.sv2-table a {
  color: var(--sv2-accent);
  text-decoration: none;
  font-weight: 500;
}

.sv2-table a:hover {
  text-decoration: underline;
}

/* ─── Badges — status ─────────────────────────────────────────────────────── */
.sv2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--sv2-radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.4;
  white-space: nowrap;
}

.sv2-badge-open {
  background: #dbeafe;
  color: #1d4ed8;
}

.sv2-badge-in_progress {
  background: var(--sv2-warning-soft);
  color: #b45309;
}

.sv2-badge-waiting_customer {
  background: #fce7f3;
  color: #9d174d;
}

.sv2-badge-resolved {
  background: var(--sv2-success-soft);
  color: #047857;
}

.sv2-badge-closed {
  background: var(--sv2-gray-200);
  color: var(--sv2-gray-700);
}

/* Priority badges */
.sv2-badge-priority-low {
  background: var(--sv2-gray-100);
  color: var(--sv2-gray-600);
}

.sv2-badge-priority-medium {
  background: var(--sv2-accent-soft);
  color: var(--sv2-accent-hover);
}

.sv2-badge-priority-high {
  background: var(--sv2-warning-soft);
  color: #b45309;
}

.sv2-badge-priority-critical {
  background: var(--sv2-danger-soft);
  color: var(--sv2-danger);
}

/* Type badges — SUP ARZ PRJ INT DEV BUG */
.sv2-badge-type-sup {
  background: #dbeafe;
  color: #1e40af;
}

.sv2-badge-type-arz {
  background: #e0e7ff;
  color: #4338ca;
}

.sv2-badge-type-prj {
  background: #f3e8ff;
  color: #7e22ce;
}

.sv2-badge-type-int {
  background: #ccfbf1;
  color: #0f766e;
}

.sv2-badge-type-dev {
  background: #fef3c7;
  color: #92400e;
}

.sv2-badge-type-bug {
  background: var(--sv2-danger-soft);
  color: #991b1b;
}

.sv2-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--sv2-radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--sv2-navy);
  color: var(--sv2-white);
}

.sv2-role-badge.admin {
  background: var(--sv2-danger);
}

.sv2-role-badge.agent {
  background: var(--sv2-accent);
}

.sv2-role-badge.customer {
  background: var(--sv2-gray-600);
}

/* ─── Chips & filters ─────────────────────────────────────────────────────── */
.sv2-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--sv2-radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--sv2-gray-200);
  background: var(--sv2-white);
  color: var(--sv2-gray-600);
  cursor: pointer;
  transition: all var(--sv2-duration) var(--sv2-ease);
}

.sv2-chip:hover {
  border-color: var(--sv2-accent-muted);
  color: var(--sv2-accent);
}

.sv2-chip.active,
.sv2-chip.is-active {
  background: var(--sv2-accent);
  border-color: var(--sv2-accent);
  color: var(--sv2-white);
}

.sv2-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}

.sv2-filters .sv2-form-group {
  margin-bottom: 0;
  min-width: 140px;
}

.sv2-filters .sv2-form-group input,
.sv2-filters .sv2-form-group select {
  min-width: 140px;
}

.sv2-search-bar {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.sv2-search-bar i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--sv2-gray-400);
  font-size: 0.875rem;
  pointer-events: none;
}

.sv2-search-bar input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--sv2-white);
  transition: border-color var(--sv2-duration) var(--sv2-ease),
              box-shadow var(--sv2-duration) var(--sv2-ease);
}

.sv2-search-bar input:focus {
  outline: none;
  border-color: var(--sv2-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ─── Modal ───────────────────────────────────────────────────────────────── */
.sv2-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--sv2-z-modal);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sv2-duration-slow) var(--sv2-ease),
              visibility var(--sv2-duration-slow) var(--sv2-ease);
  backdrop-filter: blur(2px);
}

.sv2-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.sv2-modal {
  background: var(--sv2-white);
  border-radius: var(--sv2-radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--sv2-shadow-lg);
  transform: translateY(12px) scale(0.98);
  transition: transform var(--sv2-duration-slow) var(--sv2-ease);
}

.sv2-modal-overlay.is-open .sv2-modal {
  transform: translateY(0) scale(1);
}

.sv2-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sv2-gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sv2-modal-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sv2-navy);
}

.sv2-modal-close {
  background: none;
  border: none;
  font-size: 1.375rem;
  cursor: pointer;
  color: var(--sv2-gray-400);
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--sv2-radius-sm);
  transition: color var(--sv2-duration) var(--sv2-ease),
              background var(--sv2-duration) var(--sv2-ease);
}

.sv2-modal-close:hover {
  color: var(--sv2-gray-700);
  background: var(--sv2-gray-100);
}

.sv2-modal-body {
  padding: 1.5rem;
}

.sv2-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--sv2-gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--sv2-gray-50);
  border-radius: 0 0 var(--sv2-radius-lg) var(--sv2-radius-lg);
}

/* ─── Timeline ────────────────────────────────────────────────────────────── */
.sv2-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sv2-timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.5rem;
}

.sv2-timeline-item::before {
  content: "";
  position: absolute;
  left: 0.4375rem;
  top: 1.125rem;
  bottom: 0;
  width: 2px;
  background: var(--sv2-gray-200);
}

.sv2-timeline-item:last-child::before {
  display: none;
}

.sv2-timeline-dot {
  position: absolute;
  left: 0;
  top: 0.375rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sv2-accent);
  border: 2px solid var(--sv2-white);
  box-shadow: 0 0 0 2px var(--sv2-accent);
}

.sv2-timeline-item.admin .sv2-timeline-dot {
  background: var(--sv2-navy);
  box-shadow: 0 0 0 2px var(--sv2-navy);
}

.sv2-timeline-item.system .sv2-timeline-dot {
  background: var(--sv2-gray-400);
  box-shadow: 0 0 0 2px var(--sv2-gray-400);
}

.sv2-timeline-item.internal .sv2-timeline-dot {
  background: var(--sv2-warning);
  box-shadow: 0 0 0 2px var(--sv2-warning);
}

.sv2-timeline-bubble {
  background: var(--sv2-gray-50);
  border-radius: var(--sv2-radius);
  padding: 1rem 1.125rem;
  border: 1px solid var(--sv2-gray-100);
}

.sv2-timeline-item.admin .sv2-timeline-bubble {
  background: var(--sv2-accent-soft);
  border-color: #bfdbfe;
}

.sv2-timeline-item.internal .sv2-timeline-bubble {
  background: var(--sv2-warning-soft);
  border-color: #fde68a;
}

.sv2-timeline-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.sv2-timeline-author {
  font-weight: 600;
  color: var(--sv2-navy);
}

.sv2-timeline-time {
  color: var(--sv2-gray-500);
}

.sv2-timeline-body {
  font-size: 0.9375rem;
  color: var(--sv2-gray-700);
  line-height: 1.55;
}

/* ─── Reply box ───────────────────────────────────────────────────────────── */
.sv2-reply-box {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--sv2-gray-100);
}

.sv2-reply-box textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  resize: vertical;
  transition: border-color var(--sv2-duration) var(--sv2-ease),
              box-shadow var(--sv2-duration) var(--sv2-ease);
}

.sv2-reply-box textarea:focus {
  outline: none;
  border-color: var(--sv2-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.sv2-reply-box .sv2-reply-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

/* ─── Meta grid ───────────────────────────────────────────────────────────── */
.sv2-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.sv2-meta-grid .sv2-meta-item label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sv2-gray-500);
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.sv2-meta-grid .sv2-meta-item span,
.sv2-meta-grid .sv2-meta-item div {
  font-weight: 600;
  color: var(--sv2-navy);
  font-size: 0.9375rem;
}

/* ─── Warning card ────────────────────────────────────────────────────────── */
.sv2-warning-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--sv2-danger);
  border-radius: var(--sv2-radius);
  background: var(--sv2-danger-soft);
  margin-bottom: 1.25rem;
}

.sv2-warning-card i {
  color: var(--sv2-danger);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.sv2-warning-card .sv2-warning-title {
  font-weight: 700;
  color: #991b1b;
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
}

.sv2-warning-card .sv2-warning-text {
  margin: 0;
  font-size: 0.875rem;
  color: #7f1d1d;
  line-height: 1.5;
}

/* ─── Tabs ────────────────────────────────────────────────────────────────── */
.sv2-tabs {
  display: flex;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--sv2-gray-200);
  padding-bottom: 0;
}

.sv2-tab {
  padding: 0.625rem 1.125rem;
  border: none;
  background: none;
  border-radius: var(--sv2-radius-sm) var(--sv2-radius-sm) 0 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sv2-gray-500);
  position: relative;
  transition: color var(--sv2-duration) var(--sv2-ease);
  margin-bottom: -1px;
}

.sv2-tab:hover {
  color: var(--sv2-gray-800);
}

.sv2-tab.active {
  color: var(--sv2-accent);
  font-weight: 600;
}

.sv2-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--sv2-accent);
  border-radius: 2px 2px 0 0;
}

/* ─── Breadcrumb ──────────────────────────────────────────────────────────── */
.sv2-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--sv2-gray-500);
  margin-bottom: 1rem;
  list-style: none;
  padding: 0;
}

.sv2-breadcrumb li {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.sv2-breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--sv2-gray-300);
  margin-left: 0.375rem;
}

.sv2-breadcrumb a {
  color: var(--sv2-gray-500);
  text-decoration: none;
  transition: color var(--sv2-duration) var(--sv2-ease);
}

.sv2-breadcrumb a:hover {
  color: var(--sv2-accent);
}

.sv2-breadcrumb li:last-child {
  color: var(--sv2-navy);
  font-weight: 600;
}

/* ─── Empty state ─────────────────────────────────────────────────────────── */
.sv2-empty {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--sv2-gray-500);
}

.sv2-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.35;
  color: var(--sv2-gray-400);
}

.sv2-empty h4 {
  margin: 0 0 0.5rem;
  color: var(--sv2-navy);
  font-size: 1.0625rem;
}

.sv2-empty p {
  margin: 0;
  font-size: 0.9375rem;
  max-width: 360px;
  margin-inline: auto;
}

/* ─── Autocomplete ────────────────────────────────────────────────────────── */
.sv2-autocomplete {
  position: relative;
}

.sv2-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--sv2-white);
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  box-shadow: var(--sv2-shadow-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  list-style: none;
  padding: 0.375rem 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--sv2-duration) var(--sv2-ease),
              transform var(--sv2-duration) var(--sv2-ease),
              visibility var(--sv2-duration) var(--sv2-ease);
}

.sv2-autocomplete-list.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sv2-autocomplete-item {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--sv2-gray-700);
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-autocomplete-item:hover,
.sv2-autocomplete-item.highlighted {
  background: var(--sv2-accent-soft);
  color: var(--sv2-accent-hover);
}

.sv2-autocomplete-item .sv2-autocomplete-meta {
  font-size: 0.75rem;
  color: var(--sv2-gray-400);
  margin-top: 0.125rem;
}

.sv2-autocomplete-wrap {
  position: relative;
}

.sv2-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.625rem 0.875rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--sv2-gray-700);
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-ac-item:hover {
  background: var(--sv2-accent-soft);
  color: var(--sv2-accent-hover);
}

.sv2-ac-create {
  border-top: 1px solid var(--sv2-gray-200);
  color: var(--sv2-accent);
  font-weight: 500;
}

.sv2-ac-create i {
  margin-right: 0.375rem;
}

/* ─── Notification panel ──────────────────────────────────────────────────── */
.sv2-notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--sv2-white);
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius);
  box-shadow: var(--sv2-shadow-lg);
  overflow: hidden;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--sv2-duration-slow) var(--sv2-ease);
}

.sv2-notif-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sv2-notif-panel-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--sv2-gray-100);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--sv2-navy);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sv2-notif-panel-body {
  overflow-y: auto;
  max-height: 360px;
}

.sv2-notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--sv2-gray-50);
  cursor: pointer;
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-notif-item:hover {
  background: var(--sv2-gray-50);
}

.sv2-notif-item.unread {
  background: var(--sv2-accent-soft);
}

.sv2-notif-item.unread:hover {
  background: #dbeafe;
}

.sv2-notif-item .sv2-notif-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--sv2-radius-full);
  background: var(--sv2-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8125rem;
  color: var(--sv2-accent);
}

.sv2-notif-item .sv2-notif-text {
  font-size: 0.8125rem;
  color: var(--sv2-gray-700);
  line-height: 1.45;
}

.sv2-notif-item .sv2-notif-time {
  font-size: 0.6875rem;
  color: var(--sv2-gray-400);
  margin-top: 0.25rem;
}

/* ─── CSS-only charts (reports) ───────────────────────────────────────────── */
.sv2-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 200px;
  padding: 1rem 0 0;
}

.sv2-bar-chart .sv2-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.sv2-bar-chart .sv2-bar-fill {
  width: 100%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--sv2-accent) 0%, var(--sv2-accent-hover) 100%);
  border-radius: var(--sv2-radius-sm) var(--sv2-radius-sm) 0 0;
  min-height: 4px;
  transition: height var(--sv2-duration-slow) var(--sv2-ease);
}

.sv2-bar-chart .sv2-bar-label {
  font-size: 0.6875rem;
  color: var(--sv2-gray-500);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sv2-bar-chart .sv2-bar-value {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--sv2-navy);
}

.sv2-pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}

.sv2-pie-chart::after {
  content: "";
  position: absolute;
  inset: 28%;
  background: var(--sv2-white);
  border-radius: 50%;
}

.sv2-pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.sv2-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--sv2-gray-600);
}

.sv2-pie-legend-item .sv2-pie-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */
.sv2-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.sv2-pagination button,
.sv2-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  background: var(--sv2-white);
  color: var(--sv2-gray-600);
  font-size: 0.875rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--sv2-duration) var(--sv2-ease);
}

.sv2-pagination button:hover:not(:disabled),
.sv2-pagination a:hover {
  border-color: var(--sv2-accent);
  color: var(--sv2-accent);
  background: var(--sv2-accent-soft);
}

.sv2-pagination button.active,
.sv2-pagination a.active {
  background: var(--sv2-accent);
  border-color: var(--sv2-accent);
  color: var(--sv2-white);
}

.sv2-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */
.sv2-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--sv2-z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
  pointer-events: none;
}

.sv2-toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--sv2-radius);
  color: var(--sv2-white);
  font-size: 0.875rem;
  box-shadow: var(--sv2-shadow-md);
  animation: sv2-toast-in 0.35s var(--sv2-ease);
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sv2-toast-success {
  background: var(--sv2-success);
}

.sv2-toast-error {
  background: var(--sv2-danger);
}

.sv2-toast-warning {
  background: var(--sv2-warning);
}

.sv2-toast-info {
  background: var(--sv2-navy-mid);
}

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

/* ─── Loading ─────────────────────────────────────────────────────────────── */
.sv2-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--sv2-z-loading);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sv2-duration-slow) var(--sv2-ease),
              visibility var(--sv2-duration-slow) var(--sv2-ease);
  backdrop-filter: blur(2px);
}

.sv2-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.sv2-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--sv2-gray-200);
  border-top-color: var(--sv2-accent);
  border-radius: 50%;
  animation: sv2-spin 0.75s linear infinite;
}

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

/* ─── Links & utilities ───────────────────────────────────────────────────── */
.sv2-link {
  color: var(--sv2-accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--sv2-duration) var(--sv2-ease);
}

.sv2-link:hover {
  color: var(--sv2-accent-hover);
  text-decoration: underline;
}

.sv2-text-center {
  text-align: center;
}

.sv2-text-muted {
  color: var(--sv2-gray-500);
}

.sv2-mt-1 {
  margin-top: 1rem;
}

.sv2-mb-1 {
  margin-bottom: 1rem;
}

.sv2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Filter bar (ui-shell) ─────────────────────────────────────────────── */
.sv2-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sv2-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sv2-filter-search input {
  min-width: 220px;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
}

.sv2-chip.is-active {
  background: var(--sv2-accent);
  border-color: var(--sv2-accent);
  color: var(--sv2-white);
}

.sv2-text-danger {
  color: var(--sv2-danger);
  font-weight: 600;
}

.sv2-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.sv2-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.sv2-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sv2-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--sv2-gray-300);
  border-radius: var(--sv2-radius-full);
  transition: background var(--sv2-duration) var(--sv2-ease);
}

.sv2-switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: var(--sv2-white);
  border-radius: 50%;
  transition: transform var(--sv2-duration) var(--sv2-ease);
}

.sv2-switch input:checked + .sv2-switch-slider {
  background: var(--sv2-success);
}

.sv2-switch input:checked + .sv2-switch-slider::before {
  transform: translateX(20px);
}

.sv2-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.sv2-report-card {
  background: var(--sv2-white);
  border: 1px solid var(--sv2-gray-100);
  border-radius: var(--sv2-radius);
  box-shadow: var(--sv2-shadow-sm);
  overflow: hidden;
}

.sv2-report-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--sv2-gray-100);
}

.sv2-report-card-header h4 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--sv2-navy);
}

.sv2-report-card-body {
  padding: 1.25rem;
}

.sv2-view-toggle {
  display: inline-flex;
  border: 1px solid var(--sv2-gray-200);
  border-radius: var(--sv2-radius-sm);
  overflow: hidden;
}

.sv2-view-toggle button {
  padding: 0.5rem 0.875rem;
  border: none;
  background: var(--sv2-white);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--sv2-gray-600);
}

.sv2-view-toggle button.active {
  background: var(--sv2-accent);
  color: var(--sv2-white);
}

.sv2-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.sv2-meta-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sv2-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.sv2-meta-item span {
  font-size: 0.9375rem;
  color: var(--sv2-gray-800);
}

.sv2-color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: var(--sv2-radius-sm);
  border: 1px solid var(--sv2-gray-200);
  vertical-align: middle;
}

/* ─── Responsive: 1200px — sidebar auto-collapse friendly ─────────────────── */
@media (max-width: 1200px) {
  .sv2-stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .sv2-content {
    padding: 1.25rem;
  }
}

/* ─── Responsive: 900px — mobile drawer ───────────────────────────────────── */
@media (max-width: 900px) {
  .sv2-sidebar {
    transform: translateX(-100%);
    width: var(--sv2-sidebar-width);
  }

  .sv2-sidebar.is-open {
    transform: translateX(0);
  }

  .sv2-sidebar.collapsed {
    width: var(--sv2-sidebar-width);
    transform: translateX(-100%);
  }

  .sv2-sidebar.collapsed.is-open {
    transform: translateX(0);
  }

  .sv2-sidebar.collapsed .sv2-brand-text,
  .sv2-sidebar.collapsed .sv2-nav-item span,
  .sv2-sidebar.collapsed .sv2-nav-section-label,
  .sv2-sidebar.collapsed .sv2-sidebar-footer .sv2-user-info {
    opacity: 1;
    width: auto;
    overflow: visible;
    pointer-events: auto;
  }

  .sv2-sidebar.collapsed .sv2-nav-item {
    justify-content: flex-start;
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .sv2-sidebar-overlay {
    display: block;
  }

  .sv2-main {
    margin-left: 0 !important;
  }

  .sv2-topbar-toggle {
    display: flex;
  }

  .sv2-auth-wrap {
    grid-template-columns: 1fr;
  }

  .sv2-auth-brand {
    padding: 2rem;
    min-height: auto;
  }

  .sv2-form-row {
    grid-template-columns: 1fr;
  }

  .sv2-notif-panel {
    position: fixed;
    top: var(--sv2-topbar-height);
    left: 0;
    right: 0;
    width: 100%;
    max-height: calc(100vh - var(--sv2-topbar-height));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ─── Responsive: 600px — table cards, full modal ─────────────────────────── */
@media (max-width: 600px) {
  .sv2-content {
    padding: 1rem;
  }

  .sv2-topbar {
    padding: 0 1rem;
  }

  .sv2-topbar-title {
    font-size: 1rem;
  }

  .sv2-card {
    padding: 1.5rem;
    border-radius: var(--sv2-radius);
  }

  .sv2-section-header,
  .sv2-section-body {
    padding: 1rem;
  }

  .sv2-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .sv2-filters .sv2-form-group,
  .sv2-filters .sv2-form-group input,
  .sv2-filters .sv2-form-group select {
    min-width: 100%;
  }

  .sv2-search-bar {
    max-width: none;
  }

  /* Table → card layout */
  .sv2-table-wrap.sv2-table-responsive .sv2-table thead {
    display: none;
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table tbody tr {
    display: block;
    background: var(--sv2-white);
    border: 1px solid var(--sv2-gray-200);
    border-radius: var(--sv2-radius);
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    box-shadow: var(--sv2-shadow-xs);
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table tbody tr:hover {
    background: var(--sv2-white);
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--sv2-gray-100);
    text-align: right;
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table td:last-child {
    border-bottom: none;
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sv2-gray-500);
    text-align: left;
    flex-shrink: 0;
  }

  .sv2-table-wrap.sv2-table-responsive .sv2-table td[data-label=""]::before {
    display: none;
  }

  /* Full-screen modal */
  .sv2-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .sv2-modal {
    max-width: none;
    max-height: 95vh;
    border-radius: var(--sv2-radius-lg) var(--sv2-radius-lg) 0 0;
    margin-top: auto;
  }

  .sv2-modal-overlay.is-open .sv2-modal {
    transform: translateY(0);
  }

  .sv2-modal-footer {
    flex-direction: column-reverse;
  }

  .sv2-modal-footer .sv2-btn {
    width: 100%;
  }

  .sv2-toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }

  .sv2-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sv2-bar-chart {
    height: 160px;
    gap: 0.5rem;
  }

  .sv2-pagination button,
  .sv2-pagination a {
    min-width: 32px;
    height: 32px;
    font-size: 0.8125rem;
  }
}
