@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ============================================
   DISTINCTIVE TYPOGRAPHY
   Replace generic Inter with characterful fonts
   Red Hat Display + Source Sans Pro for professional look
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Display:wght@500;600;700&family=Source+Sans+Pro:wght@400;500;600;700&display=swap');

:root {
  --font-display: 'Red Hat Display', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Sans Pro', system-ui, -apple-system, sans-serif;
}

html, body {
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Display typography - headings, titles */
h1, h2, h3, h4, h5, h6,
.mud-typography-h1,
.mud-typography-h2,
.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mud-typography-h5 {
  font-size: 1.25rem;
  font-weight: 600;
}

.mud-typography-h6 {
  font-size: 1rem;
  font-weight: 600;
}

/* Nav menu typography */
.mud-navmenu {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
}

.mud-nav-link {
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Button text */
.mud-button-label {
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* Table headers */
.mud-table th {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* Card titles */
.mud-card-header .mud-typography-h6 {
  font-size: 0.95rem;
  font-weight: 600;
}

/* ============================================
   App Bar Styling
   ============================================ */
.app-bar-border {
    border-bottom: 1px solid var(--mud-palette-divider) !important;
}

/* ============================================
   Global Polish
   ============================================ */

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* Remove transitions from inputs and buttons during typing/clicking */
input, button, .mud-button-root {
    transition: none;
}

/* Better focus states */
.mud-input-outlined .mud-input-slot:focus-within {
    border-width: 2px !important;
}

/* Card hover effect */
.mud-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Better text selection */
::selection {
    background: rgba(8, 145, 178, 0.2);
}

/* Nav menu styling */
.mud-navmenu .mud-nav-link {
    border-radius: 8px;
    margin: 2px 8px;
}

.mud-navmenu .mud-nav-link:hover {
    background-color: var(--mud-palette-action-default-hover);
}

.mud-navmenu .mud-nav-link.active {
    background-color: rgba(8, 145, 178, 0.1);
    color: var(--mud-palette-primary);
}

.mud-navmenu .mud-nav-link.active .mud-icon-root {
    color: var(--mud-palette-primary);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* ============================================
   Mobile Responsive Utilities
   ============================================ */

/* Hide scrollbar on mobile for better UX */
@media (max-width: 600px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    /* Reduce padding on mobile */
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Full width cards on mobile */
    .mud-card {
        margin-left: 0;
        margin-right: 0;
    }

    /* Smaller font sizes for headings on mobile */
    .mud-typography-h4 {
        font-size: 1.5rem !important;
    }

    .mud-typography-h5 {
        font-size: 1.25rem !important;
    }

    .mud-typography-h6 {
        font-size: 1.1rem !important;
    }

    /* Better touch targets on mobile */
    .mud-button, .mud-icon-button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Stack flex items vertically on mobile */
    .mobile-stack {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    /* Hide on mobile */
    .hide-on-mobile {
        display: none !important;
    }
}

/* Show only on mobile */
@media (min-width: 601px) {
    .show-on-mobile-only {
        display: none !important;
    }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 959px) {
    .mud-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

/* Better table responsiveness */
@media (max-width: 959px) {
    .mud-table {
        overflow-x: auto;
        display: block;
    }

    .mud-table table {
        min-width: 600px;
    }
}

/* Improve dialog on mobile */
@media (max-width: 600px) {
    .mud-dialog {
        margin: 8px !important;
        max-height: calc(100vh - 16px) !important;
    }

    .mud-dialog-content {
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }
}

/* FAB positioning on mobile */
@media (max-width: 600px) {
    .mud-fab-fixed {
        bottom: 16px !important;
        right: 16px !important;
    }
}

/* Data grid responsive */
@media (max-width: 600px) {
    .mud-data-grid {
        font-size: 0.85rem;
    }

    .mud-data-grid .mud-table-cell {
        padding: 8px 4px !important;
    }
}

/* ============================================
   Blazor Calendar Styling
   ============================================ */

/* Calendar task colors - Not used with Heron.MudCalendar but kept for reference */

/* ============================================
   PWA Offline Styles
   ============================================ */

/* Offline banner */
body.offline::before {
    content: "⚠️ You're offline - Some features may be limited";
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f59e0b;
    color: white;
    padding: 0.75rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 9999;
    text-align: center;
}

/* Dim content when offline */
body.offline .mud-main-content {
    opacity: 0.7;
    pointer-events: none;
}

/* Offline indicator in app bar */
body.offline .offline-indicator {
    display: flex !important;
}

/* PWA Install Prompt */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10000;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease-out;
}

.pwa-install-banner.hidden {
    display: none;
}

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

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: white;
    padding: 8px;
}

.pwa-install-text h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.pwa-install-text p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
}

.pwa-install-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Mobile optimization for PWA */
@media (max-width: 768px) {
    .pwa-install-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .pwa-install-content {
        flex-direction: column;
    }

    .pwa-install-buttons {
        width: 100%;
    }

    .pwa-install-buttons .mud-button {
        flex: 1;
    }
}

/* PWA Safe Area Insets for notched devices */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Touch target optimization */
@media (hover: none) and (pointer: coarse) {
    .mud-button-root {
        min-height: 44px;
        min-width: 44px;
    }

    .mud-list-item {
        min-height: 48px;
    }

    .mud-menu-item {
        min-height: 44px;
    }
}

/* ============================================
   COMPACT DASHBOARD SYSTEM
   Information-dense dashboard with unified surface
   ============================================ */

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dashboard-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.date-range-toggles {
  display: flex;
  gap: 2px;
  background: var(--mud-palette-action-default-bg);
  padding: 2px;
  border-radius: 4px;
}

.date-range-btn {
  height: 28px !important;
  padding: 0 12px !important;
  font-size: 0.75rem !important;
  font-weight: 500;
  min-width: unset !important;
  border-radius: 3px !important;
  text-transform: none;
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-content {
  flex: 1;
  min-width: 0;
}

.metric-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mud-palette-text-secondary);
  margin-bottom: 2px;
}

.metric-value {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.metric-change {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  margin-top: 2px;
}

.dashboard-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.75rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.compact-card {
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 6px;
  padding: 0.75rem;
}

.compact-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.compact-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0;
}

.chart-container {
  height: 200px;
  position: relative;
}

.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.375rem;
}

/* Quick Actions Bar - horizontal strip below metrics */
.quick-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 8px;
  align-items: center;
}

.quick-action-btn {
  height: 34px !important;
  font-size: 0.8rem !important;
  padding: 0 1rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  border-radius: 6px !important;
  font-weight: 500 !important;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .quick-actions-bar {
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
  }

  .quick-action-btn {
    height: 30px !important;
    font-size: 0.7rem !important;
    padding: 0 0.625rem !important;
  }
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}

.stats-table td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid var(--mud-palette-divider);
  font-size: 0.8rem;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table td:first-child {
  font-weight: 500;
}

.stats-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pipeline-stage {
  padding: 0.5rem;
  border-radius: 4px;
  background: var(--mud-palette-action-default-bg);
  margin-bottom: 0.375rem;
}

.pipeline-stage:last-child {
  margin-bottom: 0;
}

.pipeline-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.pipeline-stage-name {
  font-size: 0.8rem;
  font-weight: 500;
}

.pipeline-stage-count {
  font-size: 0.75rem;
  color: var(--mud-palette-text-secondary);
}

.pipeline-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--mud-palette-action-disabled);
  overflow: hidden;
}

.pipeline-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--mud-palette-text-secondary);
  font-size: 0.8rem;
}

@media (max-width: 1280px) {
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   COMPACT FORM SYSTEM
   Tighter spacing, better use of horizontal space
   ============================================ */

.compact-form {
  --field-spacing: 0.75rem;
  --label-size: 0.8rem;
  --input-size: 0.875rem;
}

.compact-form .mud-input-input {
  font-size: var(--input-size) !important;
}

.compact-form .mud-input-label {
  font-size: var(--label-size) !important;
}

.compact-form .mud-select {
  font-size: var(--input-size) !important;
}

.compact-form .mud-select-input {
  padding: 8px 12px !important;
}

.compact-form .mud-input-outlined .mud-input-slot {
  padding: 8px 12px !important;
}

.compact-form .mud-text-field {
  margin-bottom: var(--field-spacing) !important;
}

.compact-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--field-spacing);
}

@media (max-width: 600px) {
  .compact-form-row {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   DASHBOARD SUPPORT CLASSES
   Additional styles for redesigned dashboard
   ============================================ */

.empty-state {
  min-height: 150px;
}

.pipeline-stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.pipeline-stage-item {
  padding: 0.75rem;
  background: var(--mud-palette-background-grey);
  border-radius: 6px;
  border: 1px solid var(--mud-palette-divider);
  transition: all 0.2s ease;
}

.pipeline-stage-item:hover {
  border-color: var(--mud-palette-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pipeline-funnel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.funnel-stage {
  width: 100%;
}

.funnel-bar {
  height: 20px;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.metric-icon {
  opacity: 0.6;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.metric-value {
  margin-bottom: 0.25rem;
}

.metric-trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.trend-positive {
  color: var(--mud-palette-success);
}

.trend-negative {
  color: var(--mud-palette-error);
}

@media (max-width: 960px) {
  .dashboard-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .pipeline-stages-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   INLINE METRICS BAR
   Compact metrics for list pages (Contacts, Companies, Deals)
   ============================================ */

.inline-metrics {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.inline-metric {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 80px;
}

.metric-divider {
  width: 1px;
  height: 32px;
  background: var(--mud-palette-divider);
}

@media (max-width: 600px) {
  .inline-metrics {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .metric-divider {
    display: none;
  }
}

/* ============================================
   FILTER BAR
   Compact filter bar for list pages
   ============================================ */

.filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 6px;
  flex-wrap: wrap;
}

.filter-search {
  flex: 2;
  min-width: 200px;
}

.filter-select {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 960px) {
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search,
  .filter-select {
    width: 100%;
    flex: none;
  }
}

/* ============================================
   SETTINGS SECTIONS
   Flat layout for settings pages
   ============================================ */

.settings-section {
  padding: 1rem;
  background: var(--mud-palette-surface);
  border: 1px solid var(--mud-palette-divider);
  border-radius: 6px;
}

.section-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--mud-palette-divider);
  font-weight: 600;
}

.form-actions {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--mud-palette-divider);
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 600px) {
  .settings-section {
    padding: 0.75rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .mud-button {
    width: 100%;
  }
}

/* ============================================
   FLATTENED NAV MENU
   Section headers with visible links
   ============================================ */

.nav-section-header {
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mud-palette-text-secondary);
  opacity: 0.7;
}

.flat-nav-menu .nav-link-compact {
  min-height: 40px;
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: 0.875rem;
}

.flat-nav-menu .nav-link-compact .mud-nav-link-icon {
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

.flat-nav-menu .nav-link-compact:hover {
  background-color: var(--mud-palette-action-hover);
  border-radius: 6px;
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   WCAG 2.1 AA Compliance
   ============================================ */

/* Focus Visible - Better than default */
*:focus-visible {
  outline: 2px solid var(--mud-palette-primary);
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--mud-palette-primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Better label associations */
.mud-input-input:invalid:not(:placeholder-shown) {
  border-color: var(--mud-palette-error) !important;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Light mode: add subtle border to flat cards/papers for definition */
.mud-theme-light .mud-card.mud-elevation-0,
.mud-theme-light .mud-paper.mud-elevation-0 {
    border: 1px solid var(--mud-palette-divider);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mud-card {
    border: 2px solid currentColor;
  }

  .mud-button-outlined {
    border-width: 2px;
  }
}

/* Minimum touch targets */
@media (pointer: coarse) {
  .mud-button,
  .mud-icon-button {
    min-width: 44px;
    min-height: 44px;
  }

  .mud-input-slot {
    min-height: 44px;
  }
}
