html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.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;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Mobile cards container */
.mobile-cards {
    display: none;
}

.desktop-table {
    display: block;
}

@media (max-width: 991px) {
    /* Hide desktop table, show mobile cards */
    .desktop-table {
        display: none !important;
    }
    
    .mobile-cards {
        display: block !important;
    }
    
    /* Mobile card styling */
    .mobile-card {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        transition: box-shadow 0.2s ease;
    }
    
    .mobile-card:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid #f3f4f6;
    }
    
    .mobile-card-title {
        font-weight: 600;
        font-size: 1rem;
        color: #1f2937;
        margin: 0;
        word-break: break-word;
    }
    
    .mobile-card-subtitle {
        font-size: 0.85rem;
        color: #6b7280;
        margin-top: 4px;
    }
    
    .mobile-card-body {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .mobile-card-row {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-card-row.full-width {
        grid-column: span 2;
    }
    
    .mobile-card-label {
        font-size: 0.75rem;
        color: #9ca3af;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 2px;
    }
    
    .mobile-card-value {
        font-size: 0.9rem;
        color: #374151;
    }
    
    .mobile-card-footer {
        display: flex;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f3f4f6;
    }
    
    /* Sort panel on mobile */
    .mobile-sort-panel {
        display: flex !important;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 16px;
        padding: 12px;
        background: #f9fafb;
        border-radius: 8px;
    }
    
    .mobile-sort-panel .form-select {
        flex: 1;
        min-width: 140px;
    }
    
    /* Navbar mobile adjustments */
    .navbar-toggler {
        padding: 4px 8px;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1rem !important;
    }
    
    /* Container padding on mobile */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* Cards adjustments */
    .card {
        margin-bottom: 12px;
    }
    
    .card-header {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 12px 16px;
    }
    
    /* Form controls */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        padding: 8px 16px;
    }
    
    .btn-sm {
        padding: 6px 12px;
    }
    
    /* Page titles */
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    /* Stat cards */
    .stat-card {
        margin-bottom: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    /* Tables in user pages - scroll horizontally */
    .table-responsive {
        margin: 0 -12px;
        padding: 0 12px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    /* Badge */
    .badge {
        font-size: 0.75rem;
    }
    
    /* Footer */
    footer {
        text-align: center;
    }
    
    footer .row {
        text-align: center;
    }
}

@media (max-width: 575px) {
    /* Extra small screens */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .mobile-card {
        padding: 12px;
    }
    
    .mobile-card-body {
        grid-template-columns: 1fr;
    }
    
    .mobile-card-row.full-width {
        grid-column: span 1;
    }
    
    h1 {
        font-size: 1.25rem;
    }
    
    /* Stack buttons vertically */
    .mobile-card-footer {
        flex-direction: column;
    }
    
    .mobile-card-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Pagination on small screens */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin: 2px;
    }
}