/* ============================================================================
   DELIVERY HUB - UNIFIED STYLING SYSTEM
   ============================================================================ */

:root {
    /* Colors - Black & White */
    --primary-bg: #ffffff;
    --secondary-bg: #f5f5f5;
    --tertiary-bg: #eeeeee;
    --border-color: #cccccc;
    --light-border: #dddddd;

    --text-primary: #000000;
    --text-secondary: #555555;
    --text-muted: #888888;

    --success-bg: #e8e8e8;
    --success-text: #000000;
    --danger-bg: #e8e8e8;
    --danger-text: #000000;
    --warning-bg: #e8e8e8;
    --warning-text: #000000;
    --info-bg: #e8e8e8;
    --info-text: #000000;

    --button-dark: #000000;
    --button-dark-hover: #333333;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;
    --spacing-3xl: 40px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.04);

    /* Typography */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-base: 13px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ============================================================================
   PAGE LAYOUT & HEADERS
   ============================================================================ */

.page-title {
    margin-bottom: var(--spacing-xl);
}

.page-title h1 {
    margin: 0;
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.page-title p {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.page-header-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.page-header-subtitle {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================================================
   CARDS & CONTAINERS
   ============================================================================ */

.card {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.card-subtitle {
    margin: var(--spacing-xs) 0 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-wrapper {
    overflow-x: auto !important;
    border-radius: var(--radius-md) !important;
}

.card table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: var(--font-size-base) !important;
    margin: 0 !important;
}

.card table thead tr {
    text-align: left !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    background: var(--secondary-bg) !important;
}

.card table thead th {
    padding: var(--spacing-md) var(--spacing-sm) !important;
    font-weight: var(--font-weight-semibold) !important;
    font-size: var(--font-size-sm) !important;
    text-align: left !important;
    border: none !important;
}

.card table tbody tr {
    border-bottom: 1px solid var(--light-border) !important;
    transition: background-color 0.2s ease !important;
}

.card table tbody tr:hover {
    background-color: var(--tertiary-bg) !important;
}

.card table tbody td {
    padding: var(--spacing-md) var(--spacing-sm) !important;
    color: var(--text-primary) !important;
    border: none !important;
    vertical-align: middle !important;
}

.card table tbody td.text-secondary {
    color: var(--text-secondary) !important;
}

.card table tbody td.text-muted {
    color: var(--text-muted) !important;
}

.card table tbody tr:last-child {
    border-bottom: none !important;
}

/* ============================================================================
   BUTTONS - ACUMATICA STYLE (Black & White Enterprise Look)
   ============================================================================ */

/* Base Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.15);
}

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

/* Primary Button - Dark */
.btn-primary {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-color: #111827;
    color: #ffffff;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    border-color: #1f2937;
}

.btn-primary:active {
    background: #111827;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Secondary Button - Light */
.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-color: #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-color: #9ca3af;
}

.btn-secondary:active {
    background: #f3f4f6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    border-color: #111827;
    color: #111827;
}

.btn-outline:hover {
    background: #111827;
    color: #ffffff;
}

/* Ghost Button - No border */
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #374151;
    box-shadow: none;
}

.btn-ghost:hover {
    background: #f3f4f6;
}

/* Link Button - Text only */
.btn-link {
    background: transparent;
    border-color: transparent;
    color: #111827;
    text-decoration: underline;
    padding: 0 8px;
    height: auto;
    box-shadow: none;
}

.btn-link:hover {
    color: #374151;
}

/* Success Button */
.btn-success {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    border-color: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
}

/* Danger Button */
.btn-danger {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
}

/* Warning Button */
.btn-warning {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    border-color: #f59e0b;
    color: #111827;
}

.btn-warning:hover {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

/* Info Button */
.btn-info {
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
    border-color: #0891b2;
    color: #ffffff;
}

.btn-info:hover {
    background: linear-gradient(180deg, #0891b2 0%, #0e7490 100%);
}

/* Button Sizes */
.btn-xs {
    height: 24px;
    padding: 0 8px;
    font-size: 11px;
    border-radius: 2px;
}

.btn-sm {
    height: 28px;
    padding: 0 12px;
    font-size: 12px;
}

.btn-lg {
    height: 40px;
    padding: 0 24px;
    font-size: 14px;
}

.btn-xl {
    height: 48px;
    padding: 0 32px;
    font-size: 16px;
}

/* Full Width Button */
.btn-block {
    width: 100%;
}

/* Icon-only Button */
.btn-icon {
    width: 32px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 28px;
}

.btn-icon.btn-lg {
    width: 40px;
}

/* Button with Icon */
.btn-icon-left {
    padding-left: 12px;
}

.btn-icon-right {
    padding-right: 12px;
}

/* Button Group */
.btn-group {
    display: inline-flex;
    gap: 0;
}

.btn-group .btn {
    border-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:first-child {
    border-radius: 3px 0 0 3px;
    margin-left: 0;
}

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

.btn-group .btn:only-child {
    border-radius: 3px;
}

/* Spaced Button Group */
.btn-group-spaced {
    display: inline-flex;
    gap: 8px;
}

.btn-group-spaced .btn {
    border-radius: 3px;
    margin: 0;
}

/* Action Buttons for Tables */
.btn-action {
    height: 26px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-action-view {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #374151;
}

.btn-action-view:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.btn-action-edit {
    background: #111827;
    border: 1px solid #111827;
    color: #ffffff;
}

.btn-action-edit:hover {
    background: #1f2937;
}

.btn-action-delete {
    background: #ffffff;
    border: 1px solid #dc2626;
    color: #dc2626;
}

.btn-action-delete:hover {
    background: #dc2626;
    color: #ffffff;
}

/* Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* ============================================================================
   BADGES & TAGS
   ============================================================================ */

.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: capitalize;
}

.badge-success {
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
}

.badge-danger {
    background: #000000;
    color: #ffffff;
}

.badge-warning {
    background: #cccccc;
    color: #000000;
    border: 1px solid #000000;
}

.badge-info {
    background: #f5f5f5;
    color: #000000;
    border: 1px solid #000000;
}

.badge-secondary {
    background: #eeeeee;
    color: #000000;
    border: 1px solid #cccccc;
}

/* ============================================================================
   FORMS - ACUMATICA STYLE (Black & White Enterprise Look)
   ============================================================================ */

/* Form Container - Controls overall form width */
.form-container {
    width: 100%;
    max-width: 100%;
}

/* 8-column width (66.67%) - Standard form width */
.form-container-8 {
    max-width: 66.67%;
}

/* 10-column width (83.33%) - Wider forms */
.form-container-10 {
    max-width: 83.33%;
}

/* 6-column width (50%) - Narrow forms */
.form-container-6 {
    max-width: 50%;
}

/* Centered form container */
.form-container-centered {
    margin-left: auto;
    margin-right: auto;
}

/* Responsive adjustments for form containers */
@media (max-width: 1024px) {

    .form-container-6,
    .form-container-8,
    .form-container-10 {
        max-width: 100%;
    }
}

/* Form Panel - Main container for form sections */
.form-panel {
    background: var(--primary-bg);
    border: 1px solid #d1d5db;
    margin-bottom: var(--spacing-lg);
}

.form-panel-header {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border-bottom: 1px solid #d1d5db;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.form-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-panel-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #111827;
    border-radius: 2px;
}

.form-panel-body {
    padding: 16px;
}

/* Form Group - Individual field container */
.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

/* Acumatica-style: Label on same line as input */
.form-group-inline {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.form-group-inline .form-label {
    margin-bottom: 0;
    text-align: right;
}

/* Form Labels */
.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #374151;
    font-size: 12px;
    letter-spacing: 0.01em;
}

.form-label-required::after {
    content: ' *';
    color: #111827;
    font-weight: 700;
}

/* Form Controls - Inputs, Selects, Textareas */
.form-control {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 13px;
    color: #111827;
    background: #ffffff;
    transition: all 0.15s ease;
    font-family: inherit;
}

.form-control:hover {
    border-color: #9ca3af;
}

.form-control:focus {
    outline: none;
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(17, 24, 39, 0.08);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* Select dropdown styling */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    cursor: pointer;
}

/* Textarea styling */
textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 8px 10px;
    resize: vertical;
    line-height: 1.5;
}

/* Form Control Sizes */
.form-control-sm {
    height: 28px;
    font-size: 12px;
    padding: 0 8px;
}

.form-control-lg {
    height: 40px;
    font-size: 14px;
    padding: 0 12px;
}

/* Form Row - Grid layout for multiple fields */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-row-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* Field spanning full width */
.form-col-full {
    grid-column: 1 / -1;
}

/* Form Actions - Button toolbar at bottom */
.form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border-top: 1px solid #d1d5db;
    margin-top: 0;
}

.form-actions-right {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* Acumatica-style Toolbar Buttons */
.btn-toolbar {
    height: 30px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 3px;
    border: 1px solid;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-toolbar-primary {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.btn-toolbar-primary:hover {
    background: #1f2937;
    border-color: #1f2937;
}

.btn-toolbar-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.btn-toolbar-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Field Help Text */
.form-help {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.4;
}

/* Field Validation States */
.form-control.is-invalid {
    border-color: #111827;
    background: #fafafa;
}

.form-error {
    font-size: 11px;
    color: #111827;
    margin-top: 4px;
    font-weight: 500;
}

/* Readonly/Disabled Fields */
.form-control:disabled,
.form-control[readonly] {
    background: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Checkbox and Radio - Acumatica style */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-check-input {
    width: 16px;
    height: 16px;
    accent-color: #111827;
    cursor: pointer;
}

.form-check-label {
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

/* Field Group with Icon */
.form-control-icon {
    position: relative;
}

.form-control-icon .form-control {
    padding-left: 36px;
}

.form-control-icon-left {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
}

/* Fieldset Separator */
.form-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0;
}

/* Card updates for Acumatica look */
.card {
    background: var(--primary-bg);
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-section {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.card-section:last-child {
    border-bottom: none;
}

.card-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: #111827;
    border-radius: 2px;
}

/* ============================================================================
   FILTERS & SEARCH - Acumatica Style
   ============================================================================ */

.filter-section {
    background: var(--primary-bg);
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0;
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-header {
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    border-bottom: 1px solid #d1d5db;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-title {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-body {
    padding: 16px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: flex-end;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--secondary-bg);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
}

.empty-state h3 {
    margin: 0 0 var(--spacing-md);
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.empty-state p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.empty-state a {
    color: #ffffff;
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}

.empty-state a:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
}

.alert-success {
    background: #ffffff;
    color: #000000;
    border-left-color: #000000;
    border: 1px solid #000000;
}

.alert-danger {
    background: #000000;
    color: #ffffff;
    border-left-color: #000000;
}

.alert-warning {
    background: #cccccc;
    color: #000000;
    border-left-color: #000000;
}

.alert-info {
    background: #f5f5f5;
    color: #000000;
    border-left-color: #000000;
}

/* ============================================================================
   PAGINATION (Supports Laravel Tailwind Output)
   ============================================================================ */

.pagination-wrapper {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    background: var(--primary-bg);
}

/* Hide the default Laravel text if it's too cluttered */
.pagination-wrapper .text-sm {
    font-size: var(--font-size-xs) !important;
    color: var(--text-secondary) !important;
}

/* Container for pagination links */
.pagination-wrapper nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.pagination-wrapper nav>div:first-child {
    display: none;
    /* Hide mobile-only view which often duplicates links */
}

@media (min-width: 640px) {
    .pagination-wrapper nav>div:first-child {
        display: none !important;
    }
}

/* Main pagination container */
.pagination-wrapper span.relative.z-0,
.pagination-wrapper div.flex.items-center.justify-between {
    display: flex !important;
    gap: 0 !important;
    box-shadow: none !important;
}

/* Individual Links and Spans in Laravel Pagination */
.pagination-wrapper a,
.pagination-wrapper span[aria-current="page"] span,
.pagination-wrapper span[aria-disabled="true"] span {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px 14px !important;
    font-size: var(--font-size-sm) !important;
    font-weight: 700 !important;
    border: 1px solid var(--border-color) !important;
    background: var(--primary-bg) !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    margin-left: -1px !important;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pagination-wrapper a:hover {
    background: var(--tertiary-bg) !important;
    z-index: 10;
}

/* Active Page */
.pagination-wrapper span[aria-current="page"] span {
    background: var(--button-dark) !important;
    color: #ffffff !important;
    border-color: var(--button-dark) !important;
    z-index: 20;
}

/* Disabled/Current Arrows */
.pagination-wrapper span[aria-disabled="true"] span {
    color: var(--text-muted) !important;
    cursor: not-allowed;
}

/* Styling for 'Showing X to Y of Z results' text */
.pagination-wrapper p {
    margin: 0 !important;
    font-size: var(--font-size-xs) !important;
    font-weight: 500 !important;
}

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

/* Tablet and below */
@media (max-width: 1024px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .filter-row {
        grid-template-columns: 1fr 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    /* Make stat cards 2 columns on tablet */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --font-size-2xl: 20px;
        --font-size-xl: 18px;
        --font-size-lg: 16px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    /* Tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: var(--font-size-xs);
        min-width: 600px;
    }

    thead th,
    tbody td {
        padding: var(--spacing-xs) var(--spacing-sm);
        white-space: nowrap;
    }

    /* Buttons */
    .btn {
        width: 100%;
        text-align: center;
        padding: var(--spacing-md) var(--spacing-lg);
    }

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

    .btn-group .btn {
        width: 100%;
    }

    /* Forms */
    .form-group {
        margin-bottom: var(--spacing-md);
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    /* Badge positioning */
    .badge {
        font-size: 10px;
        padding: 2px 8px;
    }

    /* Empty state */
    .empty-state {
        padding: var(--spacing-xl);
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .pagination a,
    .pagination span {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 11px;
    }

    /* Make stat cards single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    :root {
        --spacing-xl: 16px;
        --spacing-2xl: 20px;
        --spacing-3xl: 24px;
    }

    .card {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .page-header-title {
        font-size: var(--font-size-lg);
    }

    /* Compact tables for very small screens */
    table {
        font-size: 11px;
    }

    thead th,
    tbody td {
        padding: var(--spacing-xs);
    }

    /* Stack action buttons */
    .card-header {
        padding-bottom: var(--spacing-md);
    }

    /* Smaller badges */
    .badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}

/* ============================================================================
   ACTION LINK COLORS (for table actions)
   ============================================================================ */

.action-view {
    color: #0891b2 !important;
}

.action-view:hover {
    color: #0e7490 !important;
}

.action-edit {
    color: #f59e0b !important;
}

.action-edit:hover {
    color: #d97706 !important;
}

.action-delete {
    color: #dc2626 !important;
}

.action-delete:hover {
    color: #b91c1c !important;
}

/* ============================================================================
   SECTION HEADERS (for form sections)
   ============================================================================ */

.section-header {
    margin: 0 0 var(--spacing-lg);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.section-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

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

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

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

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

code {
    background: var(--secondary-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    color: var(--text-primary);
    font-weight: 500;
}