/* Base CSS Variables */
:root {
    --background: 220 20% 97%;
    --foreground: 220 30% 15%;
    --card: 0 0% 100%;
    --card-foreground: 220 30% 15%;
    --primary: 220 70% 50%;
    --primary-foreground: 0 0% 100%;
    --secondary: 220 15% 92%;
    --secondary-foreground: 220 30% 25%;
    --muted: 220 15% 94%;
    --muted-foreground: 220 15% 45%;
    --destructive: 0 84% 60%;
    --destructive-foreground: 0 0% 100%;
    --success: 142 76% 36%;
    --success-foreground: 0 0% 100%;
    --warning: 38 92% 50%;
    --warning-foreground: 38 92% 15%;
    --info: 199 89% 48%;
    --info-foreground: 0 0% 100%;
    --border: 220 15% 88%;
    --radius: 0.75rem;

    /* Admin Theme */
    --admin-primary: 220 70% 50%;
    --admin-sidebar-background: 220 40% 18%;
    --admin-sidebar-foreground: 220 20% 75%;
    --admin-sidebar-accent: 220 40% 25%;
    --admin-sidebar-border: 220 30% 25%;

    /* Vendor Theme */
    --vendor-primary: 160 84% 39%;
    --vendor-sidebar-background: 160 30% 15%;
    --vendor-sidebar-foreground: 160 20% 80%;
    --vendor-sidebar-accent: 160 30% 22%;
    --vendor-sidebar-border: 160 25% 22%;

    /* Fulfillment Theme */
    --fulfillment-primary: 25 95% 53%;
    --fulfillment-sidebar-background: 25 30% 15%;
    --fulfillment-sidebar-foreground: 25 20% 80%;
    --fulfillment-sidebar-accent: 25 30% 22%;
    --fulfillment-sidebar-border: 25 25% 22%;
}

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    color: hsl(var(--sidebar-foreground));
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    background-color: hsl(var(--sidebar-accent));
    color: white;
}

.nav-link.active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Cards */
.stat-card {
    background: hsl(var(--card));
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid hsl(var(--border));
    transition: all 0.3s;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    border-color: hsl(var(--primary) / 0.3);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -15px hsl(var(--primary) / 0.25);
}

/* Tables */
.data-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    color: hsl(var(--muted-foreground));
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid hsl(var(--border));
    background-color: hsl(var(--muted) / 0.5);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid hsl(var(--border) / 0.5);
}

.data-table tr:hover td {
    background-color: hsl(var(--muted) / 0.3);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-success {
    background-color: hsl(var(--success) / 0.15);
    color: hsl(var(--success));
}

.status-warning {
    background-color: hsl(var(--warning) / 0.15);
    color: hsl(var(--warning-foreground));
}

.status-info {
    background-color: hsl(var(--info) / 0.15);
    color: hsl(var(--info));
}

.status-danger {
    background-color: hsl(var(--destructive) / 0.15);
    color: hsl(var(--destructive));
}

/* Buttons */
.action-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.action-button:hover {
    opacity: 0.9;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.action-button-secondary:hover {
    background-color: hsl(var(--muted));
}

/* Form Inputs */
.search-input,
.form-input {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    color: hsl(var(--foreground));
    width: 100%;
}

.search-input:focus,
.form-input:focus {
    outline: none;
    ring: 2px;
    ring-color: hsl(var(--primary) / 0.5);
    border-color: hsl(var(--primary));
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

/* Sidebar */
.bg-sidebar {
    background-color: hsl(var(--sidebar-background));
}

.text-sidebar-foreground {
    color: hsl(var(--sidebar-foreground));
}

.bg-gradient-primary {
    background: linear-gradient(135deg, hsl(220 70% 50%), hsl(260 70% 55%));
}

.theme-admin .bg-gradient-primary {
    background: linear-gradient(135deg, hsl(220 70% 50%), hsl(260 70% 55%));
}

.theme-vendor .bg-gradient-primary {
    background: linear-gradient(135deg, hsl(160 84% 39%), hsl(180 70% 45%));
}

.theme-fulfillment .bg-gradient-primary {
    background: linear-gradient(135deg, hsl(25 95% 53%), hsl(40 90% 55%));
}

/* Page Layout */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.page-subtitle {
    color: hsl(var(--muted-foreground));
    margin-top: 0.25rem;
}

/* Portal Cards */
.portal-card {
    background: hsl(var(--card));
    border-radius: 1rem;
    padding: 2rem;
    border: 2px solid hsl(var(--border));
    transition: all 0.3s;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    display: block;
}

.portal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.2);
}

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

/* Theme Overrides */
.theme-admin {
    --primary: var(--admin-primary);
    --sidebar-background: var(--admin-sidebar-background);
    --sidebar-foreground: var(--admin-sidebar-foreground);
    --sidebar-accent: var(--admin-sidebar-accent);
    --sidebar-border: var(--admin-sidebar-border);
}

.theme-vendor {
    --primary: var(--vendor-primary);
    --sidebar-background: var(--vendor-sidebar-background);
    --sidebar-foreground: var(--vendor-sidebar-foreground);
    --sidebar-accent: var(--vendor-sidebar-accent);
    --sidebar-border: var(--vendor-sidebar-border);
}

.theme-fulfillment {
    --primary: var(--fulfillment-primary);
    --sidebar-background: var(--fulfillment-sidebar-background);
    --sidebar-foreground: var(--fulfillment-sidebar-foreground);
    --sidebar-accent: var(--fulfillment-sidebar-accent);
    --sidebar-border: var(--fulfillment-sidebar-border);
}


/* Sleek DataTables Styling - Visual enhancements only, no positioning changes */
.dataTables_wrapper {
    font-family: 'Inter', sans-serif;
}

/* Search input styling */
.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Length select styling */
.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.5rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Pagination buttons */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid hsl(var(--border)) !important;
    border-radius: 0.5rem !important;
    background-color: hsl(var(--background)) !important;
    color: hsl(var(--foreground)) !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 0.125rem !important;
    transition: all 0.2s ease !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: hsl(var(--muted)) !important;
    border-color: hsl(var(--primary)) !important;
    color: hsl(var(--primary)) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: hsl(var(--primary)) !important;
    border-color: hsl(var(--primary)) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    background-color: hsl(var(--background)) !important;
    border-color: hsl(var(--border)) !important;
    color: hsl(var(--foreground)) !important;
}

/* Info text */
.dataTables_wrapper .dataTables_info {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

/* Table headers */
.dataTables_wrapper table.dataTable thead th {
    background-color: hsl(var(--muted) / 0.3) !important;
    color: hsl(var(--foreground)) !important;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid hsl(var(--border)) !important;
    transition: background-color 0.2s ease;
}

.dataTables_wrapper table.dataTable thead th.sorting:hover,
.dataTables_wrapper table.dataTable thead th.sorting_asc:hover,
.dataTables_wrapper table.dataTable thead th.sorting_desc:hover {
    background-color: hsl(var(--muted) / 0.5) !important;
}

.dataTables_wrapper table.dataTable thead th.sorting_asc,
.dataTables_wrapper table.dataTable thead th.sorting_desc {
    background-color: hsl(var(--muted) / 0.4) !important;
}

/* Table body */
.dataTables_wrapper table.dataTable tbody td {
    border-bottom: 1px solid hsl(var(--border) / 0.5) !important;
    color: hsl(var(--foreground));
}

.dataTables_wrapper table.dataTable tbody tr {
    transition: background-color 0.15s ease;
}

.dataTables_wrapper table.dataTable tbody tr:hover {
    background-color: hsl(var(--muted) / 0.3) !important;
}

/* Remove default DataTables borders and backgrounds */
.dataTables_wrapper table.dataTable {
    border-collapse: separate;
    border-spacing: 0;
}

.dataTables_wrapper table.dataTable.no-footer {
    border-bottom: none;
}
