/* ==========================================
   INSYT FAMILYCARE - PREMIUM DESIGN SYSTEM
   Sleek. Sophisticated. Sexy.
   ========================================== */

/* Root Variables - Insyt FamilyCare Brand Colors */
:root {
    /* Brand Colors */
    --primary-teal: #20b3b0;
    --primary-teal-dark: #1a8f8d;
    --primary-teal-light: #4ec9c6;
    --leaf-green: #88b63f;
    --leaf-green-dark: #6d9432;
    --leaf-green-light: #a3cd5f;
    --medium-gray: #77797c;
    --charcoal-gray: #585b5d;
    --tagline-gray: #d9dada;
    
    /* Semantic Colors */
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --success-color: #88b63f;
    --info-color: #20b3b0;
    
    /* Background Colors */
    --bg-gradient: linear-gradient(135deg, #f8fafb 0%, #ffffff 100%);
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --overlay-bg: rgba(88, 91, 93, 0.95);
    
    /* Text Colors */
    --text-primary: #585b5d;
    --text-secondary: #77797c;
    --text-light: #d9dada;
    --text-white: #ffffff;
    
    /* Borders */
    --border-color: #e8eaeb;
    --border-color-light: #f2f3f4;
    
    /* Shadows - Premium Depth */
    --shadow-xs: 0 1px 2px 0 rgba(32, 179, 176, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(32, 179, 176, 0.08);
    --shadow-md: 0 4px 12px 0 rgba(32, 179, 176, 0.12);
    --shadow-lg: 0 8px 24px 0 rgba(32, 179, 176, 0.16);
    --shadow-xl: 0 12px 36px 0 rgba(32, 179, 176, 0.20);
    --shadow-2xl: 0 20px 48px 0 rgba(32, 179, 176, 0.24);
    
    /* Gradients - Signature Insyt Blends */
    --gradient-primary: linear-gradient(135deg, #20b3b0 0%, #88b63f 100%);
    --gradient-primary-hover: linear-gradient(135deg, #1a8f8d 0%, #6d9432 100%);
    --gradient-secondary: linear-gradient(135deg, #88b63f 0%, #a3cd5f 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(32, 179, 176, 0.1) 0%, rgba(136, 182, 63, 0.1) 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8fafb 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(32, 179, 176, 0.18);
    
    /* Spacing */
    --sidebar-width: 280px;
    --header-height: 75px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   HEADER - Premium Top Bar
   ========================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition-base);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 2rem;
    max-width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    transition: var(--transition-base);
}

.logo-image {
    height: 50px;
    width: auto;
    object-fit: contain;
    transition: var(--transition-base);
}

.logo:hover .logo-image {
    transform: scale(1.02);
    filter: drop-shadow(0 4px 8px rgba(32, 179, 176, 0.3));
}

/* Legacy icon styles (kept for other pages) */
.logo i {
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

.logo span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-selector {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-teal);
    border-radius: var(--radius-full);
    background: white;
    color: var(--primary-teal);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.role-selector:hover {
    background: var(--primary-teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    background: var(--gradient-subtle);
    border-radius: var(--radius-full);
}

/* ==========================================
   SIDEBAR - Sleek Navigation
   ========================================== */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    transition: var(--transition-base);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-teal);
    border-radius: var(--radius-full);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: var(--transition-base);
}

.nav-item:hover {
    color: var(--primary-teal);
    background: var(--gradient-subtle);
    transform: translateX(4px);
}

.nav-item:hover::before {
    transform: translateX(0);
}

.nav-item.active {
    color: white;
    background: var(--gradient-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.nav-item.active::before {
    transform: translateX(0);
}

.nav-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */

.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 2.5rem;
    min-height: calc(100vh - var(--header-height));
    transition: var(--transition-base);
    background: var(--bg-color);
}

/* Content wrapper for consistent spacing */
#contentArea {
    max-width: 100%;
    margin: 0 auto;
}

/* ==========================================
   PAGE HEADER - Hero Section
   ========================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--gradient-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color-light);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.page-description {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-top: 0.5rem;
    line-height: 1.6;
}

/* ==========================================
   FILTER BAR - Search & Filters
   ========================================== */

.filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.search-box .form-input {
    padding-left: 2.75rem;
    width: 100%;
}

.filter-bar .form-select {
    min-width: 200px;
}

.filter-bar .btn {
    white-space: nowrap;
}

/* ==========================================
   BUTTONS - Premium Interactive Elements
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

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

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #6d9432 0%, #88b63f 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary-teal);
    border: 2px solid var(--primary-teal);
}

.btn-outline:hover {
    background: var(--primary-teal);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
}

.btn-info {
    background: linear-gradient(135deg, #20b3b0 0%, #4ec9c6 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #88b63f 0%, #a3cd5f 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

/* ==========================================
   STATS CARDS - Glassmorphism Design
   ========================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.stat-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(100%);
    transition: var(--transition-base);
}

.stat-card:hover .stat-icon::after {
    transform: translateY(0);
}

.stat-details {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Stat Icon Color Variants */
.stat-icon.blue {
    background: linear-gradient(135deg, #20b3b0 0%, #4ec9c6 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #88b63f 0%, #a3cd5f 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
}

.stat-icon.red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
}

.stat-icon i {
    position: relative;
    z-index: 1;
    font-size: 1.75rem;
}

/* ==========================================
   CARDS - Premium Containers
   ========================================== */

.card {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color-light);
    overflow: hidden;
    transition: var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* Card with table - no padding to let table touch edges */
.card:has(.table-container) {
    padding: 0;
}

.card:has(.table-container) .table-container {
    margin: 0;
    border-radius: 0;
}

/* Dashboard-specific table adjustments */
.card .table td {
    padding: 1rem 1.5rem;
}

.card .table th {
    padding: 1rem 1.5rem;
    font-size: 0.8125rem;
}

.card-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-subtle);
}

.card-header h3,
.card-header .card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.card-body {
    padding: 2rem;
}

/* ==========================================
   FORMS - Elegant Input Design
   ========================================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background: white;
    transition: var(--transition-base);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(32, 179, 176, 0.1);
}

.form-input::placeholder {
    color: var(--text-light);
}

.input-error {
    border-color: var(--danger-color) !important;
    background-color: rgba(231, 76, 60, 0.05);
}

.validation-error {
    display: block;
    color: var(--danger-color);
    font-size: 0.8125rem;
    margin-top: 0.375rem;
    font-weight: 500;
}

.form-input:focus.input-error {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.search-input {
    padding: 0.75rem 1.125rem;
    padding-left: 2.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    width: 100%;
    max-width: 400px;
    background: white url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2377797c"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') no-repeat 1rem center;
    background-size: 18px;
    transition: var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(32, 179, 176, 0.1);
}

/* ==========================================
   TABLES - Clean Data Display
   ========================================== */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-table thead {
    background: var(--gradient-subtle);
}

.data-table th {
    padding: 1.125rem 1.25rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-teal);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gradient-subtle);
    transform: scale(1.01);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

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

/* ==========================================
   TABLE STYLES - Clean & Comfortable
   ========================================== */

.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9375rem;
    background: var(--card-bg);
}

.table thead {
    background: linear-gradient(135deg, rgba(32, 179, 176, 0.08) 0%, rgba(136, 182, 63, 0.08) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table th {
    padding: 1.25rem 1.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-teal);
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.95);
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-primary);
    vertical-align: middle;
    line-height: 1.6;
}

.table tbody tr {
    transition: all 0.2s ease;
    background: var(--card-bg);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(32, 179, 176, 0.04) 0%, rgba(136, 182, 63, 0.04) 100%);
    box-shadow: inset 4px 0 0 var(--primary-teal);
}

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

/* Column-specific widths for optimal layout */
.table th:nth-child(1),
.table td:nth-child(1) { 
    min-width: 160px; /* Date/Time */
    width: 14%;
}

.table th:nth-child(2),
.table td:nth-child(2) { 
    min-width: 180px; /* Patient Name */
    width: 16%;
}

.table th:nth-child(3),
.table td:nth-child(3) { 
    min-width: 150px; /* Caller */
    width: 14%;
}

.table th:nth-child(4),
.table td:nth-child(4) { 
    min-width: 140px; /* Contact */
    width: 13%;
}

.table th:nth-child(5),
.table td:nth-child(5) { 
    min-width: 140px; /* Membership ID */
    width: 13%;
}

.table th:nth-child(6),
.table td:nth-child(6) { 
    min-width: 140px; /* Status */
    width: 13%;
}

.table th:nth-child(7),
.table td:nth-child(7) { 
    min-width: 120px; /* Assigned To */
    width: 11%;
}

.table th:nth-child(8),
.table td:nth-child(8) { 
    min-width: 140px; /* Actions */
    width: 6%;
    text-align: center;
}

.table td strong {
    font-weight: 600;
    color: var(--charcoal-gray);
}

/* Action Buttons in Tables */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
}

.action-buttons .btn-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.action-buttons .btn-icon:hover {
    transform: translateY(-2px) scale(1.05);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    color: var(--tagline-gray);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.empty-state p {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ==========================================
   BADGES - Status Indicators
   ========================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: linear-gradient(135deg, rgba(136, 182, 63, 0.15) 0%, rgba(163, 205, 95, 0.15) 100%);
    color: var(--leaf-green-dark);
    border: 1px solid rgba(136, 182, 63, 0.3);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.15) 0%, rgba(230, 126, 34, 0.15) 100%);
    color: #c87f0a;
    border: 1px solid rgba(243, 156, 18, 0.3);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.15) 0%, rgba(192, 57, 43, 0.15) 100%);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.badge-info {
    background: linear-gradient(135deg, rgba(32, 179, 176, 0.15) 0%, rgba(78, 201, 198, 0.15) 100%);
    color: var(--primary-teal-dark);
    border: 1px solid rgba(32, 179, 176, 0.3);
}

/* ==========================================
   MODALS - Premium Overlays
   ========================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid var(--border-color-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gradient-subtle);
}

.modal-header h3,
.modal-header h2,
.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    scroll-behavior: smooth;
}

/* Smooth scrollbar for modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--primary-teal);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #189a97;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color-light);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: var(--bg-color);
}

/* ==========================================
   TOAST NOTIFICATIONS - Elegant Alerts
   ========================================== */

.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 300px;
    max-width: 400px;
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--leaf-green);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--primary-teal);
}

.toast i {
    font-size: 1.25rem;
}

.toast.success i {
    color: var(--leaf-green);
}

.toast.error i {
    color: var(--danger-color);
}

.toast.warning i {
    color: var(--warning-color);
}

.toast.info i {
    color: var(--primary-teal);
}

/* ==========================================
   LOADING STATES - Smooth Feedback
   ========================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.active {
    display: flex; /* Show when active */
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--tagline-gray);
    border-top-color: var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================
   FILTER & BULK ACTION TOOLBARS
   ========================================== */

.filter-active-indicator {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-active-indicator i {
    font-size: 1.125rem;
}

.filter-active-indicator span {
    font-weight: 600;
    flex: 1;
}

.btn-clear-filters {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-clear-filters:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.bulk-actions-toolbar {
    background: var(--gradient-secondary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: none;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease-out;
}

.bulk-actions-toolbar.active {
    display: flex;
}

.bulk-selected-count {
    font-weight: 700;
    font-size: 0.9375rem;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex: 1;
}

.btn-bulk-action {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 0.625rem 1.125rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-bulk-action:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-2px);
}

.btn-bulk-action.danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

/* ==========================================
   CHECKBOXES - Custom Styling
   ========================================== */

.checkbox-cell {
    width: 48px;
    text-align: center;
}

.row-checkbox, .select-all-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-teal);
}

/* ==========================================
   DETAIL VIEWS - Comprehensive Display
   ========================================== */

.detail-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-teal);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.detail-item {
    background: var(--gradient-subtle);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color-light);
    transition: var(--transition-base);
}

.detail-item:hover {
    background: white;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.detail-label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.375rem;
}

.detail-value {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ==========================================
   EXPORT/PRINT STYLES
   ========================================== */

.export-print-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-export, .btn-print-table {
    background: var(--gradient-secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-base);
}

.btn-export:hover, .btn-print-table:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-print-table {
    background: var(--gradient-primary);
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .sidebar, .header, .btn, button, .modal-close, .actions-cell, 
    .filter-active-indicator, .bulk-actions-toolbar, 
    .export-print-group, .page-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    .data-table {
        border: 1px solid var(--charcoal-gray);
    }
    
    .data-table th, .data-table td {
        border: 1px solid var(--medium-gray);
        padding: 0.5rem;
    }
    
    body {
        background: white;
    }
    
    .card, .stat-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .page-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.hidden {
    display: none !important;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}
