/* ============================================================
   UYRAPURU — styles.css
   Paleta, layout desktop/iPad, componentes, impressão
   ============================================================ */

/* --- Install Banner --- */
.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #5C4F42 0%, #3A3530 100%);
  color: #fff;
  padding: 12px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.install-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}

.install-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.install-banner-text {
  flex: 1;
  min-width: 0;
}

.install-banner-text strong {
  display: block;
  font-size: 0.95rem;
}

.install-banner-text span {
  font-size: 0.8rem;
  opacity: 0.8;
}

.install-banner-button {
  background: #D4A95A;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.install-banner-button:hover { background: #c99b4a; }

.install-banner-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

.install-banner-close:hover { color: #fff; }

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
  --uyra-sidebar: #5C4F42;
  --uyra-red: #C4342D;
  --uyra-red-light: #FDF0EF;
  --uyra-gold: #D4A95A;
  --uyra-gold-light: #FEF7E6;
  --uyra-amber: #E8A832;
  --uyra-yellow: #F5C033;
  --uyra-green: #6B9E4F;
  --uyra-green-light: #EFF7EA;
  --uyra-blue: #3498DB;
  --uyra-blue-light: #EBF5FB;

  --uyra-cream: #FAF5EB;
  --uyra-white: #FFFDF8;
  --uyra-surface: #F5EBD8;

  --uyra-border: #EDE4D3;
  --uyra-border-dark: #E0D5C0;

  --uyra-text: #3A3530;
  --uyra-text-secondary: #5A5248;
  --uyra-text-muted: #8A8078;
  --uyra-text-hint: #B5AA98;
  --uyra-text-faint: #C8BDA8;

  --sidebar-width: 210px;
  --radius-card: 10px;
  --radius-input: 6px;
  --radius-btn-mobile: 14px;
  --radius-qr: 12px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--uyra-cream);
  color: var(--uyra-text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

a { color: var(--uyra-gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- App Layout --- */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--uyra-sidebar);
  color: var(--uyra-text-faint);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--uyra-cream);
  border: 1px solid rgba(255,255,255,0.15);
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-brand {
  flex: 1;
  min-width: 0;
}

.sidebar-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #fff;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--uyra-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

.sidebar-clinic {
  margin: 8px 16px 16px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.sidebar-clinic-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--uyra-gold);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.sidebar-clinic-name {
  font-size: 0.85rem;
  color: #fff;
  font-weight: 500;
}

.sidebar-clinic-specialty {
  font-size: 0.75rem;
  color: var(--uyra-text-faint);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 0 0 16px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--uyra-text-faint);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  position: relative;
}

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}

.sidebar-nav-item.active {
  background: rgba(212,169,90,0.18);
  color: var(--uyra-yellow);
  border-left-color: var(--uyra-gold);
  font-weight: 500;
}

.sidebar-nav-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.sidebar-nav-badge {
  margin-left: auto;
  background: var(--uyra-red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.sidebar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.sidebar-username {
  font-size: 0.82rem;
  color: #fff;
}

.sidebar-logout {
  font-size: 0.78rem;
  color: var(--uyra-text-faint);
  cursor: pointer;
  padding: 4px 0;
}
.sidebar-logout:hover { color: #fff; }

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px 32px 80px;
  min-height: 100vh;
}

/* --- Page Header --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.5rem;
  color: var(--uyra-text);
}

.page-count {
  font-size: 0.85rem;
  color: var(--uyra-text-muted);
  margin-left: 8px;
  font-weight: 400;
  font-family: 'DM Sans', sans-serif;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-input);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--uyra-gold);
  color: #fff;
}
.btn-primary:hover { background: #c99b4a; }

.btn-success {
  background: var(--uyra-green);
  color: #fff;
}
.btn-success:hover { background: #5d8e44; }

.btn-danger {
  background: var(--uyra-red);
  color: #fff;
}
.btn-danger:hover { background: #a82d27; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--uyra-border-dark);
  color: var(--uyra-text-secondary);
}
.btn-outline:hover { background: var(--uyra-surface); }

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.btn-icon {
  padding: 6px 10px;
}

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

/* --- Cards Grid --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  padding: 18px;
}

.stat-card-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-card-label {
  font-size: 0.82rem;
  color: var(--uyra-text-muted);
  margin-top: 2px;
}

/* --- Alerts --- */
.alert-list {
  margin-bottom: 24px;
}

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-card);
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.alert-urgent {
  background: var(--uyra-red-light);
  border: 1px solid #f5c6c2;
}

.alert-warning {
  background: var(--uyra-gold-light);
  border: 1px solid #f5e0b0;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.alert-text { flex: 1; }
.alert-substitute { color: var(--uyra-blue); font-weight: 500; font-size: 0.82rem; margin-top: 2px; }

/* --- Filters Bar --- */
.filters-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--uyra-border-dark);
  border-radius: var(--radius-input);
  font-size: 0.88rem;
  background: var(--uyra-white);
  font-family: 'DM Sans', sans-serif;
  color: var(--uyra-text);
}

.search-input:focus { outline: none; border-color: var(--uyra-gold); }

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--uyra-border-dark);
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  background: var(--uyra-white);
  font-family: 'DM Sans', sans-serif;
  color: var(--uyra-text);
  min-width: 140px;
}

/* --- Data Table --- */
.data-table-wrapper {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  overflow-x: auto;
  margin-bottom: 20px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.data-table thead th {
  background: var(--uyra-surface);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--uyra-text-secondary);
  border-bottom: 1px solid var(--uyra-border);
  white-space: nowrap;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--uyra-border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(212,169,90,0.05); }

.data-table .color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid var(--uyra-border-dark);
}

.table-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--uyra-border);
  font-size: 0.85rem;
  color: var(--uyra-text-muted);
  display: flex;
  justify-content: space-between;
  background: var(--uyra-surface);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* Expandable row */
.expand-row { cursor: pointer; }
.expand-icon { transition: transform 0.2s; display: inline-block; }
.expand-icon.open { transform: rotate(90deg); }

.expand-content {
  display: none;
  background: var(--uyra-cream);
}
.expand-content.open { display: table-row; }
.expand-content td { padding: 16px 20px; }

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--uyra-border);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--uyra-text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover { color: var(--uyra-text); }
.tab.active {
  color: var(--uyra-text);
  border-bottom-color: var(--uyra-gold);
  font-weight: 600;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-urgent { background: var(--uyra-red); color: #fff; }
.badge-warning { background: var(--uyra-amber); color: #fff; }
.badge-success { background: var(--uyra-green); color: #fff; }
.badge-info { background: var(--uyra-blue); color: #fff; }
.badge-gold { background: var(--uyra-gold); color: #fff; }
.badge-muted { background: var(--uyra-surface); color: var(--uyra-text-muted); }
.badge-desktop { background: var(--uyra-blue-light); color: var(--uyra-blue); }
.badge-mobile { background: var(--uyra-green-light); color: var(--uyra-green); }
.badge-kit { background: var(--uyra-gold-light); color: var(--uyra-sidebar); }

/* Shortage badge */
.badge-shortage {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-shortage.urgent { background: var(--uyra-red); color: #fff; }
.badge-shortage.warning { background: var(--uyra-amber); color: #fff; }
.badge-shortage.ok { background: var(--uyra-green); color: #fff; }

/* FEFO badge */
.badge-fefo {
  background: var(--uyra-green-light);
  color: var(--uyra-green);
  border: 1px solid #c5e6b4;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* --- Modals --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58,53,48,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--uyra-white);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-lg { max-width: 800px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--uyra-border);
}

.modal-title {
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--uyra-text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--uyra-text); }

.modal-body { padding: 20px 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--uyra-border);
}

/* --- Form Elements --- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--uyra-text-secondary);
  margin-bottom: 4px;
}

.form-label .required { color: var(--uyra-red); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--uyra-border-dark);
  border-radius: var(--radius-input);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  color: var(--uyra-text);
  background: #fff;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--uyra-gold);
}

.form-textarea { resize: vertical; min-height: 80px; }

.form-hint {
  font-size: 0.78rem;
  color: var(--uyra-text-hint);
  margin-top: 3px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-computed {
  font-size: 0.82rem;
  color: var(--uyra-gold);
  font-weight: 500;
  margin-top: 4px;
}

/* Color picker (adhesive) */
.color-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--uyra-border-dark);
  cursor: pointer;
  transition: all 0.15s;
}

.color-option:hover { transform: scale(1.1); }
.color-option.selected { border-color: var(--uyra-text); box-shadow: 0 0 0 2px var(--uyra-gold); }

/* --- Supplier Grouping Card (Dashboard) --- */
.supplier-group-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
}

.supplier-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.supplier-group-name {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 0.95rem;
}

.supplier-group-count {
  font-size: 0.82rem;
  color: var(--uyra-text-muted);
}

.supplier-group-items {
  font-size: 0.85rem;
  color: var(--uyra-text-secondary);
  margin-bottom: 10px;
}

.supplier-group-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.supplier-group-cost {
  font-weight: 600;
  color: var(--uyra-gold);
}

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  padding: 5px 12px;
  border-radius: var(--radius-input);
  font-size: 0.8rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
}
.btn-whatsapp:hover { background: #20bd5a; }

/* --- Price Evolution Arrow --- */
.price-up { color: var(--uyra-red); }
.price-down { color: var(--uyra-green); }
.price-stable { color: var(--uyra-text-muted); }

/* --- Substitute Badge --- */
.badge-substitute { background: var(--uyra-blue); color: #fff; }

/* --- Kit Card --- */
.kit-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-gold);
  border-radius: var(--radius-card);
}

/* --- Section Card --- */
.section-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  padding: 20px;
  margin-bottom: 20px;
}

.section-card-title {
  font-size: 1rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* --- Dual Quantity --- */
.qty-dual-purchase { color: var(--uyra-text-secondary); }
.qty-dual-total { color: var(--uyra-text-muted); font-size: 0.82rem; }

/* --- Footer --- */
.app-footer {
  position: fixed;
  bottom: 0;
  left: var(--sidebar-width);
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 32px;
  border-top: 1px solid var(--uyra-border);
  background: var(--uyra-cream);
  font-size: 0.78rem;
  color: var(--uyra-text-hint);
  z-index: 50;
}

.footer-clinic { display: flex; align-items: center; gap: 6px; }
.footer-logo { width: 14px; height: 14px; border-radius: 50%; }
.footer-version { color: var(--uyra-text-faint); }

/* --- Login Screen --- */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--uyra-cream);
  padding: 20px;
}

.login-logo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--uyra-surface);
  border: 2px solid var(--uyra-border);
  object-fit: cover;
  margin-bottom: 16px;
  animation: birdFloat 3s ease-in-out infinite;
  cursor: pointer;
  transition: transform 0.3s;
}

.login-logo:hover {
  transform: scale(1.1);
  animation-play-state: paused;
}

@keyframes birdFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.login-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--uyra-text);
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--uyra-gold);
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 1px;
  margin-bottom: 24px;
}

.login-users {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 24px;
}

.login-user-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 100px;
}

.login-user-btn:hover {
  border-color: var(--uyra-gold);
  background: var(--uyra-gold-light);
}

.login-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
}

.login-name {
  font-size: 0.88rem;
  font-weight: 500;
}

/* --- Setup Screen --- */
.setup-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--uyra-cream);
  padding: 20px;
}

.setup-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  padding: 32px;
  max-width: 480px;
  width: 100%;
}

/* --- Inbox Card --- */
.inbox-card {
  background: var(--uyra-white);
  border: 1px solid var(--uyra-border);
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.inbox-barcode {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 700;
}

.inbox-meta {
  font-size: 0.82rem;
  color: var(--uyra-text-muted);
}

.inbox-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* --- Toast --- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-input);
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.3s;
  max-width: 360px;
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast-success { background: var(--uyra-green); color: #fff; }
.toast-error { background: var(--uyra-red); color: #fff; }
.toast-info { background: var(--uyra-sidebar); color: #fff; }
.toast-warning { background: var(--uyra-amber); color: #fff; }

/* --- Expiry Bar Chart --- */
.expiry-chart {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 120px;
  margin: 16px 0;
}

.expiry-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.expiry-bar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}

.expiry-bar-label {
  font-size: 0.7rem;
  color: var(--uyra-text-muted);
  text-align: center;
  white-space: nowrap;
}

.expiry-bar-value {
  font-size: 0.78rem;
  font-weight: 600;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--uyra-text-muted);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 0.95rem; }
.empty-state-hint { font-size: 0.82rem; color: var(--uyra-text-hint); margin-top: 4px; }

/* --- Pairing Modal --- */
.pairing-code {
  font-family: 'Courier New', monospace;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 3px;
  color: var(--uyra-text);
  padding: 16px;
  background: var(--uyra-surface);
  border-radius: var(--radius-card);
  margin-bottom: 16px;
}

.pairing-qr {
  text-align: center;
  margin-bottom: 16px;
}

.pairing-qr canvas {
  border-radius: var(--radius-qr);
}

.pairing-link {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pairing-link input {
  flex: 1;
  font-size: 0.82rem;
}

.pairing-expiry {
  text-align: center;
  font-size: 0.82rem;
  color: var(--uyra-text-muted);
  margin-top: 12px;
}

/* --- Label Print --- */
.label-preview {
  border: 2px dashed var(--uyra-border-dark);
  border-radius: var(--radius-input);
  padding: 16px;
  margin: 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.label-name {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
}

.label-components {
  font-size: 0.72rem;
  color: var(--uyra-text-muted);
  text-align: center;
  line-height: 1.4;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .sidebar.open { display: flex; }
  .main-content { margin-left: 0; padding: 16px; }
  .app-footer { left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

/* --- Print --- */
@media print {
  .sidebar, .filters-bar, .page-actions, .app-footer,
  .modal-overlay, #toast-container, .btn { display: none !important; }
  .main-content { margin-left: 0; padding: 10px; }
  .data-table-wrapper { border: 1px solid #ccc; }
  body { background: #fff; font-size: 12px; }
}

/* Label print specific */
@media print {
  .print-labels-only .sidebar,
  .print-labels-only .main-content,
  .print-labels-only .app-footer,
  .print-labels-only .modal-overlay { display: none !important; }

  .print-labels-only .label-print-area {
    display: block !important;
    padding: 0;
    margin: 0;
  }

  .print-labels-only .label-single {
    page-break-after: avoid;
  }

  .print-labels-only .label-grid {
    display: grid;
    gap: 2mm;
  }

  .print-labels-only .label-item {
    border: 1px dashed #999;
    padding: 3mm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
}

/* Hidden utility */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
