/* Mobile Dashboard Responsive Styles for KratiaData */

/* ==============================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ============================================== */

/* Base Variables for Mobile */
:root {
  --mobile-header-height: 60px;
  --mobile-navbar-height: 70px;
  --mobile-padding: 1rem;
  --mobile-gap: 0.75rem;
  --mobile-border-radius: 8px;
  --mobile-touch-target: 44px;
  --mobile-font-base: 14px;
  --mobile-font-small: 12px;
  --mobile-font-large: 16px;

  /* Touch-friendly spacing */
  --touch-padding: 12px 16px;
  --touch-margin: 8px;
  --touch-gap: 12px;

  /* Mobile shadows */
  --mobile-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --mobile-shadow-raised: 0 4px 12px rgba(0, 0, 0, 0.15);

  /* Mobile animations */
  --mobile-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --mobile-bounce: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ==============================================
   GLOBAL MOBILE OVERRIDES
   ============================================== */

@media (max-width: 768px) {
  body {
    font-size: var(--mobile-font-base);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .container {
    padding: 0 var(--mobile-padding);
    max-width: 100%;
  }

  /* Hide desktop-only elements */
  .desktop-only {
    display: none !important;
  }

  /* Show mobile-only elements */
  .mobile-only {
    display: block !important;
  }
}

/* ==============================================
   MOBILE HEADER
   ============================================== */

@media (max-width: 768px) {
  .admin-header,
  .pro-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--mobile-header-height);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: var(--mobile-shadow);
  }

  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem var(--mobile-padding);
    height: 100%;
  }

  .logo-section {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
  }

  .admin-badge,
  .tier-badge {
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
  }

  /* Mobile header search - hidden by default, expandable */
  .header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--mobile-transition);
    z-index: 999;
  }

  .header-search.expanded {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .search-box {
    margin: var(--mobile-padding);
    position: relative;
  }

  .search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--mobile-border-radius);
    font-size: var(--mobile-font-base);
    background: #f9fafb;
    transition: var(--mobile-transition);
  }

  .search-input:focus {
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }

  /* Mobile header actions */
  .header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .notification-btn {
    padding: 0.5rem;
    border-radius: 8px;
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    position: relative;
  }

  .notification-btn:active {
    transform: scale(0.95);
    background: #f3f4f6;
  }

  .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
  }

  /* Mobile user menu */
  .admin-details {
    display: none; /* Hide on mobile, show in dropdown */
  }

  .user-dropdown {
    position: relative;
  }

  .user-menu-btn {
    padding: 0.5rem;
    border-radius: 8px;
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    background: white;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
  }

  .user-menu-btn:active {
    transform: scale(0.95);
    background: #f3f4f6;
  }

  /* Mobile search toggle button */
  .mobile-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    background: white;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: var(--mobile-transition);
  }

  .mobile-search-toggle:active {
    transform: scale(0.95);
    background: #f3f4f6;
  }

  /* Logout button mobile */
  .logout-btn {
    display: none; /* Move to dropdown menu on mobile */
  }
}

/* ==============================================
   MOBILE LAYOUT ADJUSTMENTS
   ============================================== */

@media (max-width: 768px) {
  .admin-layout,
  .pro-layout {
    padding-top: var(--mobile-header-height);
    min-height: 100vh;
  }

  /* Mobile main content spacing */
  .main-content {
    padding: var(--mobile-padding);
  }

  /* Mobile page spacing */
  .page-header {
    padding: 1.5rem var(--mobile-padding);
    text-align: center;
  }

  .page-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .page-description {
    font-size: var(--mobile-font-base);
    color: #6b7280;
  }
}

/* ==============================================
   MOBILE QUICK STATS
   ============================================== */

@media (max-width: 768px) {
  .quick-stats {
    padding: var(--mobile-padding) 0;
    background: transparent;
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--mobile-gap);
    margin-bottom: 1.5rem;
  }

  .stat-card {
    background: white;
    padding: 1rem;
    border-radius: var(--mobile-border-radius);
    border: 1px solid #e5e7eb;
    box-shadow: var(--mobile-shadow);
    transition: var(--mobile-transition);
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .stat-card:active {
    transform: scale(0.98);
    box-shadow: var(--mobile-shadow-raised);
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .stat-icon i {
    font-size: 1.25rem;
    color: white;
  }

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

  .stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    display: block;
    color: #1f2937;
  }

  .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    display: block;
    margin: 0.125rem 0;
  }

  .stat-change {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    display: inline-block;
  }

  .stat-change.positive {
    background: #dcfce7;
    color: #166534;
  }

  .stat-change.negative {
    background: #fee2e2;
    color: #dc2626;
  }

  .stat-change.neutral {
    background: #f3f4f6;
    color: #6b7280;
  }
}

/* Single column layout for very small screens */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--mobile-gap);
  }

  .stat-card {
    padding: 1.25rem;
    min-height: auto;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8125rem;
  }
}

/* ==============================================
   MOBILE DASHBOARD SECTIONS
   ============================================== */

@media (max-width: 768px) {
  .dashboard-sections {
    padding: 0 var(--mobile-padding);
  }

  .section-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .dashboard-section {
    background: white;
    border-radius: var(--mobile-border-radius);
    border: 1px solid #e5e7eb;
    box-shadow: var(--mobile-shadow);
    overflow: hidden;
  }

  .section-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .section-title i {
    color: #3b82f6;
    font-size: 1.125rem;
  }

  .section-actions {
    display: flex;
    gap: 0.5rem;
  }

  .create-btn,
  .view-all-btn {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    min-height: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: var(--mobile-transition);
    text-decoration: none;
    border: none;
    cursor: pointer;
  }

  .create-btn {
    background: #3b82f6;
    color: white;
  }

  .create-btn:active {
    transform: scale(0.95);
    background: #2563eb;
  }

  .view-all-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
  }

  .view-all-btn:active {
    background: #e5e7eb;
  }

  /* Collapsible sections */
  .section-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: 6px;
    min-height: var(--mobile-touch-target);
    min-width: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--mobile-transition);
  }

  .section-toggle:active {
    background: #e5e7eb;
    transform: scale(0.95);
  }

  .section-toggle i {
    transition: transform 0.3s ease;
  }

  .section-toggle.collapsed i {
    transform: rotate(-90deg);
  }

  .section-content {
    padding: 0;
    transition:
      max-height 0.3s ease,
      opacity 0.3s ease;
    overflow: hidden;
  }

  .section-content.collapsed {
    max-height: 0 !important;
    opacity: 0;
  }
}

/* ==============================================
   MOBILE DASHBOARD ITEMS
   ============================================== */

@media (max-width: 768px) {
  .dashboard-items {
    padding: 0;
  }

  .dashboard-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--mobile-transition);
    text-decoration: none;
    color: inherit;
    min-height: 80px;
  }

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

  .dashboard-item:active {
    background: #f9fafb;
    transform: translateX(4px);
  }

  .item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #6b7280;
  }

  .item-icon.polls {
    background: #dbeafe;
    color: #3b82f6;
  }

  .item-icon.posts {
    background: #f0fdf4;
    color: #10b981;
  }

  .item-icon.campaigns {
    background: #fef3c7;
    color: #f59e0b;
  }

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

  .item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .item-subtitle {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.375rem;
  }

  .item-status {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }

  .item-status.published {
    background: #dcfce7;
    color: #166534;
  }

  .item-status.draft {
    background: #f3f4f6;
    color: #6b7280;
  }

  .item-status.scheduled {
    background: #fef3c7;
    color: #d97706;
  }

  .item-date {
    font-size: 0.625rem;
    color: #9ca3af;
  }

  .item-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
  }

  .item-action {
    padding: 0.375rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: var(--mobile-transition);
    min-height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .item-action:active {
    background: #f3f4f6;
    transform: scale(0.95);
  }

  .item-action.edit {
    color: #3b82f6;
  }

  .item-action.delete {
    color: #ef4444;
  }
}

/* ==============================================
   MOBILE PAGINATION
   ============================================== */

@media (max-width: 768px) {
  .pagination {
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
  }

  .pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    min-height: var(--mobile-touch-target);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: var(--mobile-transition);
  }

  .pagination-btn:active {
    background: #f3f4f6;
    transform: scale(0.95);
  }

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

  .pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
  }

  .pagination-info {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0.5rem;
  }
}

/* ==============================================
   MOBILE WIDGETS & ANALYTICS
   ============================================== */

@media (max-width: 768px) {
  .widget-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 var(--mobile-padding);
  }

  .dashboard-widget {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--mobile-border-radius);
    box-shadow: var(--mobile-shadow);
    overflow: hidden;
  }

  .widget-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .widget-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .widget-content {
    padding: 1rem;
  }

  .widget-chart {
    height: 200px;
    margin-bottom: 1rem;
  }

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

  .widget-stat {
    text-align: center;
  }

  .widget-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    display: block;
  }

  .widget-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
  }
}

/* ==============================================
   MOBILE ACTIVITY FEED
   ============================================== */

@media (max-width: 768px) {
  .activity-feed {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--mobile-border-radius);
    box-shadow: var(--mobile-shadow);
    margin: 1rem var(--mobile-padding);
  }

  .activity-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
  }

  .activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .activity-list {
    max-height: 300px;
    overflow-y: auto;
  }

  .activity-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

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

  .activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.75rem;
  }

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

  .activity-description {
    font-size: 0.75rem;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 0.125rem;
  }

  .activity-time {
    font-size: 0.625rem;
    color: #9ca3af;
  }
}

/* ==============================================
   MOBILE APPROVAL BANNERS
   ============================================== */

@media (max-width: 768px) {
  .approval-banner {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-bottom: 1px solid #f59e0b;
    padding: 1rem var(--mobile-padding);
    position: relative;
    top: var(--mobile-header-height);
  }

  .banner-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f59e0b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

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

  .banner-text h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.25rem;
  }

  .banner-text p {
    font-size: 0.75rem;
    color: #d97706;
    line-height: 1.4;
  }

  .banner-actions {
    flex-shrink: 0;
  }

  .banner-btn {
    padding: 0.5rem 0.75rem;
    background: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--mobile-transition);
    min-height: var(--mobile-touch-target);
  }

  .banner-btn:active {
    background: #d97706;
    transform: scale(0.95);
  }
}

/* ==============================================
   MOBILE FLOATING ACTION BUTTONS
   ============================================== */

@media (max-width: 768px) {
  .mobile-fab-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
  }

  .mobile-fab {
    width: 56px;
    height: 56px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: var(--mobile-bounce);
    position: relative;
    overflow: hidden;
  }

  .mobile-fab:active {
    transform: scale(0.9);
  }

  .mobile-fab.primary {
    background: #3b82f6;
  }

  .mobile-fab.secondary {
    width: 48px;
    height: 48px;
    background: white;
    color: #6b7280;
    box-shadow: var(--mobile-shadow-raised);
    font-size: 1rem;
  }

  .mobile-fab::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
      width 0.3s ease,
      height 0.3s ease;
  }

  .mobile-fab:active::before {
    width: 100%;
    height: 100%;
  }

  /* FAB menu */
  .fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    transform: scale(0);
    opacity: 0;
    transition: var(--mobile-transition);
    transform-origin: bottom right;
  }

  .fab-menu.expanded {
    transform: scale(1);
    opacity: 1;
  }

  .fab-item {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .fab-label {
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.9;
  }
}

/* ==============================================
   MOBILE DRAWER/BOTTOM SHEET
   ============================================== */

@media (max-width: 768px) {
  .mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--mobile-transition);
  }

  .mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  .mobile-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    z-index: 1600;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 85vh;
    overflow: hidden;
  }

  .mobile-drawer.active {
    transform: translateY(0);
  }

  .drawer-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 12px auto 8px;
  }

  .drawer-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: between;
    align-items: center;
  }

  .drawer-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
  }

  .drawer-close {
    padding: 0.5rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--mobile-transition);
  }

  .drawer-close:active {
    background: #f3f4f6;
  }

  .drawer-content {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
  }
}

/* ==============================================
   MOBILE FORM OPTIMIZATIONS
   ============================================== */

@media (max-width: 768px) {
  .mobile-form-group {
    margin-bottom: 1.5rem;
  }

  .mobile-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
  }

  .mobile-form-input,
  .mobile-form-select,
  .mobile-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: var(--mobile-border-radius);
    font-size: var(--mobile-font-base);
    background: white;
    transition: var(--mobile-transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
  }

  .mobile-form-input:focus,
  .mobile-form-select:focus,
  .mobile-form-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
  }

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

  .mobile-form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.375rem;
    line-height: 1.4;
  }

  .mobile-form-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }
}

/* ==============================================
   MOBILE ACCESSIBILITY IMPROVEMENTS
   ============================================== */

@media (max-width: 768px) {
  /* Focus indicators */
  *:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
  }

  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .stat-card,
    .dashboard-section,
    .dashboard-widget {
      border-width: 2px;
    }

    .mobile-fab {
      box-shadow: 0 0 0 2px #000;
    }
  }

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

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

/* ==============================================
   MOBILE LANDSCAPE OPTIMIZATIONS
   ============================================== */

@media (max-width: 768px) and (orientation: landscape) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }

  .stat-card {
    padding: 0.75rem;
    min-height: 80px;
  }

  .stat-number {
    font-size: 1.125rem;
  }

  .stat-label {
    font-size: 0.6875rem;
  }

  .mobile-drawer {
    max-height: 75vh;
  }

  .widget-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==============================================
   VERY SMALL SCREENS (320px and below)
   ============================================== */

@media (max-width: 320px) {
  :root {
    --mobile-padding: 0.75rem;
    --mobile-gap: 0.5rem;
  }

  .container {
    padding: 0 var(--mobile-padding);
  }

  .header-content {
    padding: 0.5rem var(--mobile-padding);
  }

  .logo-text {
    font-size: 1.125rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    min-height: auto;
  }

  .stat-icon {
    margin-bottom: 0.5rem;
  }

  .dashboard-item {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    min-height: auto;
  }

  .item-content {
    width: 100%;
    margin-top: 0.5rem;
  }

  .mobile-fab-container {
    bottom: 16px;
    right: 16px;
  }

  .mobile-fab {
    width: 48px;
    height: 48px;
    font-size: 1.125rem;
  }
}
