*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --primary: #0d9488;
  --bottom-nav-h: 64px;
  --primary-dark: #0f766e;
  --primary-deep: #115e59;
  --primary-light: #ccfbf1;
  --primary-glow: rgba(13, 148, 136, 0.25);
  --accent: #f59e0b;
  --accent-light: #fef3c7;
  --accent-deep: #d97706;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-md:
    0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --sidebar-w: 275px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: var(--slate-100);
  color: var(--slate-800);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button {
  cursor: pointer;
  font-family: inherit;
}
input,
textarea,
select {
  font-family: inherit;
}
.app {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    var(--slate-50) 0%,
    var(--slate-100) 50%,
    #ecfdf5 100%
  );
}
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, #0f172a 0%, #1a2332 40%, #0d9488 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 50;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
  transition:
    width var(--transition-slow),
    min-width var(--transition-slow);
}
.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}
.sidebar.collapsed .sidebar-top {
  padding: 1.5rem 0.75rem 0;
}
.sidebar.collapsed .sidebar-logo-area {
  justify-content: center;
  margin-bottom: 0;
}
.sidebar.collapsed .sidebar-logo-area > div:last-child,
.sidebar.collapsed .sidebar-actions,
.sidebar.collapsed .sidebar-search,
.sidebar.collapsed .sidebar-bills-label,
.sidebar.collapsed .sidebar-bills,
.sidebar.collapsed .sidebar-settings {
  opacity: 0;
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  padding: 0;
  margin: 0;
  transition:
    opacity var(--transition-slow),
    max-height var(--transition-slow);
}
.sidebar.collapsed .sidebar-settings {
  border-top: none;
}
.sidebar-toggle {
  position: absolute;
  top: 1.5rem;
  right: 4px;
  z-index: 60;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.sidebar-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 12px rgba(13, 148, 136, 0.4);
}
.sidebar-toggle:active {
  transform: scale(0.95);
}
.sidebar-toggle svg {
  transition: transform var(--transition-slow);
}
.sidebar.collapsed .sidebar-toggle {
  top: auto;
  bottom: 1rem;
  right: 23px !important;
}
.sidebar.collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}
@media (max-width: 820px) {
  .sidebar-toggle {
    top: 0.85rem;
    right: 6px;
    width: 26px;
    height: 26px;
  }
}
@media (max-width: 640px) {
  .sidebar-toggle {
    display: none;
  }
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 30% 0%,
    rgba(13, 148, 136, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
}
.sidebar-top {
  padding: 1rem;
  padding-bottom: 0.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.sidebar-logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
}
.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18),
    rgba(255, 255, 255, 0.06)
  );
  backdrop-filter: blur(8px);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.sidebar-sub {
  font-size: 10.5px;
  opacity: 0.55;
  margin-top: 2px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 1.25rem;
  margin-top: 0.75rem;
}
.btn-pdf {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.35);
}
.btn-pdf:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}
.btn-pdf:active {
  transform: translateY(0);
}
.btn-new-bill {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 12.5px;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn-new-bill:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: translateY(-1px);
}
.sidebar-search {
  padding: 0.7rem 1.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.search-wrap {
  position: relative;
}
.search-wrap input {
  width: 100%;
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  outline: none;
  transition: all var(--transition);
}
.search-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.search-wrap input:focus {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}
.search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.4;
  font-size: 13px;
  pointer-events: none;
}
.sidebar-bills-label {
  padding: 0.5rem 1.25rem 0.35rem;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.4;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-bills-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--emerald-500));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.35);
  transition: transform var(--transition);
}
.sidebar-bills {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.75rem 0.75rem;
  position: relative;
  z-index: 1;
}
.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  text-align: center;
  min-height: 180px;
}
.sidebar-empty svg {
  width: 52px;
  height: 52px;
  opacity: 0.25;
  margin-bottom: 0.85rem;
}
.sidebar-empty-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}
.sidebar-empty-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
  line-height: 1.5;
  max-width: 180px;
}
.mb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  text-align: center;
  min-height: 200px;
}
.mb-empty svg {
  width: 64px;
  height: 64px;
  color: var(--slate-300);
  margin-bottom: 1rem;
}
.mb-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--slate-400);
  margin-bottom: 4px;
}
.mb-empty-sub {
  font-size: 12px;
  color: var(--slate-300);
  font-weight: 400;
  line-height: 1.5;
  max-width: 200px;
}
.sidebar-bills::-webkit-scrollbar {
  width: 4px;
}
.sidebar-bills::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-bills::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.sidebar-bills::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
.bill-item {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.bill-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}
.bill-item.active {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.14),
    rgba(255, 255, 255, 0.06)
  );
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 20px rgba(13, 148, 136, 0.1);
}
.bill-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 3px;
  background: linear-gradient(180deg, #14b8a6, #0d9488);
  border-radius: 0 3px 3px 0;
}
.bill-item-info {
  flex: 1;
  min-width: 0;
}
.bill-item-no {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.55;
  letter-spacing: 0.05em;
}
.bill-item-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  letter-spacing: -0.01em;
}
.bill-item-date {
  font-size: 10px;
  opacity: 0.4;
  margin-top: 3px;
  font-weight: 400;
}
.bill-item-badge {
  font-size: 8.5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  backdrop-filter: blur(4px);
}
.badge-paid {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-partial {
  background: rgba(13, 148, 136, 0.15);
  color: #5eead4;
  border: 1px solid rgba(13, 148, 136, 0.2);
}
.badge-none {
  display: none;
}
.sidebar-settings {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.btn-settings {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}
.main {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  position: relative;
  transition: padding var(--transition-slow);
}
.sidebar.collapsed + .main {
  padding: 1rem 1.5rem;
}
.main::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(13, 148, 136, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(245, 158, 11, 0.02) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(15, 118, 110, 0.03) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}
.bill-card {
  background: #fff;
  max-width: 760px;
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-200);
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow: hidden;
  position: relative;
  z-index: 1;
  animation: cardIn 0.45s ease-out;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.bill-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--slate-200);
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--slate-50) 0%, #fff 100%);
}
.bill-header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary),
    var(--accent),
    transparent
  );
  border-radius: 2px;
}
.bill-header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.header-text {
  flex: 1;
}
.memo-line {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--slate-400);
  margin-bottom: 4px;
  font-weight: 600;
}
.hospital-name-h {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--slate-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hospital-addr {
  font-size: 11.5px;
  color: var(--slate-500);
  margin-top: 4px;
  font-weight: 400;
}
.hospital-reg {
  font-size: 10.5px;
  color: var(--slate-400);
  font-weight: 400;
  margin-top: 1px;
}
.bill-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.65rem 2rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.meta-item.right {
  justify-content: flex-end;
}
.meta-lbl {
  font-size: 10px;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.meta-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
}
.meta-input {
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
  background: transparent;
  outline: none;
  width: 100px;
  padding: 0.15rem 0;
  transition: border-color var(--transition);
}
.meta-input:focus {
  border-bottom-color: var(--primary);
}
.meta-date-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  padding: 0.15rem 0;
  border-bottom: 1.5px solid transparent;
  transition: border-color var(--transition);
  cursor: pointer;
}
.meta-date-input:focus {
  border-bottom-color: var(--primary);
}
.status-row {
  padding: 0.5rem 2rem;
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.status-label {
  color: var(--slate-500);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-select {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.status-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.dup-btn {
  font-size: 11px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  color: var(--slate-500);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.dup-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.patient-section {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--slate-200);
}
.patient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 2rem;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-group.full {
  grid-column: 1/-1;
}
.field-group label {
  font-size: 9.5px;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.field-group input[type="text"],
.field-group input[type="date"] {
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  padding: 0.35rem 0.1rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-800);
  background: transparent;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.field-group input:focus {
  border-bottom-color: var(--primary);
}
.charges-section {
  padding: 0 2rem;
}
.charges-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1.5px solid var(--slate-300);
  padding: 0.55rem 0;
}
.charges-head-title {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-400);
  font-weight: 700;
}
.charges-head-actions {
  display: flex;
  gap: 6px;
}
.btn-add-row,
.btn-reset-rows {
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-600);
  transition: all var(--transition);
}
.btn-add-row:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.btn-reset-rows:hover {
  border-color: var(--red-500);
  color: var(--red-500);
  background: #fef2f2;
}
.charges-table {
  width: 100%;
  border-collapse: collapse;
}
.charges-table th {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate-400);
  font-weight: 600;
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--slate-300);
  text-align: left;
}
.charges-table th.r {
  text-align: right;
}
.charges-table td {
  padding: 0.15rem 0.4rem;
  vertical-align: middle;
}
.charges-table tbody tr td {
  transition: background var(--transition);
}
.charges-table tbody tr:nth-child(even) td {
  background: var(--slate-50);
}
.charges-table tbody tr:hover td {
  background: rgba(13, 148, 136, 0.04);
}
.item-num {
  font-size: 10px;
  color: var(--slate-400);
  font-weight: 500;
  width: 24px;
  text-align: center;
}
.item-name-inp {
  border: none;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-800);
  width: 100%;
  padding: 0.3rem 0.25rem;
  outline: none;
  border-radius: 4px;
  transition: background var(--transition);
}
.item-name-inp:focus {
  background: rgba(13, 148, 136, 0.04);
}
.item-rs-inp,
.item-ps-inp {
  border: none;
  background: transparent;
  font-weight: 500;
  color: var(--slate-800);
  padding: 0.3rem 0.25rem;
  outline: none;
  text-align: right;
  border-radius: 4px;
  transition: background var(--transition);
}
.item-rs-inp {
  font-size: 12.5px;
  width: 85px;
}
.item-ps-inp {
  font-size: 12.5px;
  width: 42px;
}
.item-rs-inp:focus,
.item-ps-inp:focus {
  background: rgba(13, 148, 136, 0.04);
}
.btn-del-row {
  background: none;
  border: none;
  color: var(--slate-300);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition);
}
.btn-del-row:hover {
  color: var(--red-500);
  background: #fef2f2;
}
.tfoot-total td {
  padding: 0.6rem 0.4rem !important;
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--slate-300) !important;
}
.total-lbl {
  text-align: right;
  color: var(--slate-700);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.total-val {
  text-align: right;
  color: var(--slate-800);
  font-size: 15px;
  min-width: 85px;
  font-weight: 700;
}
.discount-area {
  padding: 0.3rem 2rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate-500);
  border-top: 1px solid var(--slate-200);
  padding-top: 0.75rem;
}
.discount-area input {
  width: 80px;
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  background: transparent;
  outline: none;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  padding: 0.15rem 0;
  color: var(--slate-800);
  transition: border-color var(--transition);
}
.discount-area input:focus {
  border-bottom-color: var(--primary);
}
.discount-area .net-label {
  font-weight: 600;
  color: var(--slate-600);
  margin-left: 0.5rem;
}
.discount-area .net-val {
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 14px;
}
.bill-footer {
  border-top: 1px solid var(--slate-200);
  padding: 1.25rem 2rem 1.75rem;
  background: var(--slate-50);
}
.recv-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 12.5px;
  color: var(--slate-600);
  margin-bottom: 0.6rem;
}
.recv-line input {
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  flex: 1;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  outline: none;
  padding: 0.15rem 0.1rem;
  color: var(--slate-800);
  transition: border-color var(--transition);
}
.recv-line input:focus {
  border-bottom-color: var(--primary);
}
.amt-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 12.5px;
  color: var(--slate-600);
  margin-bottom: 0.4rem;
}
.amt-row input {
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  outline: none;
  padding: 0.15rem 0.1rem;
  color: var(--slate-800);
  transition: border-color var(--transition);
}
.amt-row input:focus {
  border-bottom-color: var(--primary);
}
.amt-num-inp {
  width: 120px;
  flex: none;
  text-align: right;
}
.amt-words-inp {
  flex: 1;
}
.sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 2.75rem;
  gap: 1rem;
}
.sign-left {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 12px;
  color: var(--slate-500);
}
.sign-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0.5rem;
  font-size: 12px;
  color: var(--slate-500);
}
.sign-date input {
  border: none;
  border-bottom: 1.5px solid var(--slate-300);
  background: transparent;
  outline: none;
  font-size: 12px;
  font-weight: 500;
  width: 130px;
  padding: 0.1rem 0.1rem;
  color: var(--slate-700);
  transition: border-color var(--transition);
}
.sign-date input:focus {
  border-bottom-color: var(--primary);
}
.sign-right {
  text-align: right;
}
.sign-line-el {
  width: 160px;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.sign-line-el::before {
  content: "";
  display: block;
  border-top: 1.5px solid var(--slate-300);
  width: 100%;
}
.doctor-name-d {
  font-weight: 700;
  font-size: 14px;
  color: var(--slate-800);
}
.doctor-cred-d {
  font-size: 10.5px;
  color: var(--slate-400);
  font-weight: 400;
  margin-top: 2px;
}
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  animation: overlayIn 0.2s ease-out;
}
.modal-overlay.open {
  display: flex;
}
@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  width: min(88vw, 1000px);
  max-width: 95vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  padding: 0.5rem 1rem;
  animation: modalIn 0.3s ease-out;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal::-webkit-scrollbar {
  width: 5px;
}
.modal::-webkit-scrollbar-track {
  background: transparent;
}
.modal::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}
.modal h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}
.modal-section {
  margin-bottom: 1.15rem;
}
.modal-section h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-400);
  font-weight: 600;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 0.3rem;
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}
.modal-grid .full {
  grid-column: 1/-1;
}
.m-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.m-field label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.m-field input,
.m-field textarea,
.m-field select {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.6rem;
  font-size: 13px;
  outline: none;
  transition: all var(--transition);
  color: var(--slate-800);
  background: #fff;
}
.m-field input:focus,
.m-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.m-field textarea {
  resize: vertical;
  min-height: 52px;
}
.default-rates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
}
.rate-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rate-field label {
  font-size: 9.5px;
  color: var(--slate-400);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rate-field input {
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.5rem;
  font-size: 12px;
  text-align: right;
  outline: none;
  transition: all var(--transition);
}
.rate-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.modal-footer {
  display: flex;
  justify-self: center;
  align-items: center;
  gap: 10px;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--slate-200);
}
.btn-save-settings {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.55rem;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 2px 8px var(--primary-glow);
  max-width: 200px;
}
.btn-save-settings:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
}
.btn-save-settings:active {
  transform: translateY(0);
}
.btn-cancel-settings {
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 0.65rem 1.25rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  transition: all var(--transition);
}
.btn-cancel-settings:hover {
  background: var(--slate-50);
  border-color: var(--slate-400);
}
.confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(6px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  animation: overlayIn 0.2s ease-out;
}
.confirm-overlay.open {
  display: flex;
}
.confirm-box {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  width: 380px;
  max-width: 90vw;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease-out;
}
.confirm-box h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--slate-800);
}
.confirm-box p {
  font-size: 12.5px;
  color: var(--slate-500);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.confirm-btns {
  display: flex;
  gap: 10px;
}
.btn-confirm-yes {
  flex: 1;
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-confirm-yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.btn-confirm-no {
  flex: 1;
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 0.6rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-600);
  transition: all var(--transition);
}
.btn-confirm-no:hover {
  background: var(--slate-50);
}
.toast {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  background: linear-gradient(135deg, var(--slate-800), var(--slate-900));
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 500;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-h);
  background: linear-gradient(180deg, #1a2332 0%, #0f172a 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}
.mb-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 4px 12px;
  border-radius: 10px;
  transition: all var(--transition);
  position: relative;
}
.mb-nav-btn:hover,
.mb-nav-btn:active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.mb-nav-btn .mb-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.mb-nav-btn-primary {
  color: var(--primary-light);
}
.mb-nav-btn-primary svg {
  stroke: var(--primary);
}
.mb-nav-btn-primary:hover,
.mb-nav-btn-primary:active {
  background: rgba(13, 148, 136, 0.15);
  color: #fff;
}
.mb-nav-btn-primary:hover svg,
.mb-nav-btn-primary:active svg {
  stroke: #5eead4;
}
.mb-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--emerald-500));
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(13, 148, 136, 0.4);
  pointer-events: none;
  transition: transform 0.15s ease;
}
.mb-del-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--slate-300);
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 2px;
}
.mb-del-btn:hover {
  color: var(--red-500);
  background: #fef2f2;
}
.mb-del-btn:active {
  transform: scale(0.9);
}
.sb-del-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 15px;
  font-weight: 400;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 2px;
  position: relative;
  z-index: 2;
}
.sb-del-btn:hover {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.2);
}
.sb-del-btn:active {
  transform: scale(0.85);
}
.mb-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 110;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mb-panel-overlay.open {
  display: block;
  opacity: 1;
}
.mb-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 120;
  background: #fff;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.mb-panel.open {
  transform: translateY(0);
}
.mb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-800);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--slate-200);
  flex-shrink: 0;
}
.mb-panel-close {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--slate-400);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.mb-panel-close:hover {
  background: var(--slate-100);
  color: var(--slate-700);
}
.mb-panel-search {
  padding: 0.65rem 1.25rem;
  position: relative;
  flex-shrink: 0;
}
.mb-search-icon {
  position: absolute;
  left: 1.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}
.mb-panel-search input {
  width: 100%;
  padding: 0.5rem 0.65rem 0.5rem 2rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  background: var(--slate-50);
  transition: all var(--transition);
}
.mb-panel-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: #fff;
}
.mb-panel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0.75rem 1rem;
}
.mb-panel-list .bill-item {
  color: var(--slate-700);
  border: 1px solid var(--slate-100);
}
.mb-panel-list .bill-item:hover {
  border-color: var(--slate-200);
  background: var(--slate-50);
  transform: none;
}
.mb-panel-list .bill-item.active {
  background: linear-gradient(135deg, var(--primary-light), #fff);
  border-color: var(--primary);
}
.mb-panel-list .bill-item.active::before {
  background: var(--primary);
}
.mb-panel-list .bill-item-info .bill-item-no {
  color: var(--slate-400);
}
.mb-panel-list .bill-item-info .bill-item-name {
  color: var(--slate-800);
}
.mb-panel-list .bill-item-info .bill-item-date {
  color: var(--slate-400);
}

.lock-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #0f172a 0%, #1a2332 50%, #0d9488 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lockFadeIn 0.5s ease-out;
}
.lock-screen-overlay.hidden {
  display: none;
}
@keyframes lockFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.lock-card {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem;
  width: 360px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  animation: lockCardIn 0.4s ease-out;
}
@keyframes lockCardIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.lock-icon {
  font-size: 40px;
  margin-bottom: 0.75rem;
}
.lock-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.lock-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 1.5rem;
  font-weight: 400;
}
.lock-input-wrap {
  margin-bottom: 0.85rem;
}
.lock-input-wrap input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  outline: none;
  text-align: center;
  letter-spacing: 0.15em;
  transition: all var(--transition);
}
.lock-input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: normal;
}
.lock-input-wrap input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}
.lock-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  letter-spacing: 0.02em;
}
.lock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.45);
}
.lock-btn:active {
  transform: translateY(0);
}
.lock-error {
  font-size: 12px;
  color: #fca5a5;
  margin-top: 0.75rem;
  min-height: 1.2em;
  font-weight: 500;
}

.sidebar-logo-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 10px;
  background-color: white;
  border-radius: 50%;
  padding: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.logo-preview {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius);
  flex-shrink: 0;
  padding: 4px;
}

@media print {
  body {
    background: #fff !important;
  }
  .sidebar,
  .mobile-bottom-nav,
  .mb-panel,
  .mb-panel-overlay,
  .charges-head-actions,
  .btn-del-row,
  .status-row,
  .modal-overlay,
  .confirm-overlay,
  .toast,
  .app::before,
  .main::before {
    display: none !important;
  }
  .app {
    background: #fff !important;
  }
  .main {
    padding: 0;
  }
  .bill-card {
    box-shadow: none !important;
    border: none !important;
    max-width: 100%;
    border-radius: 0;
    animation: none !important;
  }
  .bill-header::after {
    display: none;
  }
  input,
  textarea {
    border: none !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .item-rs-inp,
  .item-ps-inp {
    text-align: right;
  }
  .sign-date input {
    border-bottom: 1px solid #ccc !important;
  }
  .discount-area input {
    border-bottom: 1px solid #ccc !important;
  }
}
@media (max-width: 820px) {
  .sidebar {
    width: 260px;
    min-width: 260px;
  }
  .sidebar.collapsed {
    width: 64px;
    min-width: 64px;
  }
  .main {
    padding: 1.25rem;
  }
  .bill-header {
    padding: 1.25rem 1.25rem 1rem;
  }
  .bill-meta {
    padding: 0.65rem 1.25rem;
  }
  .patient-section {
    padding: 1rem 1.25rem;
  }
  .charges-section {
    padding: 0 1.25rem 0.75rem;
  }
  .discount-area {
    padding: 0.5rem 1.25rem 0.6rem;
  }
  .bill-footer {
    padding: 1rem 1.25rem 1.5rem;
  }
  .hospital-name-h {
    font-size: 1.25rem;
  }
  .logo-preview {
    width: 52px;
    height: 52px;
  }
  .sign-row {
    display: flex;
    justify-content: space-between;
  }
  .sign-right {
    text-align: left;
    margin-top: 1rem;
  }
  .sign-line-el {
    width: 120px;
  }
}
@media (max-width: 640px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    display: none;
  }
  .sidebar.collapsed {
    display: none;
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .sidebar.collapsed {
    width: 100% !important;
    min-width: 100% !important;
  }
  .sidebar-bills {
    max-height: 140px;
  }
  .main {
    padding: 0.75rem 0.75rem calc(0.75rem + var(--bottom-nav-h));
  }
  .main::before {
    display: none;
  }
  .bill-card {
    border-radius: var(--radius);
  }
  .bill-header {
    padding: 1rem 1rem 0.8rem;
  }
  .bill-header-inner {
    flex-direction: column;
    gap: 10px;
  }
  .logo-preview {
    width: 48px;
    height: 48px;
  }
  .patient-grid {
    grid-template-columns: 1fr;
  }
  .default-rates-grid {
    grid-template-columns: 1fr;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 1.25rem;
    max-height: 85vh;
  }
  .bill-meta {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
  }
  .meta-item.right {
    justify-content: flex-start;
  }
  .hospital-name-h {
    font-size: 1.1rem;
  }
  .status-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0.4rem 1rem;
  }
  .charges-section {
    padding: 0 1rem 0.5rem;
  }
  .charges-head-actions {
    gap: 4px;
  }
  .btn-add-row,
  .btn-reset-rows {
    font-size: 9px;
    padding: 3px 7px;
  }
  .item-rs-inp {
    width: 64px;
    font-size: 11px;
  }
  .item-ps-inp {
    width: 34px;
    font-size: 11px;
  }
  .item-name-inp {
    font-size: 11px;
  }
  .discount-area {
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 1rem 0.6rem;
    font-size: 11.5px;
  }
  .discount-area input {
    width: 70px;
    font-size: 12px;
  }
  .discount-area .net-label {
    margin-left: 0;
  }
  .patient-section {
    padding: 0.8rem 1rem;
  }
  .bill-footer {
    padding: 0.8rem 1rem 1.25rem;
  }
  .recv-line {
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 11.5px;
  }
  .recv-line input {
    width: 100%;
    flex: none;
  }
  .amt-row {
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 11.5px;
  }
  .amt-num-inp {
    width: 100px;
  }
  .amt-words-inp {
    width: 100%;
    flex: none;
  }
  .sign-row {
    margin-top: 1.5rem;
    gap: 0.75rem;
  }
  .tfoot-total td {
    font-size: 12px;
  }
  .total-val {
    font-size: 13px;
    min-width: 64px;
  }
}
@media (max-width: 480px) {
  .sidebar.collapsed + .main {
    padding-bottom: 5.5rem;
  }
  .app {
    flex-direction: column;
  }
  .main {
    padding: 0.5rem 0.5rem calc(0.5rem + var(--bottom-nav-h));
  }
  .bill-header {
    padding: 0.85rem 0.85rem 0.65rem;
  }
  .hospital-name-h {
    font-size: 1rem;
  }
  .hospital-addr {
    font-size: 10px;
  }
  .hospital-reg {
    font-size: 9px;
  }
  .memo-line {
    font-size: 8px;
  }
  .bill-meta {
    padding: 0.4rem 0.85rem;
  }
  .meta-input {
    width: 80px;
    font-size: 12px;
  }
  .meta-date-input {
    font-size: 11px;
  }
  .status-row {
    padding: 0.35rem 0.85rem;
    font-size: 11px;
  }
  .status-label {
    font-size: 10px;
  }
  .status-select {
    font-size: 11px;
    padding: 3px 8px;
  }
  .dup-btn {
    font-size: 10px;
    padding: 3px 8px;
  }
  .patient-section {
    padding: 0.65rem 0.85rem;
  }
  .field-group label {
    font-size: 8.5px;
  }
  .field-group input[type="text"],
  .field-group input[type="date"] {
    font-size: 11.5px;
    padding: 0.25rem 0.1rem;
  }
  .charges-section {
    padding: 0 0.85rem 0.4rem;
  }
  .charges-head-title {
    font-size: 8.5px;
  }
  .charges-head {
    padding: 0.4rem 0;
  }
  .charges-table th {
    font-size: 8px;
    padding: 0.3rem 0.25rem;
  }
  .charges-table td {
    padding: 0.1rem 0.25rem;
  }
  .item-num {
    width: 18px;
    font-size: 9px;
  }
  .item-name-inp {
    font-size: 10.5px;
    padding: 0.2rem 0.15rem;
  }
  .item-rs-inp {
    width: 54px;
    font-size: 10.5px;
    padding: 0.2rem 0.15rem;
  }
  .item-ps-inp {
    width: 30px;
    font-size: 10.5px;
    padding: 0.2rem 0.15rem;
  }
  .btn-del-row {
    font-size: 14px;
    padding: 1px 4px;
  }
  .tfoot-total td {
    font-size: 11px;
    padding: 0.4rem 0.25rem !important;
  }
  .total-lbl {
    font-size: 10px;
  }
  .total-val {
    font-size: 12px;
    min-width: 54px;
  }
  .discount-area {
    padding: 0.4rem 0.85rem 0.5rem;
    font-size: 10.5px;
  }
  .discount-area input {
    width: 60px;
    font-size: 11px;
  }
  .discount-area .net-val {
    font-size: 12px;
  }
  .bill-footer {
    padding: 0.65rem 0.85rem 1rem;
  }
  .recv-line {
    font-size: 10.5px;
  }
  .amt-row {
    font-size: 10.5px;
  }
  .amt-num-inp {
    width: 85px;
    font-size: 11px;
  }
  .amt-words-inp {
    font-size: 11px;
  }
  .sign-row {
    margin-top: 1.25rem;
    gap: 0.5rem;
  }
  .sign-left {
    font-size: 10.5px;
  }
  .sign-date {
    font-size: 10.5px;
  }
  .sign-date input {
    width: 100px;
    font-size: 10.5px;
  }
  .doctor-name-d {
    font-size: 12px;
  }
  .doctor-cred-d {
    font-size: 9px;
  }
  .sign-line-el {
    width: 100px;
  }
  .modal {
    padding: 1rem;
    width: min(92vw, 1100px);
    max-height: 82vh;
  }
  .modal h2 {
    font-size: 15px;
    margin-bottom: 0.75rem;
  }
  .modal-section {
    margin-bottom: 0.75rem;
  }
  .m-field label {
    font-size: 8.5px;
  }
  .m-field input,
  .m-field textarea,
  .m-field select {
    font-size: 11.5px;
    padding: 0.3rem 0.5rem;
  }
  .rate-field label {
    font-size: 8.5px;
  }
  .rate-field input {
    font-size: 11px;
    padding: 0.25rem 0.4rem;
  }
  .modal-footer {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    flex-direction: column;
  }
  .btn-save-settings {
    font-size: 12px;
    padding: 0.5rem;
  }
  .btn-cancel-settings {
    font-size: 12px;
    padding: 0.5rem;
    text-align: center;
  }
  .confirm-box {
    padding: 1.25rem 1.5rem;
  }
  .confirm-box h3 {
    font-size: 13px;
  }
  .confirm-box p {
    font-size: 11px;
  }
  .toast {
    bottom: calc(1rem + var(--bottom-nav-h));
    right: 1rem;
    left: 1rem;
    max-width: none;
    text-align: center;
    font-size: 12px;
  }
}
