/* 跨部門交易聯絡單系統 - 現代化極致優化樣式表 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #f1f5f9;
  --line-dark: #cbd5e1;
  --brand: #2563eb;
  --brand-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --brand-light: #eff6ff;
  --brand-border: #bfdbfe;
  
  --ok: #10b981;
  --ok-light: #ecfdf5;
  --ok-border: #a7f3d0;
  
  --warn: #f59e0b;
  --warn-light: #fffbeb;
  --warn-border: #fde68a;
  
  --bad: #ef4444;
  --bad-light: #fef2f2;
  --bad-border: #fca5a5;
  
  --soft: #f8fafc;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 2px 8px -1px rgba(15, 23, 42, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.06), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 30px -4px rgba(37, 99, 235, 0.08), 0 4px 12px -2px rgba(37, 99, 235, 0.04);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Outfit', 'Inter', "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

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

/* Sidebar (Dashboard Theme) */
.side {
  width: 290px;
  background: #090d16;
  color: #cbd5e1;
  padding: 30px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.brand {
  font-weight: 850;
  font-size: 24px;
  letter-spacing: -0.8px;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 4px 4px 10px;
  line-height: 1.25;
  text-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.versionBadge {
  margin: 0 4px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
  background: rgba(30, 41, 59, 0.35);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #111827;
}

.roleBox {
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.roleBox label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.roleBox select, .roleBox input {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #1e293b;
  padding: 8px 12px;
  background: #020617;
  color: #f8fafc;
  transition: var(--transition);
  font-size: 13px;
}

.roleBox select:focus, .roleBox input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
  background: #0f172a;
}

/* Nav Menu */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #94a3b8;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
}

.nav button:hover {
  background: rgba(30, 41, 59, 0.4);
  color: #f8fafc;
  padding-left: 20px;
}

.nav button.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-left-color: #3b82f6;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Main Content Area */
.main {
  flex: 1;
  padding: 40px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #f8fafc;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 24px;
  margin-bottom: 10px;
}

.title h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.8px;
  color: #0f172a;
}

.title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #dbeafe;
  border-radius: 99px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  margin: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Card Styling (Glassmorphism inspired) */
.card {
  background: var(--card);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.card h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.6px;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--brand);
  border-radius: 2px;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: #1e293b;
}

.muted {
  color: var(--muted);
}

/* Grid Framework */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

@media (max-width: 1120px) {
  .side {
    position: relative;
    height: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  .app {
    display: block;
  }
  .main {
    padding: 24px;
  }
  .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 {
    grid-column: span 12;
  }
  .quoteLayout {
    grid-template-columns: 1fr !important;
  }
  .historyPanel {
    position: relative !important;
    top: auto !important;
    max-height: none !important;
  }
}

label.lbl {
  display: block;
  font-weight: 700;
  margin: 0 0 6px;
  color: #334155;
  font-size: 13px;
}

/* Form inputs & controls */
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  background: #ffffff;
  color: var(--ink);
  transition: var(--transition);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input[disabled], select[disabled], textarea[disabled] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}

/* Premium Buttons */
.btn {
  border: 1px solid #d2d6dc;
  background: #ffffff;
  color: #374151;
  border-radius: 10px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  margin: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn.primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn.ok {
  background: var(--ok);
  border-color: var(--ok);
  color: #ffffff;
}

.btn.ok:hover {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.btn.warn {
  background: var(--warn-light);
  border-color: var(--warn-border);
  color: #b45309;
}

.btn.warn:hover {
  background: #fef3c7;
  border-color: #f59e0b;
}

.btn.danger {
  background: var(--bad-light);
  border-color: var(--bad-border);
  color: #b91c1c;
}

.btn.danger:hover {
  background: #fee2e2;
  border-color: #ef4444;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.15);
}

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

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.tabs button {
  border: 0;
  background: transparent;
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  transition: var(--transition);
  position: relative;
  top: 2px;
  font-size: 14px;
}

.tabs button:hover {
  color: #1e293b;
}

.tabs button.active {
  color: var(--brand);
  border-bottom: 3px solid var(--brand);
  font-weight: 700;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.page.active {
  display: block;
}

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

/* Tables (Clean & Readable) */
.tableWrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.tbl {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 100%;
  width: max-content;
}

.tbl th, .tbl td {
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  padding: 12px 16px;
  vertical-align: middle;
  white-space: normal;
}

.tbl th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  font-weight: 700;
  color: #334155;
  z-index: 1;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  font-size: 13px;
}

.tbl tr:last-child td {
  border-bottom: 0;
}

.tbl td:last-child, .tbl th:last-child {
  border-right: 0;
}

.tbl tr:hover td {
  background: #fafafa;
}

.tbl input, .tbl select, .tbl textarea {
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  border-color: #cbd5e1;
}

.tbl input:focus, .tbl select:focus, .tbl textarea:focus {
  border-color: var(--brand);
}

.tbl .w-xs { min-width: 80px; }
.tbl .w-s { min-width: 110px; }
.tbl .w-m { min-width: 160px; }
.tbl .w-l { min-width: 240px; }
.tbl .w-xl { min-width: 380px; }

.num {
  text-align: right;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

/* Metric / Dashboard Cards */
.summaryCards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 4px;
}

@media (max-width: 1120px) {
  .summaryCards {
    grid-template-columns: 1fr 1fr;
  }
}

.metric {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.metric .name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric .val {
  font-size: 28px;
  font-weight: 800;
  margin-top: 10px;
  color: var(--brand);
  letter-spacing: -0.5px;
  font-family: 'Outfit', sans-serif;
}

/* Status Badges */
.status {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.s-draft { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.s-submit { background: var(--brand-light); color: #1d4ed8; border: 1px solid var(--brand-border); }
.s-v2 { background: var(--warn-light); color: #92400e; border: 1px solid var(--warn-border); }
.s-closed { background: var(--ok-light); color: #065f46; border: 1px solid var(--ok-border); }

.riskList {
  margin: 0;
  padding-left: 20px;
}

.riskList li {
  margin: 8px 0;
  color: #b91c1c;
  font-weight: 600;
}

/* Document Container (A4 Printable Style) */
.doc {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.docTitle {
  text-align: center;
  font-size: 26px;
  font-weight: 900;
  margin: 8px 0;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.docSubTitle {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.2px;
}

.quoteLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  gap: 24px;
}

/* Library Panel */
.historyPanel {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
}

.historyCard {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
  margin: 8px 0;
  cursor: grab;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.historyCard:hover {
  border-color: #3b82f6;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.dropZone {
  border: 2px dashed var(--brand);
  background: #eff6ff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  color: #1d4ed8;
  margin: 16px 0;
  font-weight: 700;
  transition: var(--transition);
}

.dropZone.dragover {
  background: #dbeafe;
  border-color: #1e40af;
  transform: scale(1.01);
}

.refTag {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  border-radius: 99px;
  padding: 4px 10px;
  margin: 2px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e2e8f0;
}

.small {
  font-size: 12px;
}

.settingTableWrap {
  max-height: 64vh;
  overflow: auto;
}

.settingTableWrap .tbl th {
  position: sticky;
  top: 0;
  z-index: 5;
}

.settingTableWrap .tbl th:first-child {
  z-index: 6;
}

.settingTableWrap .tbl td:first-child,
.settingTableWrap .tbl th:first-child {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 4;
  box-shadow: 1px 0 0 #f1f5f9;
}

.settingTableWrap .tbl th:first-child {
  background: #f8fafc;
  z-index: 7;
  border-bottom: 2px solid #e2e8f0;
}

.advancedHint {
  background: var(--warn-light);
  border: 1px solid var(--warn-border);
  color: #92400e;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 16px 0;
  font-weight: 600;
  line-height: 1.5;
}

/* Quote Layout Custom Grids */
.quoteBasicCard {
  overflow: hidden;
}

.quoteMetaGrid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.quoteMetaGrid .qspan-2 { grid-column: span 2; }
.quoteMetaGrid .qspan-3 { grid-column: span 3; }
.quoteMetaGrid .qspan-4 { grid-column: span 4; }
.quoteMetaGrid .qspan-5 { grid-column: span 5; }
.quoteMetaGrid .qspan-6 { grid-column: span 6; }
.quoteMetaGrid .qspan-7 { grid-column: span 7; }
.quoteMetaGrid .qspan-8 { grid-column: span 8; }
.quoteMetaGrid .qspan-9 { grid-column: span 9; }
.quoteMetaGrid .qspan-12 { grid-column: span 12; }

.quoteMetaGrid input, .quoteMetaGrid select, .quoteMetaGrid textarea {
  min-height: 44px;
  font-size: 14px;
}

.readonlyDisplay {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 14px;
  background: #f1f5f9;
  color: #64748b;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 500;
}

.fieldFullText {
  font-size: 12px;
  color: #475569;
  margin-top: 6px;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  white-space: normal;
  overflow-wrap: anywhere;
}

#tradeVars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

#tradeVars .pill {
  white-space: normal;
  max-width: 100%;
}

@media (max-width: 1320px) {
  .quoteMetaGrid .qspan-2, .quoteMetaGrid .qspan-3 { grid-column: span 4; }
  .quoteMetaGrid .qspan-4, .quoteMetaGrid .qspan-5, .quoteMetaGrid .qspan-6 { grid-column: span 6; }
  .quoteMetaGrid .qspan-7, .quoteMetaGrid .qspan-8, .quoteMetaGrid .qspan-9 { grid-column: span 12; }
}

@media (max-width: 900px) {
  .quoteMetaGrid .qspan-2, .quoteMetaGrid .qspan-3, .quoteMetaGrid .qspan-4, .quoteMetaGrid .qspan-5, .quoteMetaGrid .qspan-6, .quoteMetaGrid .qspan-7, .quoteMetaGrid .qspan-8, .quoteMetaGrid .qspan-9 { grid-column: span 12; }
}

.printOnly {
  display: none;
}

.logoImg {
  height: 46px;
  object-fit: contain;
}

.docHeader {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 14px;
}

.docHeader .docTitleBlock {
  flex: 1;
  text-align: center;
}

/* Beautiful PDF Document Pages */
.docPage {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 36px;
  margin: 20px 0 30px;
  box-shadow: var(--shadow-lg);
}

.docSectionTitle {
  font-weight: 850;
  color: #0f172a;
  margin: 24px 0 12px;
  font-size: 16px;
  border-left: 4px solid var(--brand);
  padding-left: 12px;
  letter-spacing: -0.2px;
  text-transform: uppercase;
}

.resultGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.resultBox {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.resultBox .label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.resultBox .num {
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  margin-top: 8px;
  color: var(--brand);
}

.rowPending {
  background: #fffbeb !important;
}

.rowClosed {
  background: #f8fafc !important;
  color: #94a3b8;
}

.tagPending {
  display: inline-block;
  border-radius: 999px;
  background: var(--warn-light);
  color: #d97706;
  border: 1px solid var(--warn-border);
  padding: 4px 12px;
  font-weight: 700;
  font-size: 12px;
}

.tagV2 {
  display: inline-block;
  border-radius: 999px;
  background: var(--ok-light);
  color: #059669;
  border: 1px solid var(--ok-border);
  padding: 4px 12px;
  font-weight: 700;
  font-size: 12px;
}

.tagClosed {
  display: inline-block;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 12px;
}

/* Reports Styles */
.reportFilters {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.reportKpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.reportKpi {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.reportKpi .name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.reportKpi .val {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
  color: var(--brand);
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.5px;
}

.textRed {
  color: #dc2626 !important;
}

.textGreen {
  color: #16a34a !important;
}

@media (max-width: 1120px) {
  .resultGrid, .reportKpis, .reportFilters {
    grid-template-columns: 1fr 1fr;
  }
}

/* Printing Media Query (A4 Format) */
@media print {
  body {
    background: #ffffff;
    font-size: 12px;
  }
  .side, .topbar, .noPrint, .tabs, .btn {
    display: none !important;
  }
  .main {
    padding: 0;
    background: transparent;
  }
  .page {
    display: block;
  }
  .card {
    box-shadow: none;
    border: 0;
    padding: 0;
    margin: 0;
  }
  .doc {
    border: 0;
  }
  .printOnly {
    display: block;
  }
  .tableWrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .tbl {
    width: 100%;
  }
  .tbl th, .tbl td {
    padding: 8px 10px;
    border: 1px solid #cbd5e1 !important;
  }
  .tbl th {
    position: static;
    background: #f8fafc !important;
    color: #000 !important;
  }
  .historyPanel {
    display: none;
  }
  .docPage {
    border: 0;
    margin: 0;
    padding: 10px 0;
    border-radius: 0;
    box-shadow: none;
    page-break-after: always;
  }
  .resultGrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .resultBox {
    padding: 10px;
    background: #f8fafc !important;
  }
  .resultBox .num {
    font-size: 16px;
  }
}

/* User Profile Widget in Sidebar */
.userProfile {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.userAvatar {
  width: 40px;
  height: 40px;
  background: var(--brand-gradient);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

.userInfoBlock {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.userName {
  font-weight: 700;
  color: #f8fafc;
  font-size: 14px;
}

.userRoleBadge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  width: fit-content;
}

.userScopesDisplay {
  background: #020617;
  color: #94a3b8;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #1e293b;
  min-height: 36px;
  display: flex;
  align-items: center;
}
