/* TobaccoTag — Enterprise SaaS design system */

:root {
  --color-sidebar: #f7f8fa;
  --color-sidebar-hover: #eef1f5;
  --color-sidebar-border: #e4e7ec;
  --color-sidebar-muted: #7b8794;
  --color-sidebar-text: #3d4a5c;
  --color-sidebar-text-strong: #1a2332;
  --color-sidebar-active-bg: #e6f4f2;
  --color-sidebar-active-text: #0f766e;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-accent-soft: rgba(13, 148, 136, 0.12);
  --color-page: #eef1f5;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-danger: #dc2626;
  --color-success: #059669;
  --color-warning: #d97706;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06);
  --sidebar-width: 268px;
  --topbar-height: 56px;
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --transition: 0.22s ease;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-page);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
}

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

/* ---------- App shell ---------- */

.app-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  align-items: stretch;
}

.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--color-sidebar);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1040;
  border-right: 1px solid var(--color-sidebar-border);
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.02);
  transition: margin-left var(--transition), transform var(--transition);
}

.app-sidebar.collapsed {
  margin-left: calc(-1 * var(--sidebar-width));
}

.app-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1.15rem 1rem;
  border-bottom: 1px solid var(--color-sidebar-border);
  text-decoration: none;
  color: var(--color-sidebar-text-strong);
  background: #fff;
}

.app-sidebar-brand:hover {
  color: var(--color-sidebar-text-strong);
}

.app-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(145deg, #0d9488, #115e59);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}

.app-brand-text {
  min-width: 0;
}

.app-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--color-sidebar-text-strong);
}

.app-brand-sub {
  font-size: 0.68rem;
  color: var(--color-sidebar-muted);
  margin: 0.15rem 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sidebar-user {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--color-sidebar-border);
  background: #fff;
}

.app-role-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  background: var(--color-sidebar-active-bg);
  color: var(--color-sidebar-active-text);
  margin-bottom: 0.4rem;
}

.app-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
  color: var(--color-sidebar-text-strong);
}

.app-user-meta {
  font-size: 0.72rem;
  color: var(--color-sidebar-muted);
  margin-top: 0.15rem;
}

.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.65rem 1rem;
}

.app-sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--color-sidebar-border);
  background: #fff;
}

.app-sidebar-footer .btn-collapse {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--color-sidebar);
  border: 1px solid var(--color-sidebar-border);
  color: var(--color-sidebar-muted);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.app-sidebar-footer .btn-collapse:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text-strong);
  border-color: #d0d5dd;
}

/* Menu */

.menu-content {
  padding: 0;
}

.menu-section {
  margin-bottom: 0.45rem;
}

.menu-section h6,
.nav-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-sidebar-muted);
  padding: 0.55rem 0.65rem 0.3rem;
  margin: 0;
  background: transparent;
}

.menu-item,
.nav-link-item {
  color: var(--color-sidebar-text);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  font-weight: 500;
  border-left: none;
  border-radius: 8px;
  margin: 0.1rem 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.menu-item:hover,
.nav-link-item:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text-strong);
  text-decoration: none;
}

.menu-item.active,
.nav-link-item.active {
  background: var(--color-sidebar-active-bg);
  color: var(--color-sidebar-active-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.menu-item i,
.nav-link-item i {
  font-size: 0.95rem;
  width: 1.15rem;
  text-align: center;
  opacity: 0.75;
  color: inherit;
}

.menu-item.active i,
.nav-link-item.active i {
  opacity: 1;
  color: var(--color-accent);
}

/* Main content column */

.app-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-page);
  position: relative;
}

.app-topbar {
  height: auto;
  min-height: 64px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.75rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

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

.app-topbar-context {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.app-topbar-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.app-topbar-accent {
  width: 3px;
  height: 1.35rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  flex-shrink: 0;
}

.app-topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.app-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.app-topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--color-border);
  margin: 0 0.35rem;
}

.app-topbar-actions a.topbar-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.app-topbar-actions a.topbar-link:hover {
  background: #f8fafc;
  color: var(--color-text);
  border-color: var(--color-border);
}

.app-topbar-actions a.topbar-link-danger:hover {
  background: #fef2f2;
  color: var(--color-danger);
  border-color: #fecaca;
}

.topbar-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  max-width: 220px;
}

.topbar-user:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #0d9488, #115e59);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.topbar-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-user-role {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  padding: 0;
}

.btn-sidebar-toggle.floating {
  display: none;
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 1050;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #1a2332;
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
}

.app-sidebar.collapsed ~ .app-main .btn-sidebar-toggle.floating {
  display: flex;
}

.app-content {
  flex: 1;
  padding: 1.5rem 1.75rem 2.25rem;
  max-width: 1440px;
  width: 100%;
}

/* When sidebar collapsed, show floating open button */
.app-sidebar:not(.collapsed) ~ .app-main .btn-sidebar-toggle.floating {
  display: none;
}

/* ---------- Page chrome ---------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.35rem;
  padding: 0.15rem 0 1.15rem;
  border-bottom: 1px solid var(--color-border);
}

.page-header h1,
.page-header .page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 0;
  color: #0f172a;
  line-height: 1.2;
}

.page-header .page-subtitle,
.page-subtitle {
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  margin: 0.4rem 0 0;
  max-width: 56ch;
  line-height: 1.45;
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.manage-page > .page-header + .alert,
.manage-page > .alert {
  margin-bottom: 1rem;
}

.data-card,
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.data-card {
  padding: 0;
  overflow: hidden;
}

.data-card .card-body,
.data-card > .p-3,
.data-card > .p-4 {
  padding: 1.15rem 1.25rem;
}

.data-card .card-header,
.filter-toolbar {
  background: #fbfcfd;
  border-bottom: 1px solid var(--color-border);
  padding: 0.9rem 1.25rem;
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
}

.stat-card {
  padding: 1.15rem 1.25rem;
  height: 100%;
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.stat-card .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.stat-card .stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-text);
  line-height: 1.15;
}

.stat-card .stat-hint {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
}

.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--color-text-muted);
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Bootstrap refinements inside app */

.app-shell .card,
.app-content .card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background: var(--color-surface);
  overflow: hidden;
}

.app-shell .card.mb-4,
.app-content .card.mb-4 {
  margin-bottom: 1.25rem !important;
}

.app-shell .card-header {
  background: #fbfcfd;
  border-bottom: 1px solid var(--color-border);
  font-weight: 650;
  font-size: 0.88rem;
  color: var(--color-text);
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.app-shell .card-header i {
  color: var(--color-accent);
  opacity: 0.9;
}

.app-shell .card-body {
  padding: 1.25rem;
}

.app-shell .card-body > form.mb-4 {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem !important;
}

.app-shell .card-body > form.mb-4 .form-label {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.app-shell .table {
  margin-bottom: 0;
  font-size: 0.875rem;
  color: var(--color-text);
}

.app-shell .table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  padding: 0.75rem 1rem;
}

.app-shell .table > :not(caption) > * > * {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom-color: #eef2f6;
}

.app-shell .table tbody tr {
  transition: background 0.15s ease;
}

.app-shell .table tbody tr:hover {
  background: #f8fafc;
}

.app-shell .table tbody tr:last-child > * {
  border-bottom: none;
}

.app-shell .form-control,
.app-shell .form-select,
.auth-page .form-control,
.auth-page .form-select {
  border-radius: 8px;
  border-color: #d8dee8;
  font-size: 0.875rem;
  padding: 0.55rem 0.75rem;
  background: #fff;
  min-height: 40px;
}

.app-shell .form-control:focus,
.app-shell .form-select:focus,
.auth-page .form-control:focus,
.auth-page .form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.app-shell .btn {
  font-weight: 600;
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 0.845rem;
}

.app-shell .btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 7px;
}

.app-shell .btn-primary,
.auth-page .btn-primary {
  --bs-btn-bg: var(--color-accent);
  --bs-btn-border-color: var(--color-accent);
  --bs-btn-hover-bg: var(--color-accent-hover);
  --bs-btn-hover-border-color: var(--color-accent-hover);
  --bs-btn-active-bg: var(--color-accent-hover);
  --bs-btn-active-border-color: var(--color-accent-hover);
  --bs-btn-disabled-bg: var(--color-accent);
  --bs-btn-disabled-border-color: var(--color-accent);
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(13, 148, 136, 0.18);
}

.app-shell .btn-outline-secondary {
  --bs-btn-color: var(--color-text);
  --bs-btn-border-color: #d8dee8;
  --bs-btn-hover-color: var(--color-text);
  --bs-btn-hover-bg: #f8fafc;
  --bs-btn-hover-border-color: #c9d2df;
  --bs-btn-active-color: var(--color-text);
  --bs-btn-active-bg: #f1f5f9;
  --bs-btn-active-border-color: #c9d2df;
}

.app-shell .badge {
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 0.4em 0.65em;
  border-radius: 6px;
  font-size: 0.72rem;
}

.app-shell .alert {
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  padding: 0.85rem 1rem;
}

.app-shell .alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.app-shell .alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.app-shell .alert-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.app-shell .alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.app-shell .modal-content {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.app-shell .modal-header {
  border-bottom-color: var(--color-border);
  padding: 1rem 1.25rem;
}

.app-shell .modal-footer {
  border-top-color: var(--color-border);
  padding: 0.9rem 1.25rem;
}

.app-shell .pagination {
  gap: 0.25rem;
}

.app-shell .pagination .page-link {
  color: var(--color-text-muted);
  border-color: var(--color-border);
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 7px !important;
  min-width: 36px;
  text-align: center;
  margin: 0;
}

.app-shell .pagination .page-item.active .page-link {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.25);
}

.app-shell .pagination .page-link:hover {
  background-color: #f8fafc;
  color: var(--color-text);
}

.app-shell .input-group .btn {
  border-color: #d8dee8;
}

/* Language selector in topbar */
.app-topbar .dropdown .btn {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-color: var(--color-border);
  color: var(--color-text-muted);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  background: #fff;
}

.app-topbar .dropdown .btn:hover,
.app-topbar .dropdown .btn:focus {
  background: #f8fafc;
  color: var(--color-text);
  border-color: #cbd5e1;
}

@media (max-width: 991.98px) {
  .topbar-user-meta {
    display: none;
  }

  .app-topbar {
    padding: 0.65rem 1rem;
  }

  .app-topbar-actions a.topbar-link span {
    display: none;
  }

  .app-content {
    padding: 1.1rem 1rem 1.75rem;
  }
}

/* ---------- Auth pages ---------- */

.auth-page {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-page);
}

.auth-page-split {
  display: block;
  padding: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(160deg, #0b1220 0%, #132033 48%, #0f3d3a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 3rem 3.25rem;
}

.auth-hero-glow {
  position: absolute;
  inset: auto -20% -30% auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.35), transparent 65%);
  pointer-events: none;
  animation: authGlow 8s ease-in-out infinite alternate;
}

.auth-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 460px;
  animation: authRise 0.55s ease both;
}

.auth-hero-logos {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.auth-hero-logos img,
.auth-mobile-logos img {
  height: 58px;
  width: auto;
  max-width: 28%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.25));
}

.auth-hero-logos .auth-logo-main,
.auth-mobile-logos .auth-logo-main {
  height: 72px;
  max-width: 34%;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 14px;
  padding: 0.4rem;
}

.auth-hero-country {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #99f6e4;
}

.auth-hero-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.8rem, 2.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.auth-hero-copy {
  margin: 0 0 1.5rem;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.88);
  max-width: 34ch;
}

.auth-hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.auth-hero-points li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.92rem;
  color: rgba(248, 250, 252, 0.92);
}

.auth-hero-points i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 148, 136, 0.22);
  color: #5eead4;
  flex-shrink: 0;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  background: #fff;
  min-height: 100vh;
  animation: authFade 0.5s ease 0.08s both;
}

.auth-panel-top {
  display: flex;
  justify-content: flex-end;
  padding: 1.25rem 1.75rem 0;
}

.auth-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 2rem;
}

.auth-mobile-logos {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-mobile-logos .auth-logo-main {
  background: #fff;
  border: 1px solid var(--color-border);
}

.auth-panel-heading {
  margin-bottom: 1.5rem;
}

.auth-panel-heading h2 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-panel-heading p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.auth-page .form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.auth-page .form-control {
  min-height: 46px;
  border-radius: 10px;
  border-color: #dbe3ee;
  background: #f8fafc;
}

.auth-page .form-control:focus {
  background: #fff;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px var(--color-accent-soft);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .form-control {
  padding-left: 2.55rem;
}

.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
}

.auth-input-wrap .auth-toggle-password {
  position: absolute;
  right: 0.45rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1;
}

.auth-input-wrap .auth-toggle-password:hover {
  color: var(--color-text);
  background: #eef2f7;
}

.auth-input-wrap.has-toggle .form-control {
  padding-right: 2.7rem;
}

.auth-inline-link {
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--color-accent);
}

.auth-inline-link:hover {
  color: var(--color-accent-hover);
}

.auth-submit {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  font-weight: 700;
  border-radius: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 10px 24px rgba(13, 148, 136, 0.22);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(13, 148, 136, 0.28);
}

.auth-links {
  text-align: center;
  margin-top: 1.35rem;
  font-size: 0.9rem;
}

.auth-links a {
  font-weight: 600;
  text-decoration: none;
}

.auth-panel-footer {
  padding: 1rem 1.75rem 1.25rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.auth-lang {
  margin: 0;
  padding: 0;
  border: none;
  text-align: right;
}

.auth-lang a,
.auth-lang span {
  color: var(--color-text-muted) !important;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
}

.auth-lang a:hover {
  color: var(--color-accent) !important;
}

.auth-lang .lang-current {
  color: var(--color-accent) !important;
  font-weight: 700;
}

.auth-lang .lang-sep {
  margin: 0 0.4rem;
  color: #cbd5e1 !important;
}

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

@keyframes authFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes authGlow {
  from { transform: translate(0, 0) scale(1); opacity: 0.7; }
  to { transform: translate(-8%, -6%) scale(1.08); opacity: 1; }
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    display: none;
  }

  .auth-mobile-logos {
    display: flex;
  }

  .auth-panel {
    min-height: 100vh;
    background:
      radial-gradient(ellipse 80% 50% at 50% -10%, rgba(13, 148, 136, 0.1), transparent 55%),
      #fff;
  }

  .auth-panel-body {
    padding-top: 0.5rem;
  }
}

@media (max-width: 480px) {
  .auth-hero-logos img,
  .auth-mobile-logos img {
    height: 44px;
  }

  .auth-hero-logos .auth-logo-main,
  .auth-mobile-logos .auth-logo-main {
    height: 54px;
  }

  .auth-panel-body {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}

/* Legacy single-card auth (forgot password / register) */
.auth-page:not(.auth-page-split) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(13, 148, 136, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(15, 23, 42, 0.06), transparent 50%),
    var(--color-page);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2rem 1.85rem 1.75rem;
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  color: var(--color-text);
  line-height: 1.3;
}

.auth-brand p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.auth-page:not(.auth-page-split) .auth-lang {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

/* ---------- Dashboard ---------- */

.dash-grid {
  display: grid;
  gap: 1rem;
}

.dash-chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  padding: 1.2rem 1.3rem;
}

.dash-chart-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
  color: var(--color-text);
}

.dash-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 1.5rem 0 0.85rem;
}

/* List page helpers */

.manage-page .card,
.list-page-card {
  border-radius: 12px;
}

.table-responsive {
  border-radius: 0 0 12px 12px;
}

/* Responsive */

@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(0);
    margin-left: 0 !important;
  }

  .app-sidebar.collapsed {
    transform: translateX(-100%);
    margin-left: 0 !important;
  }

  .btn-sidebar-toggle {
    display: flex;
  }

  .app-sidebar.collapsed ~ .app-main .btn-sidebar-toggle.floating {
    display: flex;
  }

  .app-content {
    padding: 1rem;
  }
}

@media (min-width: 992px) {
  .btn-sidebar-toggle:not(.floating) {
    display: none;
  }
}

/* =========================================================
   Reports Hub
   ========================================================= */

.report-hub .mono {
  font-variant-numeric: tabular-nums;
}

.report-range-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
  font-size: 0.8rem;
  font-weight: 600;
}

.report-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: flex-end;
  padding: 0.95rem 1.1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.report-filter-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.report-preset {
  margin: 0;
  cursor: pointer;
}

.report-preset input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.report-preset span {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.report-preset.active span,
.report-preset input:checked + span {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.report-custom-dates {
  display: none;
  gap: 0.65rem;
}

.report-custom-dates.is-visible {
  display: flex;
  flex-wrap: wrap;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
}

.report-chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1fr;
  gap: 0.85rem;
}

.report-chart-grid--single {
  grid-template-columns: 1fr;
}

.report-chart-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 1.15rem 1.1rem;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}

.report-chart-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--color-text);
}

.report-chart-header p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.report-chart-body {
  flex: 1;
  min-height: 200px;
  margin-top: 0.75rem;
  position: relative;
}

.report-chart-body--sm {
  min-height: 180px;
}

.report-catalog-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem;
  align-items: flex-end;
}

.report-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.2rem;
}

.report-search-wrap {
  position: relative;
  min-width: 240px;
  max-width: 320px;
  width: 100%;
}

.report-search-wrap > i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.report-search-wrap .form-control {
  padding-left: 2.1rem;
}

.report-category {
  margin-bottom: 1.5rem;
}

.report-category.is-hidden,
.report-card.is-hidden {
  display: none !important;
}

.report-category-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}

.report-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.report-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.report-card:hover {
  border-color: #99f6e4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.report-card-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0fdfa;
  color: #0d9488;
  font-size: 1.15rem;
}

.report-card-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #0f766e;
  background: #f0fdfa;
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  margin-bottom: 0.4rem;
}

.report-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--color-text);
  line-height: 1.3;
}

.report-card-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.report-quick-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, #f8fffd 0%, #ffffff 55%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.report-quick-link:hover {
  border-color: #99f6e4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  color: inherit;
}

.report-quick-link-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0d9488;
  color: #fff;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.report-quick-link strong {
  display: block;
  font-size: 0.95rem;
}

.report-quick-link span {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.report-quick-link > .bi-chevron-right {
  margin-left: auto;
  color: var(--color-text-muted);
}

.report-preview-panel {
  width: min(520px, 100vw);
}

.report-preview-meta {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.report-preview-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 220px;
  color: var(--color-text-muted);
  text-align: center;
}

.report-preview-state i {
  font-size: 1.75rem;
}

.report-preview-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.report-preview-total {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}

.report-preview-total span {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.25rem;
}

.report-preview-total strong {
  font-size: 1.15rem;
  color: var(--color-text);
}

.report-preview-chart-wrap {
  height: 200px;
  position: relative;
}

@media (max-width: 1199.98px) {
  .report-chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767.98px) {
  .report-chart-grid {
    grid-template-columns: 1fr;
  }

  .report-card-actions .btn {
    flex: 1;
  }
}

/* =========================================================
   Tags Management
   ========================================================= */

.tags-manage-page .tags-filter-bar {
  padding-bottom: 0.25rem;
}

.tags-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.tags-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.tags-status-chip:hover {
  border-color: #99f6e4;
  color: #0f766e;
}

.tags-status-chip.active {
  background: #0d9488;
  border-color: #0d9488;
  color: #fff;
}

.tags-status-chip .chip-count {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.tags-status-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.2);
}

.tags-batch-table .tags-batch-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.tags-batch-table .tags-batch-row:hover,
.tags-batch-table .tags-batch-row:focus {
  background: #f0fdfa;
  outline: none;
}

.batch-id {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.batch-id i {
  color: #0d9488;
}

.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.3rem;
}

.batch-meta span {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
}

.pack-chip-list,
.status-badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.pack-chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.pack-chip-more {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0f766e;
}

.pack-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.pack-status-badge.status-inventory {
  background: #ecfdf5;
  color: #047857;
}

.pack-status-badge.status-damaged {
  background: #fff7ed;
  color: #c2410c;
}

.pack-status-badge.status-lost {
  background: #fef2f2;
  color: #b91c1c;
}

.pack-status-badge.status-activated {
  background: #eff6ff;
  color: #1d4ed8;
}

.pack-status-badge.status-unknown {
  background: #f1f5f9;
  color: #475569;
}
