/* Professional Design System - Stripe/Linear Style */

:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Resets */
* {
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Inter', sans-serif;
    color: var(--gray-900);
    background-color: var(--gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
}

.h3 {
    font-weight: 600;
    color: var(--gray-900);
}

/* Cards - Elevated, Clean */
.card {
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
    font-weight: 500;
}

.card-body {
    padding: 20px;
}

/* Buttons - Refined */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border: none;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: white;
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
}

.btn-outline-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

/* Badge - Subtle */
.badge {
    font-weight: 500;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
}

.badge.bg-light {
    background: var(--gray-100) !important;
    color: var(--gray-600);
    border: none;
}

.badge.bg-success {
    background: #d1fae5 !important;
    color: #065f46;
}

.badge.bg-danger {
    background: #fee2e2 !important;
    color: #991b1b;
}

.badge.bg-warning {
    background: #fef3c7 !important;
    color: #92400e;
}

.badge.badge-blue {
    background: #dbeafe !important;
    color: #1e40af;
}

.badge.bg-primary {
    background: #dbeafe !important;
    color: #1e40af;
}

.badge.bg-secondary {
    background: #e5e7eb !important;
    color: #4b5563;
}

/* Table - Clean, Professional */
.table {
    font-size: 14px;
}

.table thead {
    background: var(--gray-50);
}

.table thead th {
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 16px;
}

.table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr {
    transition: background-color var(--transition);
}

.table tbody tr:hover {
    background-color: var(--gray-50);
}

.table-row-clickable {
    cursor: pointer;
}

.table-row-clickable:hover {
    background-color: var(--gray-50) !important;
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Text Utilities */
.text-muted {
    color: var(--gray-500) !important;
}

.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
}

.nav-link {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--gray-900);
    background: var(--gray-50);
}

.nav-link.active {
    color: var(--primary);
    background: #eef2ff;
}

/* Forms */
.form-control,
.form-select {
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    transition: all var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 6px;
}

/* Spacing */
.mb-4 {
    margin-bottom: 24px !important;
}

.mb-3 {
    margin-bottom: 16px !important;
}

.gap-2 {
    gap: 8px !important;
}

/* Currency Alignment */
.text-end {
    text-align: right;
}

/* Missed Appointments Panel - Subtle */
.missed-appointments-card {
    border-left: 3px solid var(--danger);
}

.list-group-item {
    border: none;
    border-bottom: 1px solid var(--gray-100);
    padding: 12px 16px;
    transition: background-color var(--transition);
}

.list-group-item:hover {
    background: var(--gray-50);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

/* Segmented Control */
.btn-group-sm .btn {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: 6px 0 0 6px;
}

.btn-group .btn:last-child {
    border-radius: 0 6px 6px 0;
}

/* Utility Classes */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow) !important;
}

.border-0 {
    border: none !important;
}

/* Sticky Table Header */
.table-sticky-header thead {
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table-sticky-header thead th {
    background: var(--gray-50);
}

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

/* Mobile viewport optimization */
@media (max-width: 768px) {

    /* Container padding */
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Typography scaling */
    h1,
    .h1 {
        font-size: 1.75rem;
    }

    h2,
    .h2 {
        font-size: 1.5rem;
    }

    h3,
    .h3 {
        font-size: 1.25rem;
    }

    /* Navigation */
    .navbar {
        padding: 8px 0;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-collapse {
        background: white;
        padding: 16px;
        margin-top: 8px;
        border-radius: 8px;
        box-shadow: var(--shadow);
    }

    /* Cards */
    .card {
        margin-bottom: 16px;
    }

    .card-body {
        padding: 16px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* Tables - make scrollable */
    .table-responsive {
        margin: 0 -16px;
        width: calc(100% + 32px);
    }

    .table {
        font-size: 13px;
    }

    .table thead th {
        font-size: 10px;
        padding: 8px;
    }

    .table tbody td {
        padding: 10px 8px;
    }

    /* Hide less important columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }

    /* Stack filters vertically */
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 12px !important;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 4px;
    }

    /* Form improvements */
    .form-control,
    .form-select {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    /* Avatar sizing */
    .avatar {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    /* Stat cards - single column */
    .row.g-3>[class*="col-md"] {
        margin-bottom: 12px;
    }

    /* Modal adjustments */
    .modal-dialog {
        margin: 16px;
    }

    /* Header actions - stack vertically */
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 16px;
    }

    .d-flex.justify-content-between>* {
        width: 100%;
    }

    /* Make action buttons full-width on mobile */
    .d-flex.gap-2>.btn {
        width: 100%;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    /* Larger tap targets */
    .btn {
        min-height: 44px;
    }

    .table-row-clickable {
        min-height: 60px;
    }

    /* Remove hover effects on touch */
    .table tbody tr:hover {
        background-color: transparent;
    }

    .nav-link:hover {
        background: transparent;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .card-body {
        padding: 12px;
    }

    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }
}