/*
 * Utility-first component helpers constructed with regular CSS so they work
 * without a Tailwind build step. Combine the base class with a variant
 * (ej. `btn-base btn-primary`) to inherit the shared styles.
 */

.btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    outline: transparent solid 2px;
    outline-offset: 2px;
}

.btn-icon {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.5rem;
}

.btn-base:focus-visible {
    outline-color: rgba(var(--color-primary), 0.7);
}

.btn-primary {
    background-color: rgb(var(--color-primary));
    color: rgb(var(--color-primary-foreground));
}

.btn-primary:hover {
    background-color: rgb(14, 116, 144);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: rgb(241, 245, 249);
    color: rgb(71, 85, 105);
}

.btn-secondary:hover {
    background-color: rgb(226, 232, 240);
}

.btn-secondary:focus-visible {
    outline-color: rgba(71, 85, 105, 0.75);
}

.btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

html.dark .btn-secondary {
    background-color: rgb(71, 85, 105);
    color: rgb(226, 232, 240);
}

html.dark .btn-secondary:hover {
    background-color: rgb(100, 116, 139);
}

.btn-danger {
    background-color: rgb(225, 29, 72);
    color: #fff;
}

.btn-danger:hover {
    background-color: rgb(190, 24, 60);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid rgb(14, 116, 144);
    color: rgb(14, 116, 144);
}

.btn-outline:hover {
    background-color: rgba(14, 116, 144, 0.08);
}

.btn-outline:disabled {
    border-color: rgb(203, 213, 225);
    color: rgb(148, 163, 184);
    background-color: transparent;
}

html.dark .btn-outline {
    border-color: rgb(14, 165, 233);
    color: rgb(14, 165, 233);
}

html.dark .btn-outline:hover {
    background-color: rgba(14, 165, 233, 0.15);
}

html.dark .btn-outline:disabled {
    border-color: rgb(71, 85, 105);
    color: rgb(100, 116, 139);
}

.badge-base {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-primary {
    background-color: rgba(var(--color-primary), 0.1);
    color: rgb(14, 116, 144);
}

html.dark .badge-primary {
    background-color: rgba(var(--color-primary), 0.16);
    color: rgb(191, 219, 254);
}

.card-base {
    border-radius: 1rem;
    background-color: rgb(var(--color-card));
    padding: 1rem;
    box-shadow: var(--shadow-base);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-base:hover {
    transform: translateY(-2px);
}

.input-base {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background-color: rgb(255, 255, 255);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(15, 23, 42);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-base::placeholder {
    color: rgb(148, 163, 184);
}

.input-base:focus {
    border-color: rgba(var(--color-primary), 0.9);
    box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.25);
    outline: none;
}

.input-base:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

html.dark .input-base {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgba(100, 116, 139, 0.7);
}

.label-base {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(71, 85, 105);
}

html.dark .label-base {
    color: rgb(186, 199, 213);
}

/* ============================================================================
   Radio Button Base Styles
   ============================================================================ */

/* Radio Button Label Container */
.radio-label-base {
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgb(226, 232, 240);
    background-color: rgb(255, 255, 255);
    border: 1px solid rgba(148, 163, 184, 0.75);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem; 
    font-weight: 500;
    color: rgb(71, 85, 105);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.radio-label-base:hover {
    border-color: rgb(14, 165, 233);
    background-color: rgb(240, 249, 255);
}

.radio-label-base:has(input:checked) {
    border-color: rgb(14, 165, 233);
    background-color: rgb(240, 249, 255);
    color: rgb(14, 116, 144);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

html.dark .radio-label-base {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgb(71, 85, 105);
}

html.dark .radio-label-base:hover {
    border-color: rgb(14, 165, 233);
    background-color: rgb(51, 65, 85);
}

html.dark .radio-label-base:has(input:checked) {
    border-color: rgb(14, 165, 233);
    background-color: rgba(14, 165, 233, 0.1);
    color: rgb(103, 232, 249);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Radio Button Input */
.radio-base {
    height: 1rem;
    width: 1rem;
    flex-shrink: 0;
    border: 1px solid rgb(203, 213, 225);
    color: rgb(14, 165, 233);
    transition: all 0.2s ease;
}

.radio-base:focus {
    /* box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25); */
    outline: none;
}

html.dark .radio-base {
    border-color: rgb(100, 116, 139);
    background-color: rgb(51, 65, 85);
}

/* Radio Button Sizes */
.radio-xs {
    height: 0.675rem;
    width: 0.675rem;
}
.radio-sm {
    height: 0.875rem;
    width: 0.875rem;
}
.radio-label-xs {
    padding: 0.5rem 0.5rem;
    font-size: 0.8125rem;
    gap: 0.275rem;
}
.radio-label-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.radio-md {
    height: 1rem;
    width: 1rem;
}

.radio-label-md {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.radio-lg {
    height: 1.125rem;
    width: 1.125rem;
}

.radio-label-lg {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    gap: 0.625rem;
}

.radio-xl {
    height: 1.25rem;
    width: 1.25rem;
}

.radio-label-xl {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    gap: 0.75rem;
}

/* ============================================================================
   Checkbox Base Styles
   ============================================================================ */

/* Checkbox Label Container */
.check-label-base {
    display: flex;
    cursor: pointer;
    align-items: center;
    gap: 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.75);
    /* border: 1px solid rgb(226, 232, 240); */
    background-color: rgb(255, 255, 255);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(71, 85, 105);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.check-label-base:hover {
    border-color: rgb(14, 165, 233);
    background-color: rgb(240, 249, 255);
}

.check-label-base:has(input:checked) {
    border-color: rgb(14, 165, 233);
    background-color: rgb(240, 249, 255);
    color: rgb(14, 116, 144);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

html.dark .check-label-base {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgb(71, 85, 105);
}

html.dark .check-label-base:hover {
    border-color: rgb(14, 165, 233);
    background-color: rgb(51, 65, 85);
}

html.dark .check-label-base:has(input:checked) {
    border-color: rgb(14, 165, 233);
    background-color: rgba(14, 165, 233, 0.1);
    color: rgb(103, 232, 249);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

/* Checkbox Input */
.check-base {
    height: 1rem;
    width: 1rem;
    flex-shrink: 0;
    border-radius: 0.375rem;
    border: 1px solid rgb(203, 213, 225);
    color: rgb(14, 165, 233);
    transition: all 0.2s ease;
}

.check-base:focus {
    /* box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25); */
    outline: none;
}

html.dark .check-base {
    border-color: rgb(100, 116, 139);
    background-color: rgb(51, 65, 85);
}

/* Checkbox Sizes */
.check-sm {
    height: 0.875rem;
    width: 0.875rem;
    border-radius: 0.25rem;
}

.check-label-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    gap: 0.375rem;
}

.check-md {
    height: 1rem;
    width: 1rem;
    border-radius: 0.375rem;
}

.check-label-md {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    gap: 0.5rem;
}

.check-lg {
    height: 1.125rem;
    width: 1.125rem;
    border-radius: 0.5rem;
}

.check-label-lg {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    gap: 0.625rem;
}

.check-xl {
    height: 1.25rem;
    width: 1.25rem;
    border-radius: 0.5rem;
}

.check-label-xl {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    gap: 0.75rem;
}

/* ============================================================================
   Color Variants for Radio & Checkbox
   ============================================================================ */

/* Primary (Sky Blue) - Default */
.radio-primary,
.check-primary {
    color: rgb(14, 165, 233);
}

/* Success (Emerald Green) */
.radio-success,
.check-success {
    color: rgb(16, 185, 129);
}

.radio-label-success:hover,
.check-label-success:hover {
    border-color: rgb(16, 185, 129);
    background-color: rgb(236, 253, 245);
}

.radio-label-success:has(input:checked),
.check-label-success:has(input:checked) {
    border-color: rgb(16, 185, 129);
    background-color: rgb(236, 253, 245);
    color: rgb(5, 150, 105);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

html.dark .radio-label-success:hover,
html.dark .check-label-success:hover {
    border-color: rgb(16, 185, 129);
}

html.dark .radio-label-success:has(input:checked),
html.dark .check-label-success:has(input:checked) {
    border-color: rgb(16, 185, 129);
    background-color: rgba(16, 185, 129, 0.1);
    color: rgb(110, 231, 183);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* Danger (Rose Red) */
.radio-danger,
.check-danger {
    color: rgb(244, 63, 94);
}

.radio-label-danger:hover,
.check-label-danger:hover {
    border-color: rgb(244, 63, 94);
    background-color: rgb(255, 241, 242);
}

.radio-label-danger:has(input:checked),
.check-label-danger:has(input:checked) {
    border-color: rgb(244, 63, 94);
    background-color: rgb(255, 241, 242);
    color: rgb(225, 29, 72);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}

html.dark .radio-label-danger:hover,
html.dark .check-label-danger:hover {
    border-color: rgb(244, 63, 94);
}

html.dark .radio-label-danger:has(input:checked),
html.dark .check-label-danger:has(input:checked) {
    border-color: rgb(244, 63, 94);
    background-color: rgba(244, 63, 94, 0.1);
    color: rgb(251, 113, 133);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

/* Warning (Amber) */
.radio-warning,
.check-warning {
    color: rgb(245, 158, 11);
}

.radio-label-warning:hover,
.check-label-warning:hover {
    border-color: rgb(245, 158, 11);
    background-color: rgb(254, 252, 232);
}

.radio-label-warning:has(input:checked),
.check-label-warning:has(input:checked) {
    border-color: rgb(245, 158, 11);
    background-color: rgb(254, 252, 232);
    color: rgb(217, 119, 6);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

html.dark .radio-label-warning:hover,
html.dark .check-label-warning:hover {
    border-color: rgb(245, 158, 11);
}

html.dark .radio-label-warning:has(input:checked),
html.dark .check-label-warning:has(input:checked) {
    border-color: rgb(245, 158, 11);
    background-color: rgba(245, 158, 11, 0.1);
    color: rgb(252, 211, 77);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

/* ============================================================================
   Textarea Base Styles
   ============================================================================ */

.textarea-base {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background-color: rgb(255, 255, 255);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: rgb(15, 23, 42);
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    min-height: 5rem;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea-base::placeholder {
    color: rgb(148, 163, 184);
}

.textarea-base:focus {
    border-color: rgba(var(--color-primary), 0.9);
    box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.25);
    outline: none;
}

.textarea-base:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: rgb(241, 245, 249);
}

html.dark .textarea-base {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgba(100, 116, 139, 0.7);
}

html.dark .textarea-base:disabled {
    background-color: rgb(51, 65, 85);
}

/* Textarea Sizes */
.textarea-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    min-height: 4rem;
}

.textarea-md {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    min-height: 5rem;
}

.textarea-lg {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    min-height: 6rem;
}

.textarea-xl {
    padding: 0.875rem 1.125rem;
    font-size: 1rem;
    min-height: 7rem;
}

/* ============================================================================
   Select Base Styles
   ============================================================================ */

.select-base {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.75);
    background-color: rgb(255, 255, 255);
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(15, 23, 42);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    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.5em 1.5em;
}

.select-base:focus {
    border-color: rgba(var(--color-primary), 0.9);
    box-shadow: 0 0 0 3px rgba(var(--color-primary), 0.25);
    outline: none;
}

.select-base:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: rgb(241, 245, 249);
}

html.dark .select-base {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgba(100, 116, 139, 0.7);
    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='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
}

html.dark .select-base:disabled {
    background-color: rgb(51, 65, 85);
}

/* Select Sizes */
.select-sm {
    padding: 0.375rem 2.25rem 0.375rem 0.625rem;
    font-size: 0.8125rem;
}

.select-md {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.select-lg {
    padding: 0.625rem 2.75rem 0.625rem 0.875rem;
    font-size: 0.9375rem;
}

.select-xl {
    padding: 0.75rem 3rem 0.75rem 1rem;
    font-size: 1rem;
}

/* ============================================================================
   Switch / Toggle Base Styles
   ============================================================================ */

.switch-base {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.switch-base input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 2.75rem;
    height: 1.5rem;
    background-color: rgb(203, 213, 225);
    border-radius: 9999px;
    transition: background-color 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.switch-toggle::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: rgb(255, 255, 255);
    border-radius: 9999px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-base input:checked ~ .switch-toggle {
    background-color: rgb(14, 165, 233);
}

.switch-base input:checked ~ .switch-toggle::after {
    transform: translateX(1.25rem);
}

.switch-base input:focus-visible ~ .switch-toggle {
    outline: 2px solid rgba(var(--color-primary), 0.5);
    outline-offset: 2px;
}

.switch-base input:disabled ~ .switch-toggle {
    opacity: 0.5;
    cursor: not-allowed;
}

html.dark .switch-toggle {
    background-color: rgb(71, 85, 105);
}

html.dark .switch-toggle::after {
    background-color: rgb(203, 213, 225);
}

html.dark .switch-base input:checked ~ .switch-toggle {
    background-color: rgb(14, 165, 233);
}

/* Switch Sizes */
.switch-sm .switch-toggle {
    width: 2rem;
    height: 1.125rem;
}

.switch-sm .switch-toggle::after {
    width: 0.875rem;
    height: 0.875rem;
}

.switch-sm input:checked ~ .switch-toggle::after {
    transform: translateX(0.875rem);
}

.switch-md .switch-toggle {
    width: 2.75rem;
    height: 1.5rem;
}

.switch-md .switch-toggle::after {
    width: 1.25rem;
    height: 1.25rem;
}

.switch-md input:checked ~ .switch-toggle::after {
    transform: translateX(1.25rem);
}

.switch-lg .switch-toggle {
    width: 3.5rem;
    height: 1.875rem;
}

.switch-lg .switch-toggle::after {
    width: 1.625rem;
    height: 1.625rem;
}

.switch-lg input:checked ~ .switch-toggle::after {
    transform: translateX(1.625rem);
}

.switch-xl .switch-toggle {
    width: 4rem;
    height: 2.25rem;
}

.switch-xl .switch-toggle::after {
    width: 2rem;
    height: 2rem;
}

.switch-xl input:checked ~ .switch-toggle::after {
    transform: translateX(1.75rem);
}

/* Switch Color Variants */
.switch-success input:checked ~ .switch-toggle {
    background-color: rgb(16, 185, 129);
}

html.dark .switch-success input:checked ~ .switch-toggle {
    background-color: rgb(16, 185, 129);
}

.switch-danger input:checked ~ .switch-toggle {
    background-color: rgb(244, 63, 94);
}

html.dark .switch-danger input:checked ~ .switch-toggle {
    background-color: rgb(244, 63, 94);
}

.switch-warning input:checked ~ .switch-toggle {
    background-color: rgb(245, 158, 11);
}

html.dark .switch-warning input:checked ~ .switch-toggle {
    background-color: rgb(245, 158, 11);
}

/* ============================================================================
   Badge Base Styles (Extended)
   ============================================================================ */

/* Badge Sizes */
.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
}

.badge-md {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.badge-lg {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
}

.badge-xl {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Badge Color Variants */
.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: rgb(5, 150, 105);
}

html.dark .badge-success {
    background-color: rgba(16, 185, 129, 0.16);
    color: rgb(110, 231, 183);
}

.badge-danger {
    background-color: rgba(244, 63, 94, 0.1);
    color: rgb(225, 29, 72);
}

html.dark .badge-danger {
    background-color: rgba(244, 63, 94, 0.16);
    color: rgb(251, 113, 133);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: rgb(217, 119, 6);
}

html.dark .badge-warning {
    background-color: rgba(245, 158, 11, 0.16);
    color: rgb(252, 211, 77);
}

.badge-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: rgb(29, 78, 216);
}

html.dark .badge-info {
    background-color: rgba(59, 130, 246, 0.16);
    color: rgb(147, 197, 253);
}

/* ============================================================================
   Avatar Base Styles
   ============================================================================ */

.avatar-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 9999px;
    background-color: rgb(148, 163, 184);
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.avatar-base img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar Sizes */
.avatar-xs {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.625rem;
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
}

.avatar-md {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 3rem;
    height: 3rem;
    font-size: 1rem;
}

.avatar-xl {
    width: 4rem;
    height: 4rem;
    font-size: 1.25rem;
}

.avatar-2xl {
    width: 5rem;
    height: 5rem;
    font-size: 1.5rem;
}

/* Avatar with Ring */
.avatar-ring {
    box-shadow: 0 0 0 2px white, 0 0 0 4px rgb(14, 165, 233);
}

html.dark .avatar-ring {
    box-shadow: 0 0 0 2px rgb(15, 23, 42), 0 0 0 4px rgb(14, 165, 233);
}

/* ============================================================================
   Alert Base Styles (Extended)
   ============================================================================ */

/* Alert Variants */
.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: rgb(5, 150, 105);
}

html.dark .alert-success {
    background-color: rgba(16, 185, 129, 0.16);
    color: rgb(110, 231, 183);
}

.alert-danger {
    background-color: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.25);
    color: rgb(225, 29, 72);
}

html.dark .alert-danger {
    background-color: rgba(244, 63, 94, 0.16);
    color: rgb(251, 113, 133);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: rgb(217, 119, 6);
}

html.dark .alert-warning {
    background-color: rgba(245, 158, 11, 0.16);
    color: rgb(252, 211, 77);
}

/* ============================================================================
   Modal Base Styles
   ============================================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: rgb(var(--color-card));
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

html.dark .modal-content {
    background-color: rgb(30, 41, 59);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgb(226, 232, 240);
}

html.dark .modal-header {
    border-bottom-color: rgb(71, 85, 105);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgb(226, 232, 240);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

html.dark .modal-footer {
    border-top-color: rgb(71, 85, 105);
}

/* Modal Sizes */
.modal-sm {
    max-width: 24rem;
}

.modal-md {
    max-width: 32rem;
}

.modal-lg {
    max-width: 48rem;
}

.modal-xl {
    max-width: 64rem;
}

.modal-full {
    max-width: 90%;
}

/* ============================================================================
   Dropdown Base Styles
   ============================================================================ */

.dropdown-base {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    z-index: 40;
    min-width: 12rem;
    margin-top: 0.5rem;
    background-color: rgb(var(--color-card));
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown-base.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

html.dark .dropdown-menu {
    background-color: rgb(30, 41, 59);
    border-color: rgba(71, 85, 105, 0.5);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: rgb(71, 85, 105);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.dropdown-item:hover {
    background-color: rgb(241, 245, 249);
    color: rgb(15, 23, 42);
}

html.dark .dropdown-item {
    color: rgb(186, 199, 213);
}

html.dark .dropdown-item:hover {
    background-color: rgb(51, 65, 85);
    color: rgb(226, 232, 240);
}

.dropdown-divider {
    height: 1px;
    margin: 0.5rem 0;
    background-color: rgb(226, 232, 240);
}

html.dark .dropdown-divider {
    background-color: rgb(71, 85, 105);
}

/* ============================================================================
   Tooltip Base Styles
   ============================================================================ */

.tooltip-base {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    z-index: 50;
    padding: 0.5rem 0.75rem;
    background-color: rgb(15, 23, 42);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.tooltip-base:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* Tooltip Positions */
.tooltip-top .tooltip-content {
    bottom: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-bottom .tooltip-content {
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-left .tooltip-content {
    right: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
}

.tooltip-right .tooltip-content {
    left: calc(100% + 0.5rem);
    top: 50%;
    transform: translateY(-50%);
}

/* ============================================================================
   Progress Bar Base Styles
   ============================================================================ */

.progress-base {
    width: 100%;
    height: 0.75rem;
    background-color: rgb(226, 232, 240);
    border-radius: 9999px;
    overflow: hidden;
}

html.dark .progress-base {
    background-color: rgb(71, 85, 105);
}

.progress-bar {
    height: 100%;
    background-color: rgb(14, 165, 233);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Progress Sizes */
.progress-sm {
    height: 0.5rem;
}

.progress-md {
    height: 0.75rem;
}

.progress-lg {
    height: 1rem;
}

.progress-xl {
    height: 1.25rem;
}

/* Progress Color Variants */
.progress-success {
    background-color: rgb(16, 185, 129);
}

.progress-danger {
    background-color: rgb(244, 63, 94);
}

.progress-warning {
    background-color: rgb(245, 158, 11);
}

/* ============================================================================
   Skeleton Loader Base Styles
   ============================================================================ */

.skeleton-base {
    background: linear-gradient(
        90deg,
        rgb(226, 232, 240) 0%,
        rgb(241, 245, 249) 50%,
        rgb(226, 232, 240) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

html.dark .skeleton-base {
    background: linear-gradient(
        90deg,
        rgb(51, 65, 85) 0%,
        rgb(71, 85, 105) 50%,
        rgb(51, 65, 85) 100%
    );
    background-size: 200% 100%;
}

.skeleton-text {
    height: 1rem;
    width: 100%;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
}

.skeleton-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
}

.skeleton-button {
    height: 2.5rem;
    width: 6rem;
    border-radius: 0.75rem;
}

/* ============================================================================
   Tabs Base Styles
   ============================================================================ */

.tabs-base {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid rgb(226, 232, 240);
}

html.dark .tabs-base {
    border-bottom-color: rgb(71, 85, 105);
}

.tab-item {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(100, 116, 139);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab-item:hover {
    color: rgb(14, 165, 233);
}

.tab-item.active {
    color: rgb(14, 165, 233);
    border-bottom-color: rgb(14, 165, 233);
}

html.dark .tab-item {
    color: rgb(148, 163, 184);
}

html.dark .tab-item:hover,
html.dark .tab-item.active {
    color: rgb(14, 165, 233);
}

/* ============================================================================
   Breadcrumb Base Styles
   ============================================================================ */

.breadcrumb-base {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgb(100, 116, 139);
}

.breadcrumb-item a {
    color: rgb(14, 165, 233);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: rgb(2, 132, 199);
}

.breadcrumb-item.active {
    color: rgb(71, 85, 105);
    font-weight: 500;
}

html.dark .breadcrumb-item {
    color: rgb(148, 163, 184);
}

html.dark .breadcrumb-item.active {
    color: rgb(186, 199, 213);
}

.breadcrumb-separator {
    color: rgb(203, 213, 225);
}

html.dark .breadcrumb-separator {
    color: rgb(71, 85, 105);
}

/* ============================================================================
   Pagination Base Styles (Complementary to DataTables)
   ============================================================================ */

.pagination-base {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(71, 85, 105);
    background-color: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-item:hover {
    background-color: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.5);
}

.pagination-item.active {
    background-color: rgb(14, 165, 233);
    color: white;
    border-color: rgb(14, 165, 233);
}

.pagination-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

html.dark .pagination-item {
    color: rgb(186, 199, 213);
    border-color: rgba(148, 163, 184, 0.2);
}

html.dark .pagination-item:hover {
    background-color: rgba(148, 163, 184, 0.15);
}

/* ============================================================================
   Accordion Base Styles
   ============================================================================ */

.accordion-base {
    border: 1px solid rgb(226, 232, 240);
    border-radius: 0.75rem;
    overflow: hidden;
}

html.dark .accordion-base {
    border-color: rgb(71, 85, 105);
}

.accordion-item {
    border-bottom: 1px solid rgb(226, 232, 240);
}

.accordion-item:last-child {
    border-bottom: none;
}

html.dark .accordion-item {
    border-bottom-color: rgb(71, 85, 105);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    font-weight: 500;
    color: rgb(15, 23, 42);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: rgb(248, 250, 252);
}

html.dark .accordion-header {
    color: rgb(226, 232, 240);
}

html.dark .accordion-header:hover {
    background-color: rgb(51, 65, 85);
}

.accordion-icon {
    transition: transform 0.2s ease;
}

.accordion-item.is-open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.is-open .accordion-content {
    max-height: 1000px;
}

.accordion-body {
    padding: 1rem 1.25rem;
    color: rgb(71, 85, 105);
}

html.dark .accordion-body {
    color: rgb(186, 199, 213);
}

/* ============================================================================
   Toast Notification Base Styles
   ============================================================================ */

.toast-container {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
}

.toast-container.top-right {
    top: 1rem;
    right: 1rem;
}

.toast-container.top-left {
    top: 1rem;
    left: 1rem;
}

.toast-container.bottom-right {
    bottom: 1rem;
    right: 1rem;
}

.toast-container.bottom-left {
    bottom: 1rem;
    left: 1rem;
}

.toast-base {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    min-width: 20rem;
    padding: 1rem;
    background-color: rgb(var(--color-card));
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    pointer-events: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

html.dark .toast-base {
    background-color: rgb(30, 41, 59);
}

.toast-success {
    border-left: 4px solid rgb(16, 185, 129);
}

.toast-danger {
    border-left: 4px solid rgb(244, 63, 94);
}

.toast-warning {
    border-left: 4px solid rgb(245, 158, 11);
}

.toast-info {
    border-left: 4px solid rgb(14, 165, 233);
}

/* ============================================================================
   List Base Styles
   ============================================================================ */

.list-base {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgb(226, 232, 240);
    transition: background-color 0.2s ease;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background-color: rgb(248, 250, 252);
}

html.dark .list-item {
    border-bottom-color: rgb(71, 85, 105);
}

html.dark .list-item:hover {
    background-color: rgb(51, 65, 85);
}

.list-item.active {
    background-color: rgba(14, 165, 233, 0.08);
    color: rgb(14, 116, 144);
}

html.dark .list-item.active {
    background-color: rgba(14, 165, 233, 0.16);
    color: rgb(103, 232, 249);
}

.alert-base {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(var(--color-primary), 0.25);
    padding: 1rem;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.alert-info {
    background-color: rgba(var(--color-primary), 0.08);
    color: rgb(14, 116, 144);
}

html.dark .alert-info {
    background-color: rgba(var(--color-primary), 0.16);
    color: rgb(191, 219, 254);
}

.data-table-shell {
    border-radius: 1rem;
    background-color: rgb(var(--color-card));
    box-shadow: var(--shadow-base);
    overflow: hidden;
}

.data-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table-wrapper table.dataTable tbody > tr > td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Responsive Card View para Mobile */
@media screen and (max-width: 768px) {
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
        position: relative;
        padding-left: 2.5rem;
    }

    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
        top: 50%;
        left: 0.75rem;
        height: 1.25rem;
        width: 1.25rem;
        margin-top: -0.625rem;
        display: block;
        position: absolute;
        color: rgb(var(--color-primary));
        border: 2px solid rgb(var(--color-primary));
        border-radius: 0.5rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        background-color: rgb(var(--color-card));
        text-align: center;
        font-family: 'Bootstrap Icons';
        line-height: 1.1rem;
        content: '\F235';
        font-size: 0.75rem;
    }

    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
    .data-table-wrapper table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
        content: '\F229';
        background-color: rgb(var(--color-primary));
        color: white;
    }

    .data-table-wrapper table.dataTable.dtr-inline.collapsed tbody tr.parent {
        background-color: rgba(var(--color-primary), 0.08) !important;
    }

    html.dark .data-table-wrapper table.dataTable.dtr-inline.collapsed tbody tr.parent {
        background-color: rgba(var(--color-primary), 0.15) !important;
    }

    /* Child row styling - Card View */
    .data-table-wrapper table.dataTable > tbody > tr.child {
        background-color: transparent !important;
    }

    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        margin: 0;
        list-style: none;
        background: linear-gradient(to bottom, rgba(var(--color-primary), 0.03), transparent);
    }

    html.dark .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details {
        background: linear-gradient(to bottom, rgba(var(--color-primary), 0.08), transparent);
    }

    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li {
        border: none;
        padding: 0.625rem 0.875rem;
        background-color: rgba(255, 255, 255, 0.6);
        border-radius: 0.5rem;
        display: flex;
        align-items: flex-start;
        gap: 0.75rem;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    html.dark .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li {
        background-color: rgba(30, 41, 59, 0.6);
    }

    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li > span.dtr-title {
        min-width: 5.5rem;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.025em;
        color: rgb(71, 85, 105);
        display: inline-flex;
        align-items: center;
    }

    html.dark .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li > span.dtr-title {
        color: rgb(148, 163, 184);
    }

    .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li > span.dtr-data {
        flex: 1;
        font-size: 0.875rem;
        color: rgb(15, 23, 42);
        line-height: 1.4;
    }

    html.dark .data-table-wrapper table.dataTable > tbody > tr.child ul.dtr-details > li > span.dtr-data {
        color: rgb(226, 232, 240);
    }
}

.data-table-wrapper table.dataTable tbody > tr + tr > td {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

html.dark .data-table-wrapper table.dataTable tbody > tr + tr > td {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

/* Hover general para todas las filas de DataTables */
.data-table-wrapper table.dataTable tbody > tr:hover,
table.dataTable tbody tr:hover {
    background-color: rgba(148, 163, 184, 0.15) !important;
    cursor: pointer;
}

html.dark .data-table-wrapper table.dataTable tbody > tr:hover,
html.dark table.dataTable tbody tr:hover {
    background-color: rgba(71, 85, 105, 0.35) !important;
}

/* Estilos para filas seleccionadas */
.data-table-wrapper table.dataTable tbody > tr.is-selected,
.data-table-wrapper table.dataTable tbody > tr.is-selected > td,
table.dataTable tbody tr.selected,
table.dataTable tbody tr.selected > td {
    background-color: rgba(147, 197, 253, 0.65) !important;
    color: rgb(15, 23, 42) !important;
}

html.dark .data-table-wrapper table.dataTable tbody > tr.is-selected,
html.dark .data-table-wrapper table.dataTable tbody > tr.is-selected > td,
html.dark table.dataTable tbody tr.selected,
html.dark table.dataTable tbody tr.selected > td {
    background-color: rgba(14, 165, 233, 0.45) !important;
    color: rgb(226, 232, 240) !important;
}

/* Hover para filas seleccionadas - color más intenso */
table.dataTable tbody tr.selected:hover,
.data-table-wrapper table.dataTable tbody > tr.is-selected:hover {
    background-color: rgba(147, 197, 253, 0.85) !important;
}

html.dark table.dataTable tbody tr.selected:hover,
html.dark .data-table-wrapper table.dataTable tbody > tr.is-selected:hover {
    background-color: rgba(96, 165, 250, 0.65) !important;
}

/* Paginación de DataTables mejorada */
.dataTables_wrapper .dataTables_paginate {
    padding: 1rem;
    text-align: center;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
    margin: 0 0.125rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(71, 85, 105);
    background-color: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    transition: all 0.2s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.5);
    color: rgb(15, 23, 42);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background-color: rgb(var(--color-primary));
    color: white;
    border-color: rgb(var(--color-primary));
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: rgb(186, 199, 213);
    border-color: rgba(148, 163, 184, 0.2);
}

html.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background-color: rgba(148, 163, 184, 0.15);
    color: rgb(226, 232, 240);
}

.dataTables_wrapper .dataTables_info {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: rgb(100, 116, 139);
    text-align: center;
}

html.dark .dataTables_wrapper .dataTables_info {
    color: rgb(148, 163, 184);
}

.dataTables_wrapper .dataTables_length {
    padding: 0.75rem 1rem;
}

.dataTables_wrapper .dataTables_length select {
    min-width: 4rem;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background-color: white;
    color: rgb(15, 23, 42);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

html.dark .dataTables_wrapper .dataTables_length select {
    background-color: rgb(30, 41, 59);
    color: rgb(226, 232, 240);
    border-color: rgba(100, 116, 139, 0.5);
}

@media screen and (max-width: 640px) {
    .dataTables_wrapper .dataTables_paginate .paginate_button {
        min-width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8125rem;
        margin: 0 0.0625rem;
    }

    .dataTables_wrapper .dataTables_paginate .paginate_button.previous,
    .dataTables_wrapper .dataTables_paginate .paginate_button.next {
        padding: 0.375rem 0.625rem;
    }
}

.data-table-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: rgb(71, 85, 105);
}

@media (min-width: 640px) {
    .data-table-footer {
        flex-direction: row;
        justify-content: space-between;
    }
}

html.dark .data-table-footer {
    color: rgb(186, 199, 213);
}

/* Mobile optimizations */
@media screen and (max-width: 640px) {
    .card-base {
        padding: 0.875rem;
        border-radius: 0.875rem;
    }

    .btn-base {
        min-height: 42px;
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .input-base {
        padding: 0.5rem 0.625rem;
        font-size: 0.8125rem;
    }

    .label-base {
        font-size: 0.8125rem;
        margin-bottom: 0.375rem;
    }

    .data-table-shell {
        border-radius: 0.875rem;
    }

    /* Mejorar padding de celdas en mobile */
    .data-table-wrapper table.dataTable tbody > tr > td {
        padding: 0.625rem 0.75rem;
    }

    .data-table-wrapper table.dataTable thead > tr > th {
        padding: 0.625rem 0.75rem;
        font-size: 0.7rem;
    }
}

/* Tablet optimizations */
@media screen and (min-width: 641px) and (max-width: 1024px) {
    .data-table-wrapper table.dataTable tbody > tr > td {
        padding: 0.75rem 0.875rem;
    }
}

/* ========================================================================
   TOPBAR USER MENU DROPDOWN - RESPONSIVE
   ======================================================================== */

/* Base del dropdown - debe estar FUERA del flujo normal */
[data-user-menu-panel] {
    position: fixed !important; /* CRITICAL: Evita que herede overflow del contenedor */
    z-index: 1050; /* Por encima de modales backdrop */
    box-sizing: border-box !important; /* 🔧 CRÍTICO: Incluir padding en el width */
    /* ❌ NO establecer right/left aquí - JavaScript lo controla */
}

/* Mobile/Tablet: dropdown ocupa casi todo el ancho Y posición centrada */
@media screen and (max-width: 1024px) {
    [data-user-menu-panel] {
        /* ❌ COMENTADO: El JavaScript controla el posicionamiento ahora */
        /* left: 1rem !important; */
        /* right: 1rem !important; */
        /* width: auto !important; */
        /* min-width: calc(100vw - 2rem) !important; */
        /* max-width: calc(100vw - 2rem) !important; */
        
        /* Asegurar que no se corte verticalmente */
        max-height: calc(100vh - 6rem) !important;
        overflow-y: auto !important;
        transform-origin: top center !important; /* ✅ Centrar origen en mobile */
    }
    
    /* ❌ COMENTADO: JavaScript controla transform ahora */
    /* [data-user-menu-panel].scale-100 {
        transform: scale(1) !important;
    } */
    
    /* ❌ COMENTADO: JavaScript controla transform ahora */
    /* [data-user-menu-panel].scale-95 {
        transform: scale(0.95) !important;
    } */
    
    /* Botón de usuario más compacto en mobile */
    [data-user-menu-button] {
        padding: 0.5rem !important;
    }
    
    [data-user-menu-button] .hidden.sm\\:flex {
        display: none !important;
    }
}
