/**
 * ========================================
 * UNIFIED E-COMMERCE DESIGN SYSTEM
 * ========================================
 * Shared theme for Admin, Seller, and Client dashboards
 * Built on Bootstrap 4 with custom variable overrides
 * Version: 1.0
 */

/* ===== GOOGLE FONTS IMPORT ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Lato:wght@300;400;700;900&display=swap');

/* ========================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ======================================== */
:root {
    /* === PRIMARY COLOR PALETTE === */
    --primary-color: #28a745;
    --primary-hover: #218838;
    --primary-active: #1e7e34;
    --primary-light: #90EE90;
    --primary-dark: #155724;

    /* === SECONDARY COLORS === */
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --secondary-light: #e9ecef;

    /* === BACKGROUND COLORS === */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-dark: #343a40;

    /* === TEXT COLORS === */
    --text-primary: #000000;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-light: #ffffff;

    /* === STATE COLORS === */
    --success-color: #28a745;
    --success-hover: #218838;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
    --warning-color: #ffc107;
    --warning-hover: #e0a800;
    --info-color: #17a2b8;
    --info-hover: #138496;

    /* === NATURE-INSPIRED ACCENT COLORS === */
    --sage-green: #A8C3A0;
    --soft-cream: #F5F2E9;
    --deep-forest: #3E5C46;
    --golden-brown: #C6A571;
    --earth-brown: #8B7355;

    /* === TYPOGRAPHY === */
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Font Sizes */
    --font-xs: 0.75rem;
    /* 12px */
    --font-sm: 0.875rem;
    /* 14px */
    --font-base: 1rem;
    /* 16px */
    --font-lg: 1.125rem;
    /* 18px */
    --font-xl: 1.25rem;
    /* 20px */
    --font-2xl: 1.5rem;
    /* 24px */
    --font-3xl: 1.875rem;
    /* 30px */
    --font-4xl: 2.25rem;
    /* 36px */
    --font-5xl: 3rem;
    /* 48px */

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-normal: 1.6;
    --leading-relaxed: 1.75;

    /* === SPACING SYSTEM === */
    --space-xs: 0.5rem;
    /* 8px */
    --space-sm: 1rem;
    /* 16px */
    --space-md: 1.5rem;
    /* 24px */
    --space-lg: 2rem;
    /* 32px */
    --space-xl: 3rem;
    /* 48px */
    --space-2xl: 4rem;
    /* 64px */
    --space-3xl: 6rem;
    /* 96px */

    /* === BORDER RADIUS === */
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    /* 6px */
    --radius-lg: 0.5rem;
    /* 8px */
    --radius-xl: 0.75rem;
    /* 12px */
    --radius-2xl: 1rem;
    /* 16px */
    --radius-full: 9999px;
    /* Full rounded */

    /* === SHADOWS === */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-nature: 0 4px 14px 0 rgba(40, 167, 69, 0.15);

    /* === TRANSITIONS === */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* === BORDER COLORS === */
    --border-light: #dee2e6;
    --border-medium: #ced4da;
    --border-dark: #adb5bd;

    /* === GRADIENTS === */
    --gradient-primary: linear-gradient(180deg, #28a745 10%, #1e7e34 100%);
    --gradient-secondary: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* ========================================
   BASE STYLES & RESETS
   ======================================== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: var(--leading-normal);
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary) !important;
    background-color: var(--bg-primary) !important;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* ========================================
   TYPOGRAPHY SYSTEM
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: var(--font-5xl);
    font-weight: var(--font-bold);
}

h2 {
    font-size: var(--font-4xl);
    font-weight: var(--font-semibold);
}

h3 {
    font-size: var(--font-3xl);
    font-weight: var(--font-semibold);
}

h4 {
    font-size: var(--font-2xl);
    font-weight: var(--font-medium);
}

h5 {
    font-size: var(--font-xl);
    font-weight: var(--font-medium);
}

h6 {
    font-size: var(--font-lg);
    font-weight: var(--font-medium);
}

p {
    margin: 0 0 var(--space-md) 0;
    color: var(--text-primary);
    line-height: var(--leading-relaxed);
}

/* Text Utilities */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    font-family: var(--font-body);
    font-size: var(--font-base);
    font-weight: var(--font-medium);
    line-height: var(--leading-normal);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    min-height: 44px;
    user-select: none;
}

.btn:focus,
.btn:active {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-light) !important;
}

.btn-primary:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--text-light) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    background-color: var(--primary-active) !important;
    border-color: var(--primary-active) !important;
    transform: translateY(0);
}

.btn-success {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: var(--text-light) !important;
}

.btn-success:hover {
    background-color: var(--success-hover) !important;
    border-color: var(--success-hover) !important;
    color: var(--text-light) !important;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: var(--text-light) !important;
}

.btn-danger:hover {
    background-color: var(--danger-hover) !important;
    border-color: var(--danger-hover) !important;
    color: var(--text-light) !important;
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--warning-color) !important;
    border-color: var(--warning-color) !important;
    color: var(--text-primary) !important;
}

.btn-warning:hover {
    background-color: var(--warning-hover) !important;
    border-color: var(--warning-hover) !important;
    color: var(--text-primary) !important;
}

.btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
}

.btn-secondary:hover {
    background-color: var(--secondary-hover) !important;
    border-color: var(--secondary-hover) !important;
    color: var(--text-light) !important;
}

.btn-outline-primary {
    background-color: transparent !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-light) !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: var(--font-sm);
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: var(--font-lg);
    border-radius: var(--radius-lg);
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - CARDS
   ======================================== */
.card {
    background-color: var(--bg-primary) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text-primary) !important;
    transition: all var(--transition-normal);
    margin-bottom: var(--space-md);
}

.card:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-2px);
}

.card-header {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 0.75rem 1.25rem;
    font-weight: var(--font-semibold);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
}

.card-body {
    padding: 1.25rem;
    flex: 1 1 auto;
}

.card-footer {
    background-color: var(--bg-secondary) !important;
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1.25rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - TABLES
   ======================================== */
.table {
    width: 100%;
    margin-bottom: var(--space-lg);
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-collapse: collapse;
}

.table th {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
    border-color: var(--border-light) !important;
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    font-size: var(--font-sm);
    padding: 0.75rem;
    border-top: none;
    border-bottom: 2px solid var(--border-light);
    vertical-align: bottom;
}

.table td {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-light) !important;
    padding: 0.75rem;
    vertical-align: middle;
    border-top: 1px solid var(--border-light);
}

.table tbody tr:nth-child(even) td {
    background-color: var(--bg-secondary) !important;
}

.table tbody tr:hover td {
    background-color: var(--bg-tertiary) !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - FORMS
   ======================================== */
.form-control {
    display: block;
    width: 100%;
    height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    font-family: var(--font-body);
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    background-color: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
}

.form-group {
    margin-bottom: var(--space-sm);
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - BADGES
   ======================================== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-xs);
    font-weight: var(--font-semibold);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--radius-md);
}

.badge-primary {
    background-color: var(--primary-color) !important;
    color: var(--text-light) !important;
}

.badge-success {
    background-color: var(--success-color) !important;
    color: var(--text-light) !important;
}

.badge-danger {
    background-color: var(--danger-color) !important;
    color: var(--text-light) !important;
}

.badge-warning {
    background-color: var(--warning-color) !important;
    color: var(--text-primary) !important;
}

.badge-info {
    background-color: var(--info-color) !important;
    color: var(--text-light) !important;
}

.badge-secondary {
    background-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - ALERTS
   ======================================== */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: var(--space-sm);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-weight: var(--font-medium);
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - MODALS (UNIFIED)
   ======================================== */

/* Modal Backdrop - Facebook Style */
.modal-backdrop {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-backdrop.show {
    opacity: 0.4;
}

/* Modal Dialog Container - Facebook Style */
.modal-dialog {
    margin: 2rem auto;
    max-width: 400px;
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 4rem);
}

.modal-dialog-scrollable {
    max-height: calc(100% - 4rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100% - 4rem);
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* Modal Sizes - Facebook Style */
.modal-sm {
    max-width: 350px;
}

.modal-lg {
    max-width: 500px;
}

.modal-xl {
    max-width: 600px;
}

/* Modal Content - Facebook Style */
.modal-content {
    background-color: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    outline: 0;
    overflow: hidden;
}

/* Modal Header - Facebook Style */
.modal-header {
    background-color: #ffffff;
    color: #1c1e21;
    border-bottom: 1px solid #dadde1;
    padding: 24px 24px 16px 24px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
}

/* Modal Title - Facebook Style */
.modal-title {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1c1e21;
    margin: 0;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: normal;
}

.modal-subtitle {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #606770;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.modal-header h5.modal-title,
.modal-header h4.modal-title {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: #1c1e21;
}

/* Modal Close Button - Facebook Style */
.modal .close,
.modal-header .close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background-color: #f0f2f5;
    border: none;
    border-radius: 50%;
    color: #606770;
    font-size: 20px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 1;
    padding: 0;
    margin: 0;
    text-shadow: none;
    line-height: 1;
}

.modal .close:hover,
.modal-header .close:hover,
.modal .close:focus,
.modal-header .close:focus {
    background-color: #e4e6ea;
    color: #1c1e21;
    opacity: 1;
    outline: none;
    transform: none;
}

.modal .close span,
.modal-header .close span {
    color: #606770;
    font-size: 20px;
    font-weight: 400;
}

/* Modal Body - Facebook Style */
.modal-body {
    background-color: #ffffff;
    color: #1c1e21;
    padding: 0 24px 24px 24px;
    position: relative;
    flex: 1 1 auto;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 17px;
    line-height: 1.4;
    overflow-y: auto;
}

.modal-body p {
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    margin-bottom: var(--space-sm);
}

.modal-body label {
    font-family: var(--font-body);
    font-weight: var(--font-semibold);
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Modal Body - Form Controls - Facebook Style */
.modal-body .form-control {
    background-color: #ffffff;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    color: #1c1e21;
    font-size: 17px;
    font-weight: 400;
    padding: 14px 16px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    display: block;
    line-height: 1.4;
    background-clip: padding-box;
}

.modal-body .form-control:focus {
    background-color: #ffffff;
    border-color: #1877f2;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
    color: #1c1e21;
    outline: none;
}

.modal-body .form-control::placeholder {
    color: #8a8d91;
    font-weight: 400;
    opacity: 1;
}

.modal-body .form-control:disabled,
.modal-body .form-control[readonly] {
    background-color: #f0f2f5;
    color: #8a8d91;
    cursor: not-allowed;
    opacity: 1;
}

.modal-body .form-row {
    display: flex;
    gap: 8px;
}

.modal-body .form-row .form-control {
    flex: 1;
}

.modal-body .form-label {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #606770;
    margin-bottom: 8px;
    display: block;
}

.modal-body .form-label .info-icon {
    color: #8a8d91;
    margin-left: 4px;
    cursor: help;
}

.modal-body .form-check {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.modal-body .form-check-input {
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 2px solid #8a8d91;
    border-radius: 50%;
    margin-right: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0;
}

.modal-body .form-check-input:checked {
    background-color: #1877f2;
    border-color: #1877f2;
}

.modal-body .form-check-input:checked::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #ffffff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal-body .form-check-label {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #1c1e21;
    cursor: pointer;
    margin-bottom: 0;
}

.modal-body .legal-text {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #8a8d91;
    line-height: 1.4;
    margin: 16px 0;
}

.modal-body .legal-text a {
    color: #1877f2;
    text-decoration: none;
}

.modal-body .legal-text a:hover {
    text-decoration: underline;
}

/* Modal Body - Textareas */
.modal-body textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Modal Body - Select Dropdowns */
.modal-body select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 8px 10px;
    padding-right: 2rem;
}

/* Modal Body - Checkboxes and Radios */
.modal-body .form-check-input {
    margin-top: 0.3rem;
}

.modal-body .form-check-label {
    font-weight: var(--font-normal);
    margin-bottom: 0;
}

/* Modal Body - Input Groups */
.modal-body .input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.modal-body .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
}

/* Modal Body - Form Groups */
.modal-body .form-group {
    margin-bottom: 1.25rem;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

/* Modal Body - File Inputs */
.modal-body .custom-file-label {
    font-family: var(--font-body);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
}

.modal-body .custom-file-label::after {
    background-color: var(--bg-secondary);
    border-left: 1px solid var(--border-medium);
}

/* Modal Body - Images and Media */
.modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

/* Modal Body - Lists */
.modal-body ul,
.modal-body ol {
    padding-left: 1.5rem;
    margin-bottom: var(--space-sm);
}

.modal-body ul li,
.modal-body ol li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Modal Footer - Facebook Style */
.modal-footer {
    background-color: #ffffff;
    border-top: none;
    padding: 0 24px 24px 24px;
    border-radius: 0 0 12px 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.modal-footer .btn-primary {
    background-color: #42b883;
    border: none;
    color: #ffffff;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 12px 0;
    border-radius: 6px;
    width: 100%;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    min-width: auto;
}

.modal-footer .btn-primary:hover {
    background-color: #369870;
    transform: none;
    box-shadow: none;
}

.modal-footer .btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(66, 184, 131, 0.3);
}

.modal-footer .btn-secondary {
    background-color: #ffffff;
    border: 1px solid #dadde1;
    color: #1c1e21;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    padding: 12px 24px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    min-width: auto;
}

.modal-footer .btn-secondary:hover {
    background-color: #f0f2f5;
    border-color: #dadde1;
    color: #1c1e21;
}

.modal-footer .btn-outline-secondary {
    color: #1877f2;
    border: none;
    background: none;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    font-weight: 400;
    padding: 12px 0;
    text-decoration: none;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    min-width: auto;
}

.modal-footer .btn-outline-secondary:hover {
    background-color: transparent;
    color: #1877f2;
    text-decoration: underline;
}

.modal-footer .btn-primary:hover,
.modal-footer .btn-primary:focus {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: var(--text-light) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.modal-footer .btn-secondary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
    font-family: var(--font-body);
    font-weight: var(--font-medium);
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-md);
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-secondary:focus {
    background-color: var(--secondary-hover) !important;
    border-color: var(--secondary-hover) !important;
    color: var(--text-light) !important;
}

.modal-footer .btn-outline-secondary {
    background-color: transparent !important;
    border-color: var(--secondary-color) !important;
    color: var(--secondary-color) !important;
}

.modal-footer .btn-outline-secondary:hover {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: var(--text-light) !important;
}

/* Modal Footer - Button Order */
.modal-footer>* {
    margin: 0.25rem;
}

.modal-footer>*:first-child {
    margin-left: 0;
}

.modal-footer>*:last-child {
    margin-right: 0;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Modal Scrollbar */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-sm);
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--border-dark);
}

/* Modal - Specific Modal Types */
/* Login Modal */
.modal .login-modal .modal-body,
.modal .register-modal .modal-body,
.modal .forgot-password-modal .modal-body {
    padding: 2rem 1.5rem;
}

/* Product Modal */
.modal .product-modal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Confirmation Modal */
.modal .confirm-modal .modal-body {
    text-align: center;
    padding: 2rem 1.5rem;
}

.modal .confirm-modal .modal-body i {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}

/* Order Details Modal */
.modal .order-modal .modal-body table {
    margin-bottom: 0;
}

/* Modal - Alert Styles Inside Modal */
.modal-body .alert {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: var(--font-sm);
}

.modal-body .alert:last-child {
    margin-bottom: 0;
}

.modal-body .alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.modal-body .alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.modal-body .alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.modal-body .alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Modal - Links Inside Modal */
.modal-body a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: var(--font-medium);
    transition: color var(--transition-fast);
}

.modal-body a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Modal - Dividers */
.modal-body hr {
    border-top: 1px solid var(--border-light);
    margin: 1rem 0;
}

/* Modal - Text Utilities */
.modal-body .text-muted {
    color: var(--text-muted) !important;
    font-size: var(--font-sm);
}

.modal-body .text-center {
    text-align: center;
}

.modal-body .text-right {
    text-align: right;
}

/* Modal - Helper Text */
.modal-body small,
.modal-body .small {
    font-size: var(--font-sm);
    color: var(--text-muted);
}

/* Modal - Required Field Indicator */
.modal-body label.required::after,
.modal-body .form-label.required::after {
    content: " *";
    color: var(--danger-color);
    font-weight: var(--font-bold);
}

/* Modal - Form Validation States */
.modal-body .form-control.is-valid {
    border-color: var(--success-color);
}

.modal-body .form-control.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.modal-body .form-control.is-invalid {
    border-color: var(--danger-color);
}

.modal-body .form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.modal-body .valid-feedback {
    display: block;
    color: var(--success-color);
    font-size: var(--font-sm);
    margin-top: 0.25rem;
}

.modal-body .invalid-feedback {
    display: block;
    color: var(--danger-color);
    font-size: var(--font-sm);
    margin-top: 0.25rem;
}

/* Modal - Loading State */
.modal-body .spinner-border {
    width: 2rem;
    height: 2rem;
    border-width: 0.25rem;
    color: var(--primary-color);
}

.modal-body .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

/* ========================================
   BOOTSTRAP 4 OVERRIDES - NAVBAR
   ======================================== */
.navbar {
    background-color: var(--primary-color) !important;
    border-bottom: 1px solid var(--primary-active);
    padding: var(--space-sm) 0;
    box-shadow: var(--shadow-nature);
}

/* Force green background for all navbar variants */
.navbar-dark,
.navbar-light,
.navbar-primary,
.navbar-success,
.navbar-expand-lg {
    background-color: var(--primary-color) !important;
}

/* Ensure navbar-dark doesn't override our green background */
.navbar-dark.navbar-expand-lg {
    background-color: var(--primary-color) !important;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: var(--font-xl);
    font-weight: var(--font-bold);
    color: var(--text-light) !important;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--primary-light) !important;
    text-decoration: none;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: var(--font-medium);
    font-size: var(--font-sm);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    padding: 0.5rem 1rem !important;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

.navbar-nav .nav-link:hover {
    color: var(--text-light) !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active {
    color: var(--text-light) !important;
    font-weight: var(--font-semibold);
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Additional specificity to override Bootstrap navbar-dark */
body .navbar.navbar-dark,
body .navbar.navbar-dark.navbar-expand-lg,
body .navbar.navbar-expand-lg.navbar-dark {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
}

/* Force override for any navbar with dark class */
.navbar-dark {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
}

/* Ensure the navbar background is green regardless of Bootstrap classes */
nav.navbar,
nav.navbar.navbar-dark,
nav.navbar.navbar-expand-lg {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
}

/* Custom navbar class for client */
.navbar-custom {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
}

/* Ensure navbar-custom has proper text colors */
.navbar-custom .navbar-brand,
.navbar-custom .nav-link,
.navbar-custom .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-custom .navbar-brand:hover,
.navbar-custom .nav-link:hover {
    color: var(--text-light) !important;
}

/* Force white text for navbar-custom */
.navbar-custom * {
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar-custom .navbar-brand {
    color: var(--text-light) !important;
}

/* Navbar Auth Buttons - Enhanced Styling */
.navbar .btn-outline-light {
    border: 3px solid rgba(255, 255, 255, 0.9);
    color: rgba(255, 255, 255, 0.95);
    background-color: transparent;
    font-weight: var(--font-bold);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-size: var(--font-base);
    min-width: 120px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--text-light);
    color: var(--text-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-width: 3px;
}

.navbar .btn-light {
    background-color: var(--text-light);
    color: var(--primary-color);
    border: 3px solid var(--text-light);
    font-weight: var(--font-extrabold);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    font-size: var(--font-base);
    min-width: 160px;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.navbar .btn-light:hover {
    background-color: var(--primary-light);
    color: var(--text-light);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Auth button icons */
.navbar .btn i {
    font-size: var(--font-base);
    font-weight: var(--font-bold);
}

/* Enhanced button focus states */
.navbar .btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Mobile responsive auth buttons */
@media (max-width: 991.98px) {

    .navbar .btn-outline-light,
    .navbar .btn-light {
        width: 100%;
        margin-bottom: 0.75rem;
        text-align: center;
        min-width: auto;
        padding: 0.875rem 1.5rem;
        font-size: var(--font-lg);
    }

    .navbar .btn-outline-light:last-child,
    .navbar .btn-light:last-child {
        margin-bottom: 0;
    }

    .navbar .btn i {
        font-size: var(--font-lg);
    }
}

/* Navbar Dropdown */
.navbar .dropdown-toggle {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8) !important;
}

.navbar .dropdown-toggle:hover {
    color: var(--text-light) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: var(--font-sm);
    color: var(--text-primary);
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    margin-right: 0.5rem;
}

.dropdown-divider {
    border-top: 1px solid var(--border-light);
    margin: 0.5rem 0;
}

/* ========================================
   SIDEBAR STYLES (Admin & Seller)
   ======================================== */
.sidebar {
    flex: 0 0 14rem;
    width: 14rem;
    background: var(--gradient-primary) !important;
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.25rem;
    padding: 0.75rem 1rem;
    font-size: var(--font-base);
    font-weight: var(--font-extrabold);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--text-light) !important;
    text-decoration: none;
}

.sidebar-brand-icon {
    font-size: var(--font-4xl);
    color: var(--text-light);
}

.sidebar-brand-text {
    font-size: var(--font-sm);
    font-weight: var(--font-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    color: var(--text-light);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 0.75rem !important;
    font-weight: var(--font-normal) !important;
    font-size: var(--font-sm) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05rem !important;
    border-radius: var(--radius-md) !important;
    margin: 0 0.5rem !important;
    transition: all var(--transition-fast) !important;
}

.sidebar .nav-link:hover {
    color: var(--text-light) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link.active {
    color: var(--text-light) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    font-weight: var(--font-medium) !important;
}

.sidebar .nav-link i {
    font-size: var(--font-sm);
    margin-right: 0.25rem;
}

.sidebar-heading {
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: var(--font-xs) !important;
    font-weight: var(--font-extrabold) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1rem !important;
    padding: 0.5rem 1rem !important;
    margin-top: var(--space-sm) !important;
}

.sidebar-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    margin: var(--space-sm) 0 !important;
}

/* Wrapper for Sidebar Layout */
#wrapper {
    display: flex;
    min-height: 100vh;
}

#content-wrapper {
    flex: 1 1 auto;
    width: 100%;
}

/* ========================================
   PROFILE AVATAR STYLING
   ======================================== */
.navbar-brand img,
.dropdown-toggle img,
.nav-link img {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
    transition: border-color var(--transition-fast);
}

.navbar-brand img:hover,
.dropdown-toggle img:hover,
.nav-link img:hover {
    border-color: rgba(255, 255, 255, 0.6) !important;
}

.navbar-brand img:focus,
.dropdown-toggle img:focus,
.nav-link img:focus {
    border: 2px solid rgba(255, 255, 255, 0.5) !important;
    outline: none !important;
    box-shadow: none !important;
}

img[alt="Profile"] {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    outline: none !important;
    box-shadow: none !important;
    background: none !important;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: var(--radius-md);
    justify-content: center;
}

.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary-color);
    text-decoration: none;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.page-link:hover {
    z-index: 2;
    color: var(--primary-hover);
    text-decoration: none;
    background-color: var(--bg-tertiary);
    border-color: var(--border-light);
}

.page-item.active .page-link {
    z-index: 3;
    color: var(--text-light);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow {
    box-shadow: var(--shadow-md) !important;
}

.shadow-lg {
    box-shadow: var(--shadow-lg) !important;
}

.rounded {
    border-radius: var(--radius-md) !important;
}

.rounded-lg {
    border-radius: var(--radius-lg) !important;
}

.rounded-xl {
    border-radius: var(--radius-xl) !important;
}

.rounded-full {
    border-radius: var(--radius-full) !important;
}

.border {
    border: 1px solid var(--border-light) !important;
}

.border-0 {
    border: 0 !important;
}

.bg-light {
    background-color: var(--bg-secondary) !important;
}

.bg-white {
    background-color: var(--bg-primary) !important;
}

.font-weight-bold {
    font-weight: var(--font-bold) !important;
}

.font-weight-semibold {
    font-weight: var(--font-semibold) !important;
}

.font-weight-medium {
    font-weight: var(--font-medium) !important;
}

.font-weight-normal {
    font-weight: var(--font-normal) !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

/* ========================================
   RESPONSIVE DESIGN - COMPREHENSIVE
   ======================================== */

/* === MOBILE FIRST: Extra Small Devices (Portrait Phones, <576px) === */
@media (max-width: 575.98px) {

    /* Typography Scaling */
    :root {
        --font-xs: 0.7rem;
        --font-sm: 0.8rem;
        --font-base: 0.875rem;
        --font-lg: 0.95rem;
        --font-xl: 1.05rem;
        --font-2xl: 1.15rem;
        --font-3xl: 1.35rem;
        --font-4xl: 1.65rem;
        --font-5xl: 2rem;
        --space-sm: 0.75rem;
        --space-md: 1rem;
        --space-lg: 1.5rem;
    }

    /* Body & Container */
    body {
        font-size: 0.875rem;
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    /* Sidebar - Stack on Mobile */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 280px;
        height: 100vh;
        z-index: 1050;
        transition: left var(--transition-normal);
    }

    .sidebar.active {
        left: 0;
    }

    #wrapper {
        flex-direction: column;
    }

    #content-wrapper {
        width: 100%;
        margin-left: 0;
    }

    /* Cards - Full Width on Mobile */
    .card {
        margin-bottom: var(--space-sm);
        border-radius: var(--radius-md);
    }

    .card-body {
        padding: 0.875rem;
    }

    .card-header,
    .card-footer {
        padding: 0.5rem 0.875rem;
    }

    /* Buttons - Full Width Touch Targets */
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        min-height: 44px;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-sm {
        padding: 0.375rem 0.75rem;
        min-height: 38px;
        font-size: 0.8rem;
    }

    .btn-lg {
        padding: 0.875rem 1.25rem;
        min-height: 50px;
        font-size: 0.95rem;
    }

    /* Forms - Full Width */
    .form-control {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 0.625rem 0.75rem;
        min-height: 44px;
    }

    .form-group {
        margin-bottom: 0.875rem;
    }

    textarea.form-control {
        min-height: 100px;
    }

    /* Tables - Responsive Scroll */
    .table-responsive {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.8rem;
        margin-bottom: var(--space-md);
    }

    .table th,
    .table td {
        padding: 0.5rem 0.375rem;
        white-space: nowrap;
    }

    .table thead th {
        font-size: 0.75rem;
    }

    /* Modals - Full Screen on Mobile */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
        min-height: 100vh;
    }

    .modal-content {
        height: 100%;
        border-radius: 0;
        border: none;
    }

    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }

    .modal-body {
        padding: 1rem;
        overflow-y: auto;
    }

    /* Navbar - Mobile Stack */
    .navbar {
        padding: 0.5rem 0.75rem;
    }

    .navbar-brand {
        font-size: 1.05rem;
    }

    .navbar-nav {
        width: 100%;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.625rem 0.75rem !important;
        border-radius: var(--radius-sm);
    }

    /* Dropdown - Full Width */
    .dropdown-menu {
        width: 100%;
        border-radius: var(--radius-md);
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    /* Badges - Smaller */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    /* Pagination - Compact */
    .pagination {
        font-size: 0.8rem;
    }

    .page-link {
        padding: 0.375rem 0.5rem;
    }

    /* Alerts - Compact */
    .alert {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    /* Hide Desktop Elements */
    .d-mobile-none {
        display: none !important;
    }
}

/* === SMALL DEVICES: Landscape Phones (576px - 767.98px) === */
@media (min-width: 576px) and (max-width: 767.98px) {
    :root {
        --font-xs: 0.75rem;
        --font-sm: 0.85rem;
        --font-base: 0.9rem;
        --font-lg: 1rem;
        --font-xl: 1.125rem;
        --font-2xl: 1.25rem;
        --font-3xl: 1.5rem;
        --font-4xl: 1.875rem;
        --font-5xl: 2.25rem;
    }

    .container {
        max-width: 540px;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        width: 260px;
        height: 100vh;
        z-index: 1050;
        transition: left var(--transition-normal);
    }

    .sidebar.active {
        left: 0;
    }

    .btn {
        width: auto;
        display: inline-block;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-dialog {
        max-width: 500px;
        margin: 1rem auto;
    }
}

/* === MEDIUM DEVICES: Tablets (768px - 991.98px) === */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }

    /* Sidebar - Collapsible on Tablets */
    .sidebar {
        flex: 0 0 12rem;
        width: 12rem;
    }

    .sidebar.collapsed {
        flex: 0 0 4rem;
        width: 4rem;
    }

    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .nav-link span {
        display: none;
    }

    /* Tables - Adjust Spacing */
    .table th,
    .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
    }

    /* Cards - Two Column Layout */
    .card-columns {
        column-count: 2;
    }

    /* Navbar - Collapsed */
    .navbar-nav .nav-link {
        padding: 0.5rem 0.875rem !important;
    }
}

/* === LARGE DEVICES: Desktops (992px - 1199.98px) === */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }

    .sidebar {
        flex: 0 0 14rem;
        width: 14rem;
    }

    /* Navbar - Horizontal */
    .navbar-nav {
        flex-direction: row !important;
        align-items: center !important;
    }

    .navbar-nav .nav-item {
        margin: 0 0.25rem !important;
    }

    .navbar-nav .nav-link {
        white-space: nowrap !important;
    }

    /* Cards - Three Column Layout */
    .card-columns {
        column-count: 3;
    }
}

/* === EXTRA LARGE DEVICES: Large Desktops (≥1200px) === */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .sidebar {
        flex: 0 0 14rem;
        width: 14rem;
    }

    /* Cards - Four Column Layout */
    .card-columns {
        column-count: 4;
    }

    /* Wider Modals */
    .modal-lg {
        max-width: 900px;
    }

    .modal-xl {
        max-width: 1140px;
    }
}

/* === NAVBAR RESPONSIVE BEHAVIOR === */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: var(--radius-md);
        margin-top: 0.5rem;
    }

    .navbar-nav {
        flex-direction: column !important;
        align-items: flex-start !important;
        width: 100% !important;
    }

    .navbar-nav .nav-item {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }

    .navbar-nav .nav-link {
        width: 100% !important;
        justify-content: flex-start !important;
        display: flex !important;
        align-items: center !important;
    }

    .navbar-nav .dropdown-menu {
        width: 100%;
        border: none;
        background-color: rgba(255, 255, 255, 0.05);
        margin-top: 0.5rem;
    }

    .navbar-nav .dropdown-item {
        color: rgba(255, 255, 255, 0.8) !important;
    }

    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--text-light) !important;
    }
}

@media (min-width: 992px) {
    .navbar-nav {
        flex-direction: row !important;
        align-items: center !important;
    }

    .navbar-nav .nav-item {
        margin: 0 0.25rem !important;
    }

    .navbar-nav .nav-link {
        white-space: nowrap !important;
    }

    .navbar-toggler {
        display: none;
    }
}

/* === SIDEBAR MOBILE OVERLAY === */
@media (max-width: 767.98px) {

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Sidebar Toggle Button */
    .sidebar-toggle {
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1060;
        background-color: var(--primary-color);
        color: var(--text-light);
        border: none;
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 575.98px) {
    .d-xs-none {
        display: none !important;
    }

    .d-xs-block {
        display: block !important;
    }
}

@media (min-width: 576px) {
    .d-sm-none {
        display: none !important;
    }

    .d-sm-block {
        display: block !important;
    }
}

@media (min-width: 768px) {
    .d-md-none {
        display: none !important;
    }

    .d-md-block {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }

    .d-lg-block {
        display: block !important;
    }
}

/* === TOUCH DEVICE OPTIMIZATIONS === */
@media (hover: none) and (pointer: coarse) {

    /* Larger touch targets */
    .btn,
    .nav-link,
    .dropdown-item,
    .page-link {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    .card:hover {
        transform: none;
    }

    /* Improve form inputs for touch */
    .form-control,
    select.form-control {
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 44px;
    }
}

/* === LANDSCAPE ORIENTATION OPTIMIZATION === */
@media (max-width: 991.98px) and (orientation: landscape) {
    .sidebar {
        position: fixed;
        left: -100%;
        z-index: 1050;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }

    .navbar {
        padding: 0.375rem 1rem;
    }
}

/* === PRINT RESPONSIVE === */
@media print {

    .sidebar,
    .navbar,
    .modal,
    .btn,
    .alert,
    .badge,
    .dropdown,
    .pagination {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }

    .table {
        border: 1px solid #000;
    }

    .container {
        max-width: 100%;
    }
}

/* ========================================
   ACCESSIBILITY 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;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn {
        border-width: 2px;
    }

    .card {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    .btn {
        border: 1px solid black;
    }

    .card {
        border: 1px solid black;
    }

    .navbar,
    .sidebar,
    .modal {
        display: none !important;
    }
}

/* ========================================
   CUSTOM ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 0.6s ease-in-out;
}

/* ========================================
   END OF UNIFIED DESIGN SYSTEM
   ======================================== */