/* ===== SYSTEM DESIGN SYSTEM & VARIABLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:ital,wght@0,400..700;1,400..700&display=swap');

:root {
  /* Vigo primary brand green */
  --primary: #008848; 
  --primary-hover: #006226; 
  --primary-light: #E8F8EC; 
  
  --accent: #FF9D00;
  --accent-light: #FFF5EE;
  
  --danger: #F9513F;
  --danger-light: #FEF3F2;
  
  --info: #2F6BFF;
  --info-light: #F2F5F9;
  
  /* Vigo background system */
  --bg: #F5F7F9;            /* Cloud light background */
  --bg-card: #FFFFFF;       /* Base white */
  --border: #E5E7EB;        /* Tailwind neutral border */
  
  /* Vigo brand typography colors */
  --text: #081F25;          /* Heading / Primary text (Teal-dark) */
  --text-secondary: #37535A;/* Body / Secondary text (Teal-medium) */
  --text-muted: #8992A1;    /* Muted / Tertiary text */
  
  /* Vigo brand matching light sidebar */
  --sidebar-bg: #FFFFFF;
  --sidebar-border: #E5E7EB;
  --sidebar-text: #37535A;
  --sidebar-text-active: #008848;
  --sidebar-active-bg: #E8F8EC;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(8, 31, 37, 0.05), 0 4px 6px -4px rgba(8, 31, 37, 0.05);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 320px;
  --header-height: 70px;
}

/* ===== RESET & BASE STYLES ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 15px;
  height: 100%;
}

body {
  font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* ===== HEADER ===== */
.header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-circle {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 10px rgba(21, 157, 0, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ===== MAIN TABS / NAV ===== */
.nav-tabs {
  display: flex;
  gap: 8px;
  height: 100%;
  align-items: center;
}

.nav-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-tab.active {
  background-color: var(--primary);
  color: white;
}

/* ===== GLOBAL SEARCH IN HEADER ===== */
.header-search {
  position: relative;
  width: 280px;
}

.header-search input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  background-color: #F1F5F9;
  transition: var(--transition);
}

.header-search input:focus {
  background-color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21, 157, 0, 0.15);
}

.header-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== MAIN WORKSPACE ===== */
.workspace {
  margin-top: var(--header-height);
  flex: 1;
  display: flex;
  height: calc(100% - var(--header-height));
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  transition: var(--transition);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-title {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-menu {
  flex: 1;
  padding: 12px 0;
}

/* Accordion menu styles */
.menu-group {
  margin-bottom: 6px;
}

.menu-group-header {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.menu-group-header:hover {
  background-color: var(--bg);
  color: var(--primary);
}

.menu-group-header i.chevron {
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.menu-group.open .menu-group-header {
  color: var(--text);
}

.menu-group.open .menu-group-header i.chevron {
  transform: rotate(90deg);
}

.menu-items {
  display: none;
  background-color: var(--bg);
  padding: 4px 0;
  border-left: 3px solid transparent;
}

.menu-group.open .menu-items {
  display: block;
}

.menu-item {
  padding: 8px 20px 8px 40px;
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  text-decoration: none;
}

.menu-item:hover {
  color: var(--primary);
  background-color: var(--sidebar-active-bg);
}

.menu-item.active {
  background-color: var(--sidebar-active-bg);
  color: var(--primary);
  font-weight: 600;
  border-right: 4px solid var(--primary);
}

/* ===== MAIN PANEL ===== */
.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background-color: var(--bg);
}

.content-container {
  padding: 40px 24px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.content-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  min-height: 400px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb i {
  font-size: 0.7rem;
}

/* Article Typography */
.article-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.article-body {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 16px;
}

.article-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 12px;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body b, .article-body strong {
  color: var(--text);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
}

.article-body th, .article-body td {
  border: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
}

.article-body th {
  background-color: #F8FAFC;
  font-weight: 600;
  color: var(--text);
}

.article-body tr:nth-child(even) {
  background-color: #FAFAFA;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 24px 0;
  box-shadow: var(--shadow-md);
  display: block;
}

.article-body blockquote {
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 4px solid var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

/* Alert boxes inside content */
.alert-box {
  padding: 16px 20px;
  margin: 20px 0;
  border-left: 4px solid transparent;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.alert-box.info {
  background-color: var(--info-light);
  border-color: var(--info);
  color: #1D4ED8;
}
.alert-box.warning {
  background-color: var(--accent-light);
  border-color: var(--accent);
  color: #B45309;
}
.alert-box.danger {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: #B91C1C;
}

/* ===== TAB 2: POLICIES ===== */
.policy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.policy-iframe-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.policy-iframe {
  width: 100%;
  height: calc(100vh - 260px);
  min-height: 650px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.btn-download-pdf, .btn-download-excel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary);
  color: white !important;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.btn-download-pdf:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-download-excel {
  background-color: #107C41; /* Microsoft Excel green */
}

.btn-download-excel:hover {
  background-color: #0A5C30;
  box-shadow: var(--shadow-md);
}

/* ===== TAB 3: FEES SECTION ===== */
.fee-hero {
  background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
  color: white;
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.fee-hero::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}

.fee-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.fee-hero-formula {
  background: rgba(255, 255, 255, 0.1);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 1rem;
  margin-top: 12px;
  border-left: 4px solid var(--accent);
  display: inline-block;
  line-height: 1.4;
}

/* Fee Comparison Cards */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.comp-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: white;
  box-shadow: var(--shadow-sm);
}

.comp-card.vigo {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.comp-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.comp-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.comp-row:last-child {
  border-bottom: none;
}

.comp-label {
  color: var(--text-secondary);
}

.comp-value {
  font-weight: 600;
  color: var(--text);
}

.comp-card.vigo .comp-value {
  color: var(--primary);
}

/* Unified Calculator Card Layout */
.unified-calc-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 32px;
}

.calc-card-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.calc-card-header i {
  color: var(--primary);
}

.calc-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.calc-card-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

.calc-input-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Search input autocomplete */
.search-wrapper {
  position: relative;
}

.search-input-field {
  width: 100%;
  padding: 12px 16px 12px 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.search-input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #F1F5F9;
  transition: var(--transition);
  font-size: 0.85rem;
}

.autocomplete-item:hover {
  background-color: var(--primary-light);
}

.autocomplete-item-cat {
  font-weight: 600;
  color: var(--text);
}

.autocomplete-item-path {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Calculator results column and category indicator */
.calc-result-col {
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calc-results-title {
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.selected-cat-path {
  font-size: 0.85rem;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  border-left: 3px solid var(--primary);
  line-height: 1.4;
  font-weight: 500;
}

/* Calculator inputs */
.calc-group {
  margin-bottom: 16px;
}

.calc-label {
  display: block;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.calc-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.calc-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.calc-results {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-result-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.calc-result-row.total {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 6px;
}

.calc-result-row.total .val {
  color: var(--primary);
}

.calc-result-row.payout {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

.calc-result-row.payout .val {
  color: var(--primary);
  font-size: 1.25rem;
}

/* Interactive Excel Grid View styles */
.sheet-container {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.sheet-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

.sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-search-box {
  position: relative;
  width: 250px;
}

.sheet-search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.sheet-search-box input:focus {
  border-color: var(--primary);
}

.sheet-search-box i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sheet-table-wrapper {
  overflow-x: auto;
  max-height: 480px;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}

.sheet-table th, .sheet-table td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  white-space: nowrap;
}

.sheet-table th {
  background-color: #F1F5F9;
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 var(--border);
}

.sheet-table tr:hover {
  background-color: #F8FAFC;
}

.sheet-table tr.selected {
  background-color: var(--primary-light);
}

/* Pagination controls */
.pagination-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: #F8FAFC;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.page-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  background: white;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

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

.page-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===== GLOBAL SEARCH LIST ===== */
.search-results-panel {
  display: none;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}

.search-results-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.search-result-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.search-result-item:hover {
  background-color: var(--primary-light);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  background-color: #E2E8F0;
  color: var(--text-secondary);
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 6px;
}

.search-result-tag.guide {
  background-color: var(--primary-light);
  color: var(--primary);
}

.search-result-tag.policy {
  background-color: var(--accent-light);
  color: var(--accent);
}

.search-result-item-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.search-result-item-snippet {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== MOBILE AND LAYOUT CONTROLS ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 95;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text);
}

.mobile-search-toggle, .mobile-search-close {
  display: none;
}

@media (max-width: 1024px) {
  .fee-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 280px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .header {
    left: 0 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: white !important;
    padding: 0 16px !important;
  }
  
  .mobile-search-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text);
    cursor: pointer;
    padding: 8px;
  }

  .header-search {
    display: none;
  }

  .header-search.open {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: var(--header-height) !important;
    background: white !important;
    z-index: 102 !important;
    padding: 0 16px !important;
    align-items: center !important;
    gap: 12px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
  }

  .header-search.open .mobile-search-close {
    display: block !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 8px 0 !important;
    margin: 0 !important;
  }

  .header-search.open .mobile-search-close i {
    position: static !important;
    transform: none !important;
    color: var(--text-secondary) !important;
    font-size: 1.25rem !important;
  }

  .header-search.open input {
    flex: 1 !important;
    width: 100% !important;
    max-width: none !important;
    height: 40px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0 36px 0 12px !important;
    font-size: 0.95rem !important;
    outline: none !important;
    background-color: #F1F5F9 !important;
  }

  .header-search.open i.search-icon {
    position: absolute !important;
    left: auto !important;
    right: 28px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--text-muted) !important;
    display: block !important;
  }

  .header-search.open .search-results-panel {
    position: fixed !important;
    top: var(--header-height) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-top: 1px solid var(--border) !important;
    max-height: none !important;
    height: calc(100vh - var(--header-height)) !important;
    overflow-y: auto !important;
    background: white !important;
    padding: 16px !important;
  }
  
  .nav-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
    justify-content: space-around;
    padding: 0;
    z-index: 100;
    display: flex;
    align-items: center;
  }
  
  .nav-tab {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem !important;
    gap: 3px;
    padding: 4px 0;
    border-radius: 0;
    color: var(--text-secondary);
    background: transparent;
  }

  .nav-tab i {
    font-size: 1.25rem;
  }
  
  .nav-tab.active {
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    border-top: 3px solid var(--primary);
    margin-top: -3px;
  }
  
  .workspace {
    margin-bottom: 64px;
    height: calc(100% - var(--header-height) - 64px);
  }
  
  .sidebar {
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: var(--header-height);
    bottom: 64px;
    height: calc(100% - var(--header-height) - 64px);
    z-index: 96;
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .sidebar-overlay.open {
    display: block;
  }
  
  .content-container {
    padding: 16px 12px;
  }
  
  .content-card {
    padding: 24px 16px;
    border-radius: var(--radius-md);
  }

  .policy-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }

  .policy-iframe {
    height: calc(100vh - 280px);
    min-height: 480px;
  }

  .btn-download-pdf, .btn-download-excel {
    width: 100%;
    justify-content: center;
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  /* Sheet filters on Mobile */
  .sheet-filters {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .filter-group {
    width: 100%;
    min-width: 100%;
  }

  .sheet-filters select {
    height: 42px; /* Bigger touch target */
    font-size: 0.9rem;
  }

  .btn-reset-filters {
    width: 100%;
    justify-content: center;
    height: 42px;
    font-size: 0.9rem;
  }

  /* Table styling on mobile */
  .sheet-table th, .sheet-table td {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .sheet-table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  .calc-card-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .unified-calc-card {
    padding: 20px 16px;
  }

  .calc-result-col {
    padding: 16px;
  }

  .calc-input {
    height: 44px; /* Larger touch target */
  }

  .sheet-header-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 12px;
  }

  .sheet-search-box {
    width: 100%;
  }

  .sheet-search-box input {
    height: 40px;
  }
}

@media (max-width: 480px) {
  .brand-divider, .brand-academy {
    display: none !important;
  }
}

/* Category Filter Bar */
.sheet-filters {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background-color: #F8FAFC;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-group {
  flex: 1;
  min-width: 180px;
}

.filter-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sheet-filters select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
  background-color: white;
  transition: var(--transition);
  color: var(--text);
  cursor: pointer;
  height: 36px;
}

.sheet-filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.sheet-filters select:disabled {
  background-color: #F1F5F9;
  cursor: not-allowed;
  color: var(--text-muted);
}

.btn-reset-filters {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

