:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #1a2942;
  --bg-main: #f5f7fa;
  --bg-surface: #ffffff;
  --bg-muted: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-soft: #e2e8f0;
  --accent: #059669;
  --accent-2: #10b981;
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.06);
  --bs-primary: #059669;
  --bs-primary-rgb: 5, 150, 105;
  --bs-link-color: #059669;
  --bs-link-color-rgb: 5, 150, 105;
  --bs-link-hover-color: #047857;
  --bs-link-hover-color-rgb: 4, 120, 87;
}

body.dark-mode {
  --bg-main: #020617;
  --bg-surface: #0f172a;
  --bg-muted: #111827;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-soft: rgba(148, 163, 184, 0.18);
  --accent: #34d399;
  --accent-2: #6ee7b7;
  --shadow-soft: 0 20px 48px rgba(2, 6, 23, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fbff 0%, #eef2ff 100%);
  color: var(--text-main);
  transition: background 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  background: linear-gradient(135deg, #020617 0%, #111827 100%);
}

.dashboard-app {
  min-height: 100vh;
  display: flex;
}

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

/* SIDEBAR */
.sidebar {
  width: 218px;
  background-image: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  background-repeat: repeat, no-repeat;
  background-size: 170px 170px, cover;
  background-position: 0 0, center;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  border-right: 1px solid rgba(255,255,255,0.08);
  position: relative;
  z-index: 100;
  box-shadow: 14px 0 40px rgba(15, 23, 42, 0.12);
}

.sidebar-brand {
  padding: 0.5rem 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.brand-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-text {
  flex: 1;
}

.brand-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.65rem;
  color: #94a3b8;
  line-height: 1.2;
  margin-top: 0.25rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  white-space: nowrap;
  margin-bottom: 0.25rem;
}

.sidebar-link .sidebar-icon {
  transition: transform 0.25s ease, filter 0.25s ease;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 6px 10px rgba(52, 211, 153, 0.28));
}

.sidebar-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  transform: translateX(2px);
}

.sidebar-link.active {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(5, 150, 105, 0.2);
}

body.dark-mode .sidebar {
  background-image: linear-gradient(180deg, #020617 0%, #111827 100%);
  background-repeat: repeat, no-repeat;
  background-size: 170px 170px, cover;
  background-position: 0 0, center;
}

body.dark-mode .topbar,
body.dark-mode .page-header,
body.dark-mode .dashboard-panel,
body.dark-mode .stat-card,
body.dark-mode .card,
body.dark-mode .footer {
  background: rgba(15, 23, 42, 0.92);
  color: var(--text-main);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(148,163,184,0.16);
}

.sidebar-footer-text {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 0.82rem;
  text-align: center;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f5f7fa;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #ffffff;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.topbar-menu-btn {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-menu-btn:hover {
  background: #f5f7fa;
  border-color: #cbd5e1;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 1 300px;
  width: 100%;
  background: linear-gradient(90deg, var(--bg-muted) 0%, rgba(5, 150, 105, 0.04) 100%);
  border-radius: 999px;
  padding: 0 0.85rem;
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.8);
}

.search-icon {
  font-size: 0.9rem;
  color: #94a3b8;
}

.topbar-search input {
  flex: 1;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  color: #0f172a;
}

.topbar-search input::placeholder {
  color: #cbd5e1;
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-notification {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: none;
  background: transparent;
  color: #334155;
  text-decoration: none;
  padding: 0;
}

.topbar-notification:hover {
  transform: scale(1.1);
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: #f5f7fa;
  color: #334155;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}

.topbar-profile:hover {
  background: linear-gradient(90deg, #f8fafc 0%, #eef2ff 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.profile-chevron {
  margin-left: 0.5rem;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  overflow: hidden;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-admin,
.topbar-useraccount {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.75rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: #f5f7fa;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.topbar-admin:hover,
.topbar-useraccount:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}

/* PAGE CONTENT */
.page-content {
  flex: 1;
  padding: 1.5rem 1.75rem 2rem;
  background-color: #eef2ff;
  overflow-y: auto;
}

body.dark-mode .page-content {
  background-color: var(--bg-main);
}

.footer {
  padding: 1rem 1.75rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
  margin-top: auto;
  backdrop-filter: blur(10px);
}

/* CARDS & STAT CARDS */
.card {
  background: #ffffff;
  border: none;
  border-radius: 1.25rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card {
  background: #ffffff;
  border: none;
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}

a.stat-card {
  cursor: pointer;
}

a.stat-card:hover {
  text-decoration: none;
  color: inherit;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.dashboard-panel {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-muted) 100%);
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}

.stat-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.12);
}

.stat-content {
  flex: 1;
}

.stat-label {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: #1a2942;
  margin-top: 1rem;
}

.stat-sublabel {
  font-size: 0.95rem;
  color: #64748b;
  margin-top: 0.75rem;
}

/* STAT CARD COLOR VARIANTS */
.stat-card.users .stat-icon {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.2), rgba(16, 185, 129, 0.14));
  color: #34d399;
}

.stat-card.records .stat-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(34, 197, 94, 0.14));
  color: #34d399;
}

.stat-card.reports .stat-icon {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(236, 72, 153, 0.14));
  color: #f472b6;
}

.stat-card.roles .stat-icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(249, 115, 22, 0.14));
  color: #f59e0b;
}

.stat-card.activities .stat-icon {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(167, 139, 250, 0.14));
  color: #a78bfa;
}

/* TABLES */
.table {
  margin-bottom: 0;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.table thead {
  background: #f5f7fa;
}

.table thead th {
  border: none;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.table tbody td {
  border-color: #e2e8f0;
  padding: 0.875rem 1rem;
  font-size: 0.9rem;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.02));
  transform: translateX(2px);
}

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

/* BADGES */
.badge {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.badge-active {
  background: #dcfce7;
  color: #166534;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.badge-resolved {
  background: #dbeafe;
  color: #0c4a6e;
}

.badge-administrator {
  background: #e9d5ff;
  color: #6b21a8;
}

.badge-manager {
  background: #dbeafe;
  color: #0c4a6e;
}

.badge-staff {
  background: #dcfce7;
  color: #166534;
}

/* ACTION BUTTONS */
.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.action-btn-view {
  background: #dbeafe;
  color: #0369a1;
}

.action-btn-view:hover {
  background: #bfdbfe;
}

.action-btn-edit {
  background: #dcfce7;
  color: #15803d;
}

.action-btn-edit:hover {
  background: #bbf7d0;
}

.action-btn-delete {
  background: #fee2e2;
  color: #991b1b;
}

.action-btn-delete:hover {
  background: #fecaca;
}

/* BUTTONS */
.btn {
  padding: 0.8rem 1.1rem;
  border-radius: 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  border: none;
  color: #fff;
}

.btn-secondary {
  background: #e2e8f0;
  color: #334155;
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  border: none;
  color: #fff;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(22, 163, 74, 0.22);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  border: none;
  color: #fff;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.2);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  border: none;
  color: #fff;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(217, 119, 6, 0.2);
}

.btn-outline-secondary {
  color: #475569;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
}

.btn-outline-secondary:hover {
  background: #eef2ff;
  border-color: #94a3b8;
  transform: translateY(-2px);
}

.btn-outline-danger {
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: #fff5f5;
}

.btn-outline-danger:hover {
  background: #fee2e2;
  transform: translateY(-2px);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #0c4a6e;
}

.badge-pill {
  border-radius: 999px;
}

/* BOOTSTRAP COMPONENT POLISH (alerts, modals, cards used outside the custom panels) */
.alert {
  border: none;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
}

.alert-info {
  background: rgba(5, 150, 105, 0.08);
  color: #1d4ed8;
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: #15803d;
}

.alert-warning {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.alert-danger {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.modal-content {
  border: none;
  border-radius: 1.25rem;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--border-soft);
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-muted) 100%);
}

.modal-title {
  font-weight: 700;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-soft);
  padding: 1rem 1.5rem;
}

.card-header {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-muted) 100%);
  border-bottom: 1px solid var(--border-soft);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.list-group-item {
  background: transparent;
  border-color: var(--border-soft) !important;
  padding: 0.9rem 0.25rem;
}

.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
  border-color: var(--accent);
}

/* FORMS */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.form-select:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.45rem 1.5rem;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-muted) 100%);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.dashboard-hero {
  align-items: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.16), rgba(110, 231, 183, 0.16));
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-outline-primary {
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.2);
  background: #f8fbff;
}

.btn-primary:hover,
.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(5, 150, 105, 0.18);
}

.btn-primary:active,
.btn-outline-primary:active {
  transform: translateY(0);
}

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

.chart-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a2942;
  margin-bottom: 1rem;
}

/* RESPONSIVE */
@media (max-width: 991px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sidebar-link span:nth-child(2) {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .main-content {
    width: 100%;
  }

  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 767px) {
  .sidebar {
    position: fixed;
    left: -170px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    width: 170px;
    padding: 1.25rem 0.75rem;
    transition: left 0.3s ease;
  }

  .sidebar.active {
    left: 0;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .topbar-search {
    flex: 0 1 200px;
  }

  .page-content {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .table {
    font-size: 0.85rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.625rem 0.75rem;
  }
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.18);
  background: #ffffff;
  color: #059669;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(5, 150, 105, 0.1);
}

.invoices-card .activity-item {
  align-items: center;
  justify-content: space-between;
}

.invoices-card .activity-item .activity-title {
  color: #475569;
}

.invoices-card .activity-user a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  padding: 0 0.9rem;
}

.invoice-details .panel-header {
  align-items: flex-start;
}

.invoice-details .card-body {
  background: white;
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.invoice-details .invoice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.invoice-details .invoice-meta p {
  margin-bottom: 0.6rem;
  color: #475569;
}

.invoice-details .invoice-meta strong {
  color: #0f172a;
}

.invoice-details .invoice-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.invoice-details .btn-print {
  border-color: #cbd5e1;
  color: #334155;
}

@media (max-width: 768px) {
  .invoice-details .invoice-meta {
    grid-template-columns: 1fr;
  }

  .invoice-details .invoice-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  body {
    background: white !important;
  }

  .page-header,
  .topbar,
  .sidebar,
  .btn,
  .invoice-actions,
  .navbar,
  .form-select,
  .form-control,
  .dashboard-panel,
  .activity-item {
    display: none !important;
  }

  .page-content,
  .invoice-details .card-body,
  .invoice-details table {
    box-shadow: none !important;
    border: none !important;
  }

  .invoice-details .card-body {
    padding: 0 !important;
  }

  .invoice-details .table-responsive {
    overflow: visible;
  }
}

.invoice-details table {
  border-radius: 1rem;
  overflow: hidden;
}

.invoice-details tfoot td {
  border-top: 2px solid #e2e8f0;
  font-size: 1rem;
}

.dashboard-grid.dashboard-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-main {
  grid-template-columns: 2fr 1.3fr;
  gap: 1.5rem;
}

.dashboard-secondary {
  grid-template-columns: 1.3fr 0.95fr;
  gap: 1.5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
}

.panel-subtitle {
  color: #64748b;
  margin-top: 0.35rem;
  font-size: 0.95rem;
}

.panel-badge {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #1d4ed8;
  font-size: 0.8rem;
  font-weight: 600;
}

.sales-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  background: #f8fafc;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
}

.summary-item span {
  display: block;
  color: #64748b;
  font-size: 0.9rem;
}

.summary-item strong {
  display: block;
  margin-top: 0.5rem;
  font-size: 1.35rem;
  color: #111827;
}

.chart-placeholder {
  background: #eef2ff;
  border-radius: 1rem;
  padding: 1.25rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.4rem;
  border-radius: 1.4rem;
  border: 1px solid rgba(16, 185, 129, 0.16);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(255, 255, 255, 0.56));
  box-shadow: 0 18px 50px rgba(5, 150, 105, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(5, 150, 105, 0.12);
}

.summary-label {
  color: #475569;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-value {
  margin-top: 0.5rem;
  font-size: 2.1rem;
  font-weight: 700;
  color: #0f172a;
}

.summary-icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: rgba(16, 185, 129, 0.16);
}

.summary-primary {
  background: linear-gradient(180deg, rgba(5, 150, 105, 0.12), rgba(190, 232, 255, 0.55));
}

.summary-success {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.1), rgba(209, 250, 229, 0.7));
  border-color: rgba(16, 185, 129, 0.12);
}

.summary-accent {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1), rgba(254, 242, 200, 0.7));
  border-color: rgba(249, 115, 22, 0.15);
}

.summary-warning {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(254, 243, 199, 0.7));
  border-color: rgba(245, 158, 11, 0.16);
}

.line-chart-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.line-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.line-chart-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.line-chart-header p {
  margin: 0.3rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
}

.chart-meta {
  font-weight: 700;
  color: #059669;
}

.line-chart {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  min-height: 260px;
  padding: 1rem;
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06), rgba(255, 255, 255, 0.95));
  position: relative;
}

.line-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #64748b;
  font-size: 0.85rem;
}

.line-plot {
  position: relative;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 1.3rem;
  box-shadow: inset 0 1px 1px rgba(15, 23, 42, 0.04);
  padding: 1.2rem 1rem 1rem;
}

.line-plot::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 3rem;
  height: 2px;
  background: rgba(5, 150, 105, 0.18);
}

.line-area {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 2.5rem;
  top: 1.2rem;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.16), transparent);
  border-radius: 1.2rem;
}

.line-points {
  position: relative;
  height: 100%;
  width: 100%;
}

.line-points span {
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.08);
}

.performance-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.donut-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-chart {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: conic-gradient(#059669 0 33%, #22c55e 33% 57%, #f59e0b 57% 73%, #8b5cf6 73% 85%, #94a3b8 85% 100%);
  position: relative;
}

.donut-chart::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #f8fafc;
}

.product-share-list {
  display: grid;
  gap: 0.85rem;
}

.product-share-item {
  display: flex;
  gap: 0.9rem;
  padding: 1rem 1rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.16);
  align-items: center;
}

.share-dot {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  display: inline-block;
}

.share-dot.blue { background: #059669; }
.share-dot.green { background: #22c55e; }
.share-dot.orange { background: #f59e0b; }
.share-dot.purple { background: #8b5cf6; }
.share-dot.gray { background: #94a3b8; }

.product-share-item strong {
  display: block;
  color: #0f172a;
}

.product-share-item span {
  display: block;
  color: #64748b;
  font-size: 0.92rem;
}

.chart-select {
  max-width: 160px;
}

.chart-label {
  color: #475569;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 180px;
  padding-top: 0.5rem;
}

.chart-bars span {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 1rem 1rem 0.4rem 0.4rem;
  height: calc(var(--h) * 1% * 1.8);
  min-height: 28px;
  position: relative;
  animation: riseBars 0.8s ease forwards;
  transform-origin: bottom;
  opacity: 0;
  transform: scaleY(0.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
}

.chart-bars span::after {
  content: attr(data-bar-label);
  position: absolute;
  bottom: -1.7rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 1.45rem;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.legend-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  margin-right: 0.4rem;
}

.legend-dot.alt {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}

@keyframes riseBars {
  to {
    opacity: 1;
    transform: scaleY(1);
  }
}

.text-link {
  font-size: 0.9rem;
  color: #059669;
  text-decoration: none;
  font-weight: 600;
}

.activity-list,
.stock-list {
  display: grid;
  gap: 0.85rem;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-avatar-large {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-name {
  font-weight: 700;
  color: #111827;
}

.profile-role,
.profile-meta {
  color: #64748b;
  font-size: 0.95rem;
}

.compact-list .list-group-item {
  padding: 0.7rem 0;
  border: 0;
  color: #334155;
}

.activity-item,
.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--bg-muted) 0%, rgba(5, 150, 105, 0.04) 100%);
  border-radius: 1rem;
  border: 1px solid var(--border-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.activity-item:hover,
.stock-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.activity-date,
.stock-product {
  font-weight: 600;
  color: #0f172a;
}

.activity-title,
.stock-category {
  color: #64748b;
}

.stock-meta {
  text-align: right;
}

.stock-count {
  display: block;
  font-weight: 700;
  color: #111827;
}

.stock-status {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.35rem 0.75rem;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 999px;
  font-size: 0.8rem;
}

@media (max-width: 1199px) {
  .dashboard-grid.dashboard-stats,
  .dashboard-main,
  .dashboard-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .dashboard-grid.dashboard-stats,
  .dashboard-main,
  .dashboard-secondary {
    grid-template-columns: 1fr;
  }

  .sales-summary {
    grid-template-columns: 1fr;
  }
}

.login-app .app-shell,
.login-app .sidebar,
.login-app .topbar,
.login-app .main-content,
.login-app .footer {
  display: none !important;
}

.login-app {
  min-height: 100vh;
  background-image: linear-gradient(135deg, rgba(2, 6, 23, 0.88) 0%, rgba(6, 95, 70, 0.78) 45%, rgba(110, 231, 183, 0.55) 100%), url('/images/login-bg.jpg');
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: scroll, scroll;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background: transparent;
}

.login-panel {
  width: min(100%, 1080px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 45px 100px rgba(15, 23, 42, 0.35);
}

.login-promo {
  padding: 3rem 2.5rem;
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.82) 0%, rgba(6, 95, 70, 0.72) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.promo-badge {
  display: inline-block;
  width: fit-content;
  margin-bottom: 1rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e0f2fe;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-promo h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.login-promo p {
  color: rgba(248,250,252,0.8);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.promo-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
  color: #e2e8f0;
}

.promo-features li::before {
  content: "✓";
  margin-right: 0.6rem;
  color: #6ee7b7;
}

.login-form {
  padding: 3rem 2.5rem;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-form-head {
  margin-bottom: 1.75rem;
}

.login-form h2 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
  color: #0f172a;
}

.login-form-head p {
  margin: 0;
  color: #64748b;
}

.login-form .form-control {
  border-radius: 0.95rem;
  border: 1px solid #cbd5e1;
  padding: 0.8rem 0.95rem;
}

.login-form .btn {
  border-radius: 0.95rem;
  padding: 0.95rem 1.2rem;
}

.login-form .form-label {
  font-weight: 600;
  color: #334155;
}

@media (max-width: 575px) {
  .login-panel {
    grid-template-columns: 1fr;
  }

  .topbar-search input {
    min-width: 180px;
  }
}
