:root {
  --primary: #0F9D9D;
  --primary-dark: #0B7A7A;
  --primary-light: #E8F5F5;
  --dark: #1A2B3C;
  --dark-light: #2C3E50;
  --gray: #6C757D;
  --gray-light: #F4F6F9;
  --white: #FFFFFF;
  --danger: #DC3545;
  --success: #28A745;
  --warning: #FFC107;
  --info: #17A2B8;
  --sidebar-width: 250px;
  --header-height: 60px;
  --bg: var(--gray-light);
  --card-bg: var(--white);
  --text: var(--dark);
  --border: #E9ECEF;
  --sidebar-bg: #1A2B3C;
  --sidebar-text: rgba(255,255,255,0.75);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover-bg: rgba(255,255,255,0.06);
  --sidebar-active-bg: rgba(15,157,157,0.18);
  --sidebar-divider: rgba(255,255,255,0.1);
}

[data-theme="dark"] {
  --primary: #15B8B8;
  --primary-dark: #0F9D9D;
  --primary-light: #1A3A3A;
  --dark: #E4E6EA;
  --dark-light: #C8CBD0;
  --gray: #9CA3AF;
  --gray-light: #1F2937;
  --white: #111827;
  --bg: #0F172A;
  --card-bg: #1E293B;
  --text: #E2E8F0;
  --border: #334155;
  --sidebar-bg: #0F172A;
  --sidebar-text: rgba(255,255,255,0.6);
  --sidebar-text-active: #FFFFFF;
  --sidebar-hover-bg: rgba(255,255,255,0.05);
  --sidebar-active-bg: rgba(15,157,157,0.2);
  --sidebar-divider: rgba(255,255,255,0.06);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* === LOGIN PAGE === */
.login-page {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.login-header {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 40px 30px 30px;
}

.login-logo {
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px;
  font-size: 32px;
}

.login-header h1 {
  font-size: 28px; font-weight: 700; margin: 0 0 5px;
}

.login-header .tagline {
  font-size: 14px; opacity: 0.9; margin: 0;
}

.login-body { padding: 30px; }

.login-btn {
  padding: 12px; font-size: 16px; font-weight: 600;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  transition: all 0.3s;
}

.login-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

.login-footer-links {
  display: flex; justify-content: space-between; margin-top: 20px;
}

.login-footer-links a {
  color: var(--primary); text-decoration: none; font-size: 13px;
}

.login-footer-links a:hover { text-decoration: underline; }

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text-active);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  transition: background 0.3s;
}

.sidebar-brand {
  padding: 20px;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
}

.sidebar-brand i { font-size: 28px; }

.sidebar-divider {
  margin: 0 15px;
  border-color: var(--sidebar-divider);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--gray);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 12px 20px;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  color: var(--sidebar-text-active);
  background: var(--sidebar-hover-bg);
}

.sidebar .nav-link.active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-active-bg);
  border-left-color: var(--primary);
}

.sidebar .nav-link i { margin-right: 10px; width: 20px; text-align: center; }

.sidebar .nav-link.active i { color: var(--primary); }

.content-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 20px 30px;
  min-height: 100vh;
}

/* === HEADER === */
.top-header {
  background: var(--card-bg);
  padding: 12px 30px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: -20px -30px 20px;
}

.top-header-left { display: flex; align-items: center; gap: 15px; }

.top-header-left h5 { margin: 0; font-weight: 600; }

.top-header-right {
  display: flex; align-items: center; gap: 20px;
}

.user-info {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.user-info:hover { opacity: 0.8; }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

/* === CARDS === */
.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 4px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
}

/* === TABLES === */
.table-container {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}

.table-container .table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.table { margin-bottom: 0; }

.table th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  border-top: none;
  padding: 12px 8px;
}

.table td {
  vertical-align: middle;
  padding: 12px 8px;
  font-size: 14px;
}

/* === FORMS === */
.form-control, .form-select {
  border-radius: 8px;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px solid #DEE2E6;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,157,157,0.15);
}

/* === BADGE === */
.badge {
  font-weight: 500;
  padding: 5px 10px;
  font-size: 11px;
}

/* === BUTTONS === */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* === POS STYLES === */
.pos-wrapper { display: flex; gap: 20px; }

.pos-left { flex: 1; }

.pos-right {
  width: 400px;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.pos-cart {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.pos-cart-header {
  background: var(--dark);
  color: var(--white);
  padding: 15px 20px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-cart-body { min-height: 200px; max-height: 400px; overflow-y: auto; padding: 10px; }

.pos-cart-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px; border-bottom: 1px solid #F0F0F0;
}

.pos-cart-footer { padding: 15px 20px; border-top: 1px solid var(--border); background: var(--bg); }

.pos-totals-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; }

.pos-totals-row.grand-total { font-size: 20px; font-weight: 700; color: var(--primary); border-top: 2px solid var(--primary); padding-top: 8px; }

.medicine-search-box {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 20px;
}

/* === MOBILE SIDEBAR TOGGLE === */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show,
.mobile-overlay.show { display: block; }

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .mobile-menu-btn { display: inline-flex; }

  .sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    z-index: 1001;
  }
  .sidebar.open { transform: translateX(0); }

  .content-wrapper {
    margin-left: 0 !important;
    padding: 12px !important;
  }

  .top-header {
    padding: 10px 15px !important;
    margin: -12px -12px 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .top-header-left { gap: 10px; flex: 1; min-width: 0; }
  .top-header-left h5 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-header-right { gap: 10px; flex-shrink: 0; }

  .stat-card { padding: 14px; }
  .stat-card .stat-icon { width: 38px; height: 38px; font-size: 17px; margin-bottom: 8px; }
  .stat-card .stat-value { font-size: 20px; }
  .stat-card .stat-label { font-size: 12px; }
  .stat-card:hover { transform: none; }

  .table-container { padding: 12px; overflow: hidden; }
  .table-header { flex-direction: column; gap: 10px; align-items: stretch !important; }
  .table-header form { flex-direction: column; }
  .table-header form .form-control,
  .table-header form .form-select { width: 100% !important; }
  .table-header form button { align-self: flex-end; }
  .table th, .table td { padding: 8px 6px; font-size: 12px; }
  .table th { font-size: 10px; }

  .user-info span { display: none; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .form-control, .form-select { font-size: 16px !important; }
  h6 { font-size: 14px; }

  .pos-wrapper { flex-direction: column !important; }
  .pos-right { width: 100% !important; position: static !important; }

  .login-card { margin: 10px; }
  .login-header { padding: 25px 20px 20px; }
  .login-header h1 { font-size: 22px; }
  .login-body { padding: 20px; }
  .login-footer-links { flex-direction: column; gap: 10px; text-align: center; }

  .section-header { flex-wrap: wrap; gap: 8px; }

  .modal-dialog { margin: 10px; }

  .receipt-wrapper { padding: 0 10px; }
}

@media (max-width: 576px) {
  .content-wrapper { padding: 8px !important; }
  .row.g-3 > [class*="col-"],
  .row.g-2 > [class*="col-"] { padding: 0 4px; }
  .row.g-3 { margin: 0 -4px; }
  .row.g-2 { margin: 0 -4px; }
  .stat-card .stat-value { font-size: 17px; }
  .top-header-left h5 { font-size: 13px; }
  .top-header-left h5 i { font-size: 16px; }
  .top-header-right { gap: 6px; }
  .pos-cart-body { min-height: 120px; max-height: 250px; }
  .medicine-search-box { padding: 12px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .stat-card .stat-value { font-size: 20px; }
  .content-wrapper { padding: 15px 20px; }
}

/* === RECEIPT (thermal/Swiss style) === */
.receipt-wrapper {
  max-width: 500px;
  margin: 0 auto;
}

.receipt {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px 28px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.receipt-header {
  text-align: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--gray);
}

.receipt-header h3 {
  font-family: 'Courier New', Courier, monospace;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.receipt-header p {
  margin: 0;
  font-size: 12px;
  color: var(--gray);
}

.receipt-header .receipt-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-top: 6px;
  color: var(--text);
}

.receipt-divider {
  border: none;
  border-top: 1px dashed var(--gray);
  margin: 10px 0;
}

.receipt-info {
  margin-bottom: 10px;
  font-size: 12px;
}

.receipt-info-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.receipt-info-row .r-label {
  color: var(--gray);
}

.receipt-info-row .r-value {
  font-weight: 600;
  text-align: right;
}

.receipt-extra-line {
  font-size: 11px;
  color: var(--gray);
  padding: 1px 0;
}

.receipt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}

.receipt-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gray);
  border-top: 1px solid var(--gray);
  padding: 6px 4px;
  text-align: left;
  color: var(--text);
}

.receipt-table thead th:nth-child(3),
.receipt-table thead th:nth-child(4) { text-align: right; }

.receipt-table thead th:nth-child(1) { text-align: center; width: 50px; }

.receipt-table tbody td {
  padding: 6px 4px;
  vertical-align: top;
  border-bottom: none;
}

.receipt-table tbody td:nth-child(3),
.receipt-table tbody td:nth-child(4) { text-align: right; white-space: nowrap; }

.receipt-table tbody td:nth-child(1) { text-align: center; font-weight: 600; }

.receipt-table tbody td:nth-child(2) { padding-left: 8px; }

.receipt-table .item-total-row td {
  border-bottom: 1px dotted var(--border);
  padding-bottom: 8px;
  padding-top: 8px;
}

.receipt-totals {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--gray);
}

.receipt-total-line {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 13px;
}

.receipt-total-line.grand {
  font-size: 16px;
  font-weight: 700;
  border-top: 2px solid #222;
  margin-top: 4px;
  padding-top: 6px;
}

.receipt-total-line .rt-label { color: #444; }

.receipt-footer-text {
  text-align: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #999;
  font-size: 12px;
  font-style: italic;
  color: #666;
}

/* === MODAL / POPUP === */
.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}
.modal-header .modal-title { font-weight: 600; font-size: 16px; color: var(--text); }
.modal-header .btn-close {
  filter: var(--btn-close-filter, none);
}
.modal-body { padding: 20px; color: var(--text); }
.modal-footer {
  border-top: 1px solid var(--border);
  padding: 14px 20px;
}
.modal-footer .btn { font-size: 14px; }
.modal-backdrop.show { opacity: 0.5; }
[data-theme="dark"] {
  --btn-close-filter: invert(1) brightness(200%);
}
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }

/* === INTERACTIVE === */
.stat-card { transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s cubic-bezier(.4,0,.2,1); }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04); }
.stat-card:active { transform: translateY(-1px); }
.table-container { transition: box-shadow 0.3s, transform 0.3s; }
.table-container:hover { box-shadow: 0 8px 28px rgba(0,0,0,0.07); }
.nav-link { transition: background 0.2s, color 0.2s, border-color 0.2s; }
.btn { transition: all 0.2s; }

/* === ADVANCED ANIMATIONS === */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 8px rgba(15,157,157,0.2); }
    50% { box-shadow: 0 0 20px rgba(15,157,157,0.4); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes countPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
}

.animate-on-load { opacity: 0; }

/* === GLASS CARD VARIANT === */
.glass-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
[data-theme="dark"] .glass-card {
  background: rgba(30,41,59,0.7);
  border-color: rgba(255,255,255,0.06);
}

/* === ENHANCED STAT CARDS === */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.03;
  transform: translate(30%, -30%);
  pointer-events: none;
}
.stat-card .stat-icon {
  position: relative;
  z-index: 1;
}
.stat-card .stat-value {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.stat-card .stat-trend {
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }

.stat-card .stat-progress {
  margin-top: 10px;
  height: 4px;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.stat-card .stat-progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
}

/* === ENHANCED TABLE CONTAINER === */
.table-container {
  transition: box-shadow 0.3s, transform 0.3s;
  position: relative;
}
.table-container:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.07);
}

/* === TIMELINE FEED === */
.timeline-feed { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item:hover { background: rgba(0,0,0,0.02); }
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-content .tl-title { font-weight: 600; font-size: 14px; }
.timeline-content .tl-sub { font-size: 12px; color: var(--gray); }
.timeline-amount { font-weight: 700; font-size: 15px; white-space: nowrap; }

/* === PROGRESS BARS FOR STOCK === */
.stock-bar {
  height: 6px;
  border-radius: 6px;
  background: rgba(0,0,0,0.06);
  overflow: hidden;
  margin-top: 6px;
}
.stock-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* === MINI CHART WRAPPER === */
.mini-chart-wrapper {
  position: relative;
  padding: 10px 0;
}
.chart-center-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.chart-center-text .cct-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.chart-center-text .cct-label {
  font-size: 11px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-header h6 {
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-header .sh-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* === STATUS TAGS === */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.status-tag.danger { background: #FBE9E7; color: var(--danger); }
.status-tag.warning { background: #FFF8E1; color: #E65100; }
.status-tag.success { background: #E8F5E9; color: var(--success); }
.status-tag.info { background: #E3F2FD; color: #1976D2; }
[data-theme="dark"] .status-tag.danger { background: rgba(220,53,69,0.15); }
[data-theme="dark"] .status-tag.warning { background: rgba(255,193,7,0.15); }
[data-theme="dark"] .status-tag.success { background: rgba(40,167,69,0.15); }
[data-theme="dark"] .status-tag.info { background: rgba(23,162,184,0.15); }

/* === TOP HEADER BADGE === */
.top-header-left { display: flex; align-items: center; gap: 12px; }
.top-header-left .sh-badge {
  font-size: 11px;
  padding: 3px 12px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

/* === NOSCRIPT FALLBACK FOR ANIMATED CONTENT === */
noscript .animate-on-load { opacity: 1 !important; }

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
  .chart-center-text .cct-value { font-size: 20px; }
  .stat-card .stat-trend { font-size: 11px; }
}

/* === PRINT === */
@media print {
  .wrapper { display: block !important; }
  .sidebar, .top-header, .no-print, .btn, .user-info, .top-header-right, .theme-toggle-btn { display: none !important; }
  .content-wrapper {
    margin-left: 0 !important;
    padding: 10px 20px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  body {
    background: white !important;
    --card-bg: #fff !important;
    --text: #222 !important;
    --border: #CCC !important;
    font-size: 12px;
  }
  .table-container {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 15px !important;
  }
  .stat-card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
    break-inside: avoid;
  }
  .stat-card .stat-icon { display: none !important; }
  .stat-card .stat-label { font-size: 10px !important; }
  .stat-card .stat-value { font-size: 18px !important; }
  .print-header {
    display: block !important;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
  }
  .print-header h2 { margin: 0; font-size: 20px; }
  .print-header p { margin: 5px 0 0; color: #666; font-size: 12px; }
  canvas { max-width: 100% !important; height: auto !important; }
  .table { font-size: 11px !important; }
  .table th { font-size: 10px !important; }
  .badge { border: 1px solid #999 !important; background: #fff !important; color: #333 !important; }
  .d-flex, .row { display: block !important; }
  .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-12 { width: 100% !important; max-width: 100% !important; flex: none !important; }
}
.print-header { display: none; }
