/* ==========================================================================
   ARI Logistics - Admin Portal Shared Styles
   ========================================================================== */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    /* Primary Colors */
    --admin-primary: #2563eb;
    --admin-primary-hover: #1d4ed8;
    --admin-primary-light: #dbeafe;

    /* Status Colors */
    --admin-success: #10b981;
    --admin-success-light: #d1fae5;
    --admin-warning: #f59e0b;
    --admin-warning-light: #fef3c7;
    --admin-danger: #ef4444;
    --admin-danger-light: #fee2e2;
    --admin-info: #3b82f6;
    --admin-info-light: #dbeafe;

    /* Neutral Colors */
    --admin-gray-50: #f9fafb;
    --admin-gray-100: #f3f4f6;
    --admin-gray-200: #e5e7eb;
    --admin-gray-300: #d1d5db;
    --admin-gray-400: #9ca3af;
    --admin-gray-500: #6b7280;
    --admin-gray-600: #4b5563;
    --admin-gray-700: #374151;
    --admin-gray-800: #1f2937;
    --admin-gray-900: #111827;

    /* Spacing */
    --admin-spacing-xs: 0.25rem;
    --admin-spacing-sm: 0.5rem;
    --admin-spacing-md: 1rem;
    --admin-spacing-lg: 1.5rem;
    --admin-spacing-xl: 2rem;

    /* Border Radius */
    --admin-radius-sm: 0.25rem;
    --admin-radius-md: 0.375rem;
    --admin-radius-lg: 0.5rem;
    --admin-radius-xl: 0.75rem;

    /* Shadows */
    --admin-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --admin-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --admin-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    /* Transitions */
    --admin-transition: 150ms ease-in-out;
}

/* ==========================================================================
   Base Layout
   ========================================================================== */
.admin-page {
    padding: var(--admin-spacing-lg);
    background-color: var(--admin-gray-50);
    min-height: 100vh;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--admin-spacing-lg);
    flex-wrap: wrap;
    gap: var(--admin-spacing-md);
}

.admin-page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--admin-gray-900);
    margin: 0;
}

.admin-page-subtitle {
    font-size: 0.875rem;
    color: var(--admin-gray-500);
    margin: 0.25rem 0 0 0;
}

.admin-page-actions {
    display: flex;
    gap: var(--admin-spacing-sm);
    align-items: center;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.admin-search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.admin-search-input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-lg);
    font-size: 0.875rem;
    background-color: white;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
}

.admin-search-input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.admin-search-input::placeholder {
    color: var(--admin-gray-400);
}

.admin-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-gray-400);
    pointer-events: none;
}

/* ==========================================================================
   Filters
   ========================================================================== */
.admin-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--admin-spacing-sm);
    margin-bottom: var(--admin-spacing-md);
    align-items: center;
}

.admin-filter-group {
    display: flex;
    align-items: center;
    gap: var(--admin-spacing-xs);
}

.admin-filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--admin-gray-600);
    white-space: nowrap;
}

.admin-filter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-md);
    font-size: 0.875rem;
    background-color: white;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25rem;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--admin-transition);
}

.admin-filter-select:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.admin-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background-color: var(--admin-gray-100);
    border: 1px solid var(--admin-gray-200);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--admin-gray-700);
    cursor: pointer;
    transition: all var(--admin-transition);
}

.admin-filter-chip:hover {
    background-color: var(--admin-gray-200);
}

.admin-filter-chip.active {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.admin-filter-chip .chip-count {
    margin-left: 0.375rem;
    padding: 0.125rem 0.375rem;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    font-size: 0.625rem;
}

.admin-filter-chip.active .chip-count {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Tables
   ========================================================================== */
.admin-table-container {
    background-color: white;
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    overflow: hidden;
    border: 1px solid var(--admin-gray-200);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table thead {
    background-color: var(--admin-gray-50);
    border-bottom: 1px solid var(--admin-gray-200);
}

.admin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--admin-gray-700);
    white-space: nowrap;
}

.admin-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color var(--admin-transition);
}

.admin-table th.sortable:hover {
    background-color: var(--admin-gray-100);
}

.admin-table th.sortable::after {
    content: '';
    display: inline-block;
    margin-left: 0.5rem;
    width: 0;
    height: 0;
    vertical-align: middle;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--admin-gray-400);
    opacity: 0.5;
}

.admin-table th.sortable.asc::after {
    border-top: none;
    border-bottom: 4px solid var(--admin-primary);
    opacity: 1;
}

.admin-table th.sortable.desc::after {
    border-top: 4px solid var(--admin-primary);
    opacity: 1;
}

.admin-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--admin-gray-100);
    color: var(--admin-gray-700);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background-color: var(--admin-gray-50);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table .actions {
    white-space: nowrap;
    text-align: right;
}

.admin-table .checkbox-cell {
    width: 40px;
    text-align: center;
}

/* Table Empty State */
.admin-table-empty {
    padding: var(--admin-spacing-xl);
    text-align: center;
    color: var(--admin-gray-500);
}

.admin-table-empty-icon {
    font-size: 2.5rem;
    margin-bottom: var(--admin-spacing-md);
    opacity: 0.5;
}

.admin-table-empty-title {
    font-weight: 600;
    color: var(--admin-gray-700);
    margin-bottom: var(--admin-spacing-xs);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.admin-card {
    background-color: white;
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    border: 1px solid var(--admin-gray-200);
    overflow: hidden;
}

.admin-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--admin-gray-200);
    background-color: var(--admin-gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-card-title {
    font-weight: 600;
    color: var(--admin-gray-900);
    margin: 0;
    font-size: 1rem;
}

.admin-card-body {
    padding: 1.25rem;
}

.admin-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--admin-gray-200);
    background-color: var(--admin-gray-50);
}

/* Stat Cards */
.admin-stat-card {
    background-color: white;
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    border: 1px solid var(--admin-gray-200);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.admin-stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--admin-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.admin-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--admin-gray-900);
    line-height: 1;
}

.admin-stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.admin-stat-change.positive {
    color: var(--admin-success);
}

.admin-stat-change.negative {
    color: var(--admin-danger);
}

/* Info Cards */
.admin-info-card {
    background-color: white;
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
    border: 1px solid var(--admin-gray-200);
    padding: 1rem;
    transition: box-shadow var(--admin-transition);
}

.admin-info-card:hover {
    box-shadow: var(--admin-shadow-md);
}

.admin-info-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.admin-info-card-title {
    font-weight: 600;
    color: var(--admin-gray-900);
    font-size: 0.9375rem;
}

.admin-info-card-subtitle {
    font-size: 0.8125rem;
    color: var(--admin-gray-500);
    margin-top: 0.125rem;
}

.admin-info-card-body {
    font-size: 0.8125rem;
    color: var(--admin-gray-600);
}

.admin-info-card-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--admin-gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.admin-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: var(--admin-spacing-lg);
    animation: fadeIn 150ms ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.admin-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: var(--admin-radius-xl);
    box-shadow: var(--admin-shadow-lg);
    max-width: 32rem;
    width: calc(100% - 2rem);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 150ms ease-out;
    z-index: 1001;
}

.admin-modal.modal-lg {
    max-width: 48rem;
}

.admin-modal.modal-xl {
    max-width: 64rem;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
}

.admin-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.admin-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--admin-gray-900);
    margin: 0;
}

.admin-modal-close {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--admin-gray-400);
    cursor: pointer;
    border-radius: var(--admin-radius-md);
    transition: all var(--admin-transition);
}

.admin-modal-close:hover {
    background-color: var(--admin-gray-100);
    color: var(--admin-gray-600);
}

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.admin-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--admin-spacing-sm);
    flex-shrink: 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.admin-form-group {
    margin-bottom: 1rem;
}

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.admin-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-gray-700);
    margin-bottom: 0.375rem;
}

.admin-form-label.required::after {
    content: ' *';
    color: var(--admin-danger);
}

.admin-input,
.admin-select,
.admin-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-md);
    font-size: 0.875rem;
    background-color: white;
    transition: border-color var(--admin-transition), box-shadow var(--admin-transition);
}

.admin-input:focus,
.admin-select:focus,
.admin-textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px var(--admin-primary-light);
}

.admin-input::placeholder,
.admin-textarea::placeholder {
    color: var(--admin-gray-400);
}

.admin-input.error,
.admin-select.error,
.admin-textarea.error {
    border-color: var(--admin-danger);
}

.admin-input.error:focus,
.admin-select.error:focus,
.admin-textarea.error:focus {
    box-shadow: 0 0 0 3px var(--admin-danger-light);
}

.admin-form-error {
    font-size: 0.75rem;
    color: var(--admin-danger);
    margin-top: 0.25rem;
}

.admin-form-hint {
    font-size: 0.75rem;
    color: var(--admin-gray-500);
    margin-top: 0.25rem;
}

.admin-textarea {
    resize: vertical;
    min-height: 5rem;
}

.admin-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: var(--admin-radius-sm);
    accent-color: var(--admin-primary);
}

.admin-checkbox-label {
    font-size: 0.875rem;
    color: var(--admin-gray-700);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--admin-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--admin-transition);
    white-space: nowrap;
    text-decoration: none;
}

.admin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.admin-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.admin-btn-primary {
    background-color: var(--admin-primary);
    color: white;
}

.admin-btn-primary:hover:not(:disabled) {
    background-color: var(--admin-primary-hover);
}

.admin-btn-secondary {
    background-color: white;
    border-color: var(--admin-gray-300);
    color: var(--admin-gray-700);
}

.admin-btn-secondary:hover:not(:disabled) {
    background-color: var(--admin-gray-50);
    border-color: var(--admin-gray-400);
}

.admin-btn-success {
    background-color: var(--admin-success);
    color: white;
}

.admin-btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.admin-btn-danger {
    background-color: var(--admin-danger);
    color: white;
}

.admin-btn-danger:hover:not(:disabled) {
    background-color: #dc2626;
}

.admin-btn-warning {
    background-color: var(--admin-warning);
    color: white;
}

.admin-btn-warning:hover:not(:disabled) {
    background-color: #d97706;
}

.admin-btn-ghost {
    background-color: transparent;
    color: var(--admin-gray-600);
}

.admin-btn-ghost:hover:not(:disabled) {
    background-color: var(--admin-gray-100);
}

.admin-btn-link {
    background-color: transparent;
    color: var(--admin-primary);
    padding: 0;
    border: none;
}

.admin-btn-link:hover:not(:disabled) {
    text-decoration: underline;
}

/* Icon Buttons */
.admin-btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: var(--admin-radius-md);
}

.admin-btn-icon.admin-btn-sm {
    width: 1.5rem;
    height: 1.5rem;
}

/* Button Group */
.admin-btn-group {
    display: inline-flex;
}

.admin-btn-group .admin-btn {
    border-radius: 0;
}

.admin-btn-group .admin-btn:first-child {
    border-radius: var(--admin-radius-md) 0 0 var(--admin-radius-md);
}

.admin-btn-group .admin-btn:last-child {
    border-radius: 0 var(--admin-radius-md) var(--admin-radius-md) 0;
}

.admin-btn-group .admin-btn:not(:last-child) {
    border-right: none;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    white-space: nowrap;
}

.admin-badge-success {
    background-color: var(--admin-success-light);
    color: #065f46;
}

.admin-badge-warning {
    background-color: var(--admin-warning-light);
    color: #92400e;
}

.admin-badge-danger {
    background-color: var(--admin-danger-light);
    color: #991b1b;
}

.admin-badge-info {
    background-color: var(--admin-info-light);
    color: #1e40af;
}

.admin-badge-gray {
    background-color: var(--admin-gray-100);
    color: var(--admin-gray-700);
}

.admin-badge-primary {
    background-color: var(--admin-primary-light);
    color: #1e40af;
}

/* Dot Badges */
.admin-badge-dot {
    padding-left: 0.375rem;
}

.admin-badge-dot::before {
    content: '';
    display: inline-block;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    margin-right: 0.375rem;
}

.admin-badge-dot.admin-badge-success::before {
    background-color: var(--admin-success);
}

.admin-badge-dot.admin-badge-warning::before {
    background-color: var(--admin-warning);
}

.admin-badge-dot.admin-badge-danger::before {
    background-color: var(--admin-danger);
}

.admin-badge-dot.admin-badge-info::before {
    background-color: var(--admin-info);
}

/* ==========================================================================
   Status Indicators
   ========================================================================== */
.status-available {
    color: var(--admin-success);
}

.status-assigned {
    color: var(--admin-info);
}

.status-pending {
    color: var(--admin-warning);
}

.status-delivered {
    color: var(--admin-success);
}

.status-shipped {
    color: var(--admin-info);
}

.status-returned {
    color: var(--admin-gray-500);
}

.status-expired {
    color: var(--admin-danger);
}

/* Status Dots */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-dot.active {
    background-color: var(--admin-success);
}

.status-dot.inactive {
    background-color: var(--admin-gray-400);
}

.status-dot.warning {
    background-color: var(--admin-warning);
}

.status-dot.error {
    background-color: var(--admin-danger);
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--admin-gray-200);
    margin-bottom: var(--admin-spacing-lg);
    gap: 0;
}

.admin-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-gray-500);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--admin-transition);
    margin-bottom: -1px;
}

.admin-tab:hover {
    color: var(--admin-gray-700);
}

.admin-tab.active {
    color: var(--admin-primary);
    border-bottom-color: var(--admin-primary);
}

.admin-tab .tab-count {
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background-color: var(--admin-gray-100);
    border-radius: 9999px;
    font-size: 0.75rem;
}

.admin-tab.active .tab-count {
    background-color: var(--admin-primary-light);
    color: var(--admin-primary);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-top: 1px solid var(--admin-gray-200);
}

.admin-pagination-info {
    font-size: 0.875rem;
    color: var(--admin-gray-500);
}

.admin-pagination-controls {
    display: flex;
    gap: 0.25rem;
}

.admin-pagination-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--admin-gray-300);
    background-color: white;
    border-radius: var(--admin-radius-md);
    font-size: 0.875rem;
    color: var(--admin-gray-700);
    cursor: pointer;
    transition: all var(--admin-transition);
}

.admin-pagination-btn:hover:not(:disabled) {
    background-color: var(--admin-gray-50);
    border-color: var(--admin-gray-400);
}

.admin-pagination-btn.active {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.admin-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Loading States
   ========================================================================== */
.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--admin-spacing-xl);
}

.admin-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--admin-gray-200);
    border-top-color: var(--admin-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.admin-loading-text {
    margin-left: 0.75rem;
    color: var(--admin-gray-500);
    font-size: 0.875rem;
}

/* Skeleton Loading */
.admin-skeleton {
    background: linear-gradient(90deg, var(--admin-gray-200) 25%, var(--admin-gray-100) 50%, var(--admin-gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--admin-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.admin-skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.admin-skeleton-text:last-child {
    width: 70%;
}

/* ==========================================================================
   Tooltips
   ========================================================================== */
.admin-tooltip {
    position: relative;
}

.admin-tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background-color: var(--admin-gray-800);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--admin-radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--admin-transition), visibility var(--admin-transition);
    z-index: 100;
    margin-bottom: 0.5rem;
}

.admin-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--admin-gray-800);
}

.admin-tooltip:hover .admin-tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   Dropdown Menu
   ========================================================================== */
.admin-dropdown {
    position: relative;
    display: inline-block;
}

.admin-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 10rem;
    background-color: white;
    border: 1px solid var(--admin-gray-200);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-lg);
    padding: 0.375rem;
    z-index: 100;
    margin-top: 0.25rem;
}

.admin-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--admin-gray-700);
    background: none;
    border: none;
    border-radius: var(--admin-radius-md);
    cursor: pointer;
    transition: background-color var(--admin-transition);
    text-align: left;
}

.admin-dropdown-item:hover {
    background-color: var(--admin-gray-100);
}

.admin-dropdown-item.danger {
    color: var(--admin-danger);
}

.admin-dropdown-item.danger:hover {
    background-color: var(--admin-danger-light);
}

.admin-dropdown-divider {
    height: 1px;
    background-color: var(--admin-gray-200);
    margin: 0.375rem 0;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.admin-alert {
    padding: 0.875rem 1rem;
    border-radius: var(--admin-radius-lg);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: var(--admin-spacing-md);
}

.admin-alert-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.admin-alert-content {
    flex: 1;
}

.admin-alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-alert-success {
    background-color: var(--admin-success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.admin-alert-warning {
    background-color: var(--admin-warning-light);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.admin-alert-danger {
    background-color: var(--admin-danger-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.admin-alert-info {
    background-color: var(--admin-info-light);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */
.admin-grid {
    display: grid;
    gap: var(--admin-spacing-md);
}

.admin-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.admin-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.admin-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .admin-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .admin-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .admin-grid-4,
    .admin-grid-3,
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Split View
   ========================================================================== */
.admin-split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--admin-spacing-lg);
    height: calc(100vh - 200px);
}

.admin-split-pane {
    overflow-y: auto;
    background-color: white;
    border-radius: var(--admin-radius-lg);
    border: 1px solid var(--admin-gray-200);
}

.admin-split-pane-header {
    padding: 1rem;
    border-bottom: 1px solid var(--admin-gray-200);
    background-color: var(--admin-gray-50);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-split-pane-body {
    padding: 1rem;
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */
@media (max-width: 768px) {
    .admin-page {
        padding: var(--admin-spacing-md);
    }

    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-search-container {
        max-width: 100%;
    }

    .admin-split-view {
        grid-template-columns: 1fr;
    }

    .admin-table-container {
        overflow-x: auto;
    }

    .admin-modal {
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .admin-page {
        background-color: white;
        padding: 0;
    }

    .admin-btn,
    .admin-filters,
    .admin-pagination {
        display: none;
    }

    .admin-table-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   Bootstrap Modal Compatibility (for legacy modals)
   ========================================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    display: none;
    overflow: hidden;
    outline: 0;
}

.modal.d-block,
.modal.show {
    display: block;
}

.modal-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 500px;
    margin: 0;
    z-index: 1055;
}

.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-dialog.modal-xl {
    max-width: 1140px;
}

.modal-dialog.modal-sm {
    max-width: 300px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: white;
    border-radius: var(--admin-radius-xl);
    box-shadow: var(--admin-shadow-lg);
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-gray-200);
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--admin-gray-900);
    margin: 0;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--admin-spacing-sm);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--admin-gray-200);
}

.btn-close {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: var(--admin-radius-sm);
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 0.75;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Bootstrap Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--admin-radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--admin-transition);
    text-decoration: none;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--admin-primary-hover);
    border-color: var(--admin-primary-hover);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-success {
    background-color: var(--admin-success);
    border-color: var(--admin-success);
    color: white;
}

.btn-success:hover {
    background-color: #0ca678;
    border-color: #0a9b71;
}

.btn-danger {
    background-color: var(--admin-danger);
    border-color: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-warning {
    background-color: var(--admin-warning);
    border-color: var(--admin-warning);
    color: #000;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

.btn-info {
    background-color: var(--admin-info);
    border-color: var(--admin-info);
    color: white;
}

.btn-info:hover {
    background-color: #0d8bf2;
    border-color: #0c83e0;
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--admin-gray-400);
    color: var(--admin-gray-700);
}

.btn-outline-secondary:hover {
    background-color: var(--admin-gray-100);
    border-color: var(--admin-gray-500);
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--admin-primary);
    color: var(--admin-primary);
}

.btn-outline-primary:hover {
    background-color: var(--admin-primary);
    color: white;
}

.btn-outline-success {
    background-color: transparent;
    border-color: var(--admin-success);
    color: var(--admin-success);
}

.btn-outline-success:hover {
    background-color: var(--admin-success);
    color: white;
}

.btn-outline-danger {
    background-color: transparent;
    border-color: var(--admin-danger);
    color: var(--admin-danger);
}

.btn-outline-danger:hover {
    background-color: var(--admin-danger);
    color: white;
}

/* Bootstrap Form Elements */
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--admin-gray-700);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--admin-gray-300);
    border-radius: var(--admin-radius-md);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--admin-primary);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

.form-label {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-gray-700);
}

.form-check {
    display: flex;
    align-items: center;
    padding-left: 0;
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--admin-gray-700);
}

/* Bootstrap Cards */
.card {
    background-color: #fff;
    border: 1px solid var(--admin-gray-200);
    border-radius: var(--admin-radius-lg);
    box-shadow: var(--admin-shadow-sm);
}

.card-body {
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    background-color: var(--admin-gray-50);
    border-bottom: 1px solid var(--admin-gray-200);
}

.card-footer {
    padding: 0.75rem 1rem;
    background-color: var(--admin-gray-50);
    border-top: 1px solid var(--admin-gray-200);
}

/* Bootstrap Alerts */
.alert {
    position: relative;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--admin-radius-md);
}

.alert-primary {
    color: #084298;
    background-color: #cfe2ff;
    border-color: #b6d4fe;
}

.alert-secondary {
    color: #41464b;
    background-color: #e2e3e5;
    border-color: #d3d6d8;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* Bootstrap Badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: var(--admin-radius-sm);
}

.bg-primary { background-color: var(--admin-primary) !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-success { background-color: var(--admin-success) !important; }
.bg-danger { background-color: var(--admin-danger) !important; }
.bg-warning { background-color: var(--admin-warning) !important; }
.bg-info { background-color: var(--admin-info) !important; }
.bg-light { background-color: var(--admin-gray-100) !important; }
.bg-dark { background-color: var(--admin-gray-800) !important; }

.text-primary { color: var(--admin-primary) !important; }
.text-secondary { color: #6c757d !important; }
.text-success { color: var(--admin-success) !important; }
.text-danger { color: var(--admin-danger) !important; }
.text-warning { color: var(--admin-warning) !important; }
.text-info { color: var(--admin-info) !important; }
.text-light { color: var(--admin-gray-200) !important; }
.text-dark { color: var(--admin-gray-900) !important; }
.text-white { color: #fff !important; }
.text-muted { color: var(--admin-gray-500) !important; }

/* Bootstrap Spacing Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-grid { display: grid !important; }

/* Flexbox Utilities */
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

/* Text Utilities */
.text-center { text-align: center !important; }
.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.fw-bold { font-weight: 700 !important; }
.fw-normal { font-weight: 400 !important; }
.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }
