/**
 * Roboost Admin Theme
 * Based on Tailwind CSS + Flowbite
 * 
 * Questo file contiene le variabili CSS custom e gli stili base per il tema admin.
 * Per gli stili Tailwind e Flowbite, vengono caricati via CDN.
 */

@theme {
    /* FONTS */
    --font-sans: 'Inter', 'ui-sans-serif', 'system-ui', '-apple-system', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans', 'sans-serif', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    --font-body: 'Inter', 'ui-sans-serif', 'system-ui', '-apple-system', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', 'Noto Sans', 'sans-serif';
    --font-mono: 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', 'monospace';

    /* TEXT SIZES */
    --text-2xs: 0.625rem;
    --spacing-8xl: 90rem;
    --leading-9: 36px;
    --leading-8: 32px;
    --leading-7: 28px;
    --leading-6: 24px;
    --leading-5: 20px;
    --leading-4: 16px;
    --leading-none: 1px;
    --tracking-tighter: -0.8px;
    --leading-heading-none: 60px;
    --tracking-tight: -0.4px;

    /* BORDER RADIUS - Modern rounded corners */
    --radius-0: 0px;
    --radius-xxs: 2px;
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius: 8px;
    --radius-base: 12px;
    --radius-lg: 16px;

    /* BORDER WIDTH */
    --default-border-width: 1px;

    /* BRAND COLORS - Professional Blue */
    --color-brand-50: #f5f7f9;
    --color-brand-100: #e9ebf2;
    --color-brand-200: #ccd6ea;
    --color-brand-300: #94b2f5;
    --color-brand-400: #608df0;
    --color-brand-500: #2d69ec;
    --color-brand-600: #2563eb;
    --color-brand-700: #1041ad;
    --color-brand-800: #0c3183;
    --color-brand-900: #09235d;
    --color-brand-950: #0b1937;

    /* TEXT COLORS */
    --color-body: var(--color-gray-600);
    --color-body-subtle: var(--color-gray-500);
    --color-heading: var(--color-gray-900);
    --color-fg-brand-subtle: #ccd6ea;
    --color-fg-brand: #1041ad;
    --color-fg-brand-strong: #09235d;

    /* STATUS COLORS */
    --color-fg-success: var(--color-emerald-700);
    --color-fg-success-strong: var(--color-emerald-900);
    --color-fg-danger: var(--color-rose-700);
    --color-fg-danger-strong: var(--color-rose-900);
    --color-fg-warning-subtle: var(--color-orange-600);
    --color-fg-warning: var(--color-orange-900);
    --color-fg-yellow: var(--color-yellow-400);
    --color-fg-disabled: var(--color-gray-400);

    /* BACKGROUND COLORS */
    --color-neutral-primary-soft: var(--color-white);
    --color-neutral-primary: var(--color-white);
    --color-neutral-secondary-soft: #F0EEE6;
    --color-neutral-secondary: #F0EEE6;
    --color-neutral-tertiary-soft: var(--color-gray-100);
    --color-neutral-tertiary: var(--color-gray-100);
    --color-neutral-quaternary: var(--color-gray-200);

    /* BRAND BACKGROUND */
    --color-brand-softer: #f5f7f9;
    --color-brand-soft: #e9ebf2;
    --color-brand: #1041ad;
    --color-brand-medium: #ccd6ea;
    --color-brand-strong: #0c3183;

    /* STATUS BACKGROUNDS */
    --color-success-soft: var(--color-emerald-50);
    --color-success: var(--color-emerald-700);
    --color-success-medium: var(--color-emerald-100);
    --color-success-strong: var(--color-emerald-800);
    --color-danger-soft: var(--color-rose-50);
    --color-danger: var(--color-rose-700);
    --color-danger-medium: var(--color-rose-100);
    --color-danger-strong: var(--color-rose-800);
    --color-warning-soft: var(--color-orange-50);
    --color-warning: var(--color-orange-500);
    --color-warning-medium: var(--color-orange-100);
    --color-warning-strong: var(--color-orange-700);

    /* BORDER COLORS */
    --color-buffer: var(--color-white);
    --color-muted: var(--color-gray-50);
    --color-light-subtle: var(--color-gray-100);
    --color-light: var(--color-gray-100);
    --color-default-subtle: var(--color-gray-200);
    --color-default: var(--color-gray-200);
    --color-success-subtle: var(--color-emerald-200);
    --color-danger-subtle: var(--color-rose-200);
    --color-warning-subtle: var(--color-orange-200);
    --color-brand-subtle: #ccd6ea;
    --color-brand-light: #134fd2;
    --color-dark-subtle: var(--color-gray-800);
    --color-dark-backdrop: var(--color-gray-950);
}

/* DARK MODE */
.dark {
    /* text color variables */
    --color-body: var(--color-gray-400);
    --color-body-subtle: var(--color-gray-400);
    --color-heading: var(--color-white);
    --color-fg-brand-subtle: #ccd6ea;
    --color-fg-brand: #2d69ec;
    --color-fg-brand-strong: #608df0;
    --color-fg-success: var(--color-emerald-600);
    --color-fg-success-strong: var(--color-emerald-300);
    --color-fg-danger: var(--color-rose-500);
    --color-fg-danger-strong: var(--color-rose-300);
    --color-fg-warning-subtle: var(--color-orange-500);
    --color-fg-warning: var(--color-orange-300);
    --color-fg-disabled: var(--color-gray-600);

    /* background color variables */
    --color-neutral-primary-soft: var(--color-gray-900);
    --color-neutral-primary: var(--color-gray-950);
    --color-neutral-secondary-soft: var(--color-gray-900);
    --color-neutral-secondary: var(--color-gray-950);
    --color-neutral-tertiary-soft: var(--color-gray-900);
    --color-neutral-tertiary: var(--color-gray-800);
    --color-neutral-quaternary: var(--color-gray-700);
    --color-brand-softer: #0b1937;
    --color-brand-soft: #09235d;
    --color-brand: #134fd2;
    --color-brand-medium: #09235d;
    --color-brand-strong: #1041ad;
    --color-success-soft: var(--color-emerald-950);
    --color-success: var(--color-emerald-600);
    --color-success-medium: var(--color-emerald-900);
    --color-danger-soft: var(--color-rose-950);
    --color-danger: var(--color-rose-700);
    --color-danger-medium: var(--color-rose-900);
    --color-warning-soft: var(--color-orange-950);
    --color-warning: var(--color-orange-600);
    --color-warning-medium: var(--color-orange-900);

    /* border color variables */
    --color-buffer: var(--color-gray-950);
    --color-muted: var(--color-gray-900);
    --color-light-subtle: var(--color-gray-900);
    --color-light: var(--color-gray-800);
    --color-default-subtle: var(--color-gray-900);
    --color-default: var(--color-gray-800);
    --color-success-subtle: var(--color-emerald-900);
    --color-danger-subtle: var(--color-rose-900);
    --color-warning-subtle: var(--color-orange-900);
    --color-brand-subtle: #09235d;
    --color-dark-subtle: var(--color-gray-700);
}

/* ============================================
   ROBOOST ADMIN CUSTOM STYLES
   ============================================ */

/* Sidebar transition styles */
.sidebar-transition {
    transition: transform 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Main content transition when sidebar toggles */
.main-content-transition {
    transition: margin-left 0.3s ease-in-out, padding-left 0.3s ease-in-out;
}

/* Custom scrollbar for sidebar */
.sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
}

.sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.5);
}

.dark .sidebar-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.5);
}

/* Loading spinner overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .loading-overlay {
    background-color: rgba(17, 24, 39, 0.8);
}

/* Toast container positioning */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* HTMX loading indicator */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Form validation styles */
.form-error {
    border-color: #f87171 !important;
}

.form-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.dark .form-error {
    border-color: #dc2626 !important;
}

/* Active menu item */
.menu-item-active {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    border-left: 3px solid #2563eb;
}

.dark .menu-item-active {
    background-color: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

/* Card hover effect */
.card-hover {
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.card-hover:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

/* Table row hover */
.table-row-hover:hover {
    background-color: rgba(249, 250, 251, 1);
}

.dark .table-row-hover:hover {
    background-color: rgba(31, 41, 55, 1);
}

/* Dropdown animation */
.dropdown-enter {
    opacity: 0;
    transform: scale(0.95) translateY(-0.5rem);
}

.dropdown-enter-active {
    opacity: 1;
    transform: scale(1) translateY(0);
    transition: opacity 100ms ease-out, transform 100ms ease-out;
}

.dropdown-leave {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.dropdown-leave-active {
    opacity: 0;
    transform: scale(0.95) translateY(-0.5rem);
    transition: opacity 75ms ease-in, transform 75ms ease-in;
}

/* Badge pulse animation */
@keyframes badge-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.badge-pulse {
    animation: badge-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus ring for accessibility */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.dark .focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3);
}

/* Utility classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   DATATABLES - TAILWIND/FLOWBITE STYLES
   ============================================ */

/* DataTables wrapper */
.dataTables_wrapper {
    position: relative;
    width: 100%;
}

/* Table base styles */
#data-table {
    border-collapse: collapse;
    width: 100% !important;
    table-layout: auto;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    overflow: hidden;
}

.dark #data-table {
    border-color: rgb(55 65 81);
}

#data-table thead th {
    background-color: rgb(249 250 251);
    border-bottom: 1px solid rgb(229 231 235);
    border-right: 1px solid rgb(229 231 235);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

#data-table thead th:last-child {
    border-right: none;
}

.dark #data-table thead th {
    background-color: rgb(31 41 55);
    border-bottom-color: rgb(55 65 81);
    border-right-color: rgb(55 65 81);
    color: rgb(156 163 175);
}

#data-table tbody tr {
    background-color: white;
    border-bottom: 1px solid rgb(229 231 235);
    transition: background-color 0.15s ease-in-out;
}

.dark #data-table tbody tr {
    background-color: rgb(17 24 39);
    border-bottom-color: rgb(55 65 81);
}

#data-table tbody tr:last-child {
    border-bottom: none;
}

#data-table tbody tr:hover {
    background-color: rgb(249 250 251);
}

.dark #data-table tbody tr:hover {
    background-color: rgb(31 41 55);
}

#data-table tbody td {
    vertical-align: middle;
    border-right: 1px solid rgb(229 231 235);
}

#data-table tbody td:last-child {
    border-right: none;
}

.dark #data-table tbody td {
    border-right-color: rgb(55 65 81);
}

/* Table density variants (retrocompatibilità) */
/* table-xs: extra compact */
#data-table.table-xs thead th,
#data-table.table-xs tbody td {
    padding: 0.25rem 0.5rem;
}

/* table-sm: compact */
#data-table.table-sm thead th,
#data-table.table-sm tbody td {
    padding: 0.375rem 0.75rem;
}

/* table-de: default (esplicito, stessi valori base) */
#data-table.table-de thead th,
#data-table.table-de tbody td {
    padding: 0.75rem 1rem;
}

/* table-lg: large */
#data-table.table-lg thead th,
#data-table.table-lg tbody td {
    padding: 1rem 1.25rem;
}

/* table-xl: extra large */
#data-table.table-xl thead th,
#data-table.table-xl tbody td {
    padding: 1.25rem 1.5rem;
}

/* Sorting: assicura padding-right minimo per l'indicatore */
#data-table.table-xs thead th.sorting,
#data-table.table-xs thead th.sorting_asc,
#data-table.table-xs thead th.sorting_desc {
    padding-right: 1.25rem;
}

#data-table.table-sm thead th.sorting,
#data-table.table-sm thead th.sorting_asc,
#data-table.table-sm thead th.sorting_desc {
    padding-right: 1.5rem;
}

/* Sorting indicators */
#data-table thead th.sorting,
#data-table thead th.sorting_asc,
#data-table thead th.sorting_desc {
    cursor: pointer;
    position: relative;
    padding-right: 1.75rem;
}

#data-table thead th.sorting::after,
#data-table thead th.sorting_asc::after,
#data-table thead th.sorting_desc::after {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgb(156 163 175);
}

#data-table thead th.sorting::after {
    content: "↕";
    opacity: 0.4;
}

#data-table thead th.sorting_asc::after {
    content: "↑";
    opacity: 1;
    color: rgb(37 99 235);
}

#data-table thead th.sorting_desc::after {
    content: "↓";
    opacity: 1;
    color: rgb(37 99 235);
}

.dark #data-table thead th.sorting_asc::after,
.dark #data-table thead th.sorting_desc::after {
    color: rgb(96 165 250);
}

/* Length select */
.dataTables_length {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_length select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
    background-color: rgb(249 250 251);
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    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;
    cursor: pointer;
}

.dark .dataTables_length select {
    color: white;
    background-color: rgb(55 65 81);
    border-color: rgb(75 85 99);
    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");
}

.dataTables_length select:focus {
    outline: none;
    border-color: rgb(37 99 235);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Search input */
.dataTables_filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataTables_filter input[type="search"] {
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
    background-color: rgb(249 250 251);
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3e%3c/svg%3e");
    background-position: 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
}

.dark .dataTables_filter input[type="search"] {
    color: white;
    background-color: rgb(55 65 81);
    border-color: rgb(75 85 99);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3e%3c/svg%3e");
}

.dataTables_filter input[type="search"]:focus {
    outline: none;
    border-color: rgb(37 99 235);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Top filters select */
#top_filters select.filter {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2rem;
    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.25em 1.25em;
}

.dark #top_filters select.filter {
    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");
}

.dataTables_filter input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    height: 1rem;
    width: 1rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3e%3c/svg%3e");
    background-size: contain;
}

/* Info text */
.dataTables_info {
    font-size: 0.875rem;
    color: rgb(107 114 128);
}

.dark .dataTables_info {
    color: rgb(156 163 175);
}

/* Pagination - Grouped */
.dataTables_paginate {
    display: inline-flex;
    align-items: stretch;
}

.dataTables_paginate > span {
    display: inline-flex;
    align-items: stretch;
}

.dataTables_paginate .paginate_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(107 114 128);
    background-color: white;
    border: 1px solid rgb(209 213 219);
    border-radius: 0;
    margin-left: -1px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    position: relative;
}

.dataTables_paginate .paginate_button.previous {
    margin-left: 0;
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    padding: 0 0.5rem;
}

.dataTables_paginate .paginate_button.next {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    padding: 0 0.5rem;
}

.dark .dataTables_paginate .paginate_button {
    color: rgb(156 163 175);
    background-color: rgb(55 65 81);
    border-color: rgb(75 85 99);
}

.dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    color: rgb(17 24 39);
    background-color: rgb(243 244 246);
    border-color: rgb(209 213 219);
    z-index: 1;
}

.dark .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
    color: white;
    background-color: rgb(75 85 99);
}

.dataTables_paginate .paginate_button.current {
    color: white;
    background-color: rgb(37 99 235);
    border-color: rgb(37 99 235);
    z-index: 2;
}

.dark .dataTables_paginate .paginate_button.current {
    background-color: rgb(37 99 235);
    border-color: rgb(37 99 235);
}

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

.dataTables_paginate > span > .ellipsis,
.dataTables_paginate .paginate_button.disabled:not(.previous):not(.next) {
    border: none;
    background: none;
    padding: 0 0.25rem;
    min-width: auto;
    color: rgb(107 114 128);
    letter-spacing: 0.1em;
}

/* Processing indicator */
.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.dark .dataTables_processing {
    background-color: rgba(31, 41, 55, 0.9);
}

/* Empty table */
.dataTables_empty {
    text-align: center;
    padding: 2rem;
    color: rgb(107 114 128);
}

.dark .dataTables_empty {
    color: rgb(156 163 175);
}

/* Row checkbox */
#data-table tbody td .input-chk {
    width: 1rem;
    height: 1rem;
    color: rgb(37 99 235);
    background-color: rgb(249 250 251);
    border: 1px solid rgb(209 213 219);
    border-radius: 0.25rem;
    cursor: pointer;
}

.dark #data-table tbody td .input-chk {
    background-color: rgb(55 65 81);
    border-color: rgb(75 85 99);
}

#data-table tbody td .input-chk:checked {
    background-color: rgb(37 99 235);
    border-color: rgb(37 99 235);
}

#data-table tbody td .input-chk:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Action buttons inside table */
#data-table .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
}

#data-table .btn-action-primary {
    color: rgb(37 99 235);
    background-color: rgb(239 246 255);
}

#data-table .btn-action-primary:hover {
    color: white;
    background-color: rgb(37 99 235);
}

#data-table .btn-action-danger {
    color: rgb(220 38 38);
    background-color: rgb(254 242 242);
}

#data-table .btn-action-danger:hover {
    color: white;
    background-color: rgb(220 38 38);
}

#data-table .btn-action-warning {
    color: rgb(217 119 6);
    background-color: rgb(255 251 235);
}

#data-table .btn-action-warning:hover {
    color: white;
    background-color: rgb(217 119 6);
}

#data-table .btn-action-success {
    color: rgb(22 163 74);
    background-color: rgb(240 253 244);
}

#data-table .btn-action-success:hover {
    color: white;
    background-color: rgb(22 163 74);
}

.dark #data-table .btn-action-primary {
    color: rgb(96 165 250);
    background-color: rgba(37, 99, 235, 0.2);
}

.dark #data-table .btn-action-danger {
    color: rgb(248 113 113);
    background-color: rgba(220, 38, 38, 0.2);
}

.dark #data-table .btn-action-warning {
    color: rgb(251 191 36);
    background-color: rgba(217, 119, 6, 0.2);
}

.dark #data-table .btn-action-success {
    color: rgb(74 222 128);
    background-color: rgba(22, 163, 74, 0.2);
}

/* Responsive mobile card view */
@media (max-width: 640px) {
    #table-card.tabellar #data-table thead {
        display: none;
    }

    #table-card.tabellar #data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid rgb(229 231 235);
        border-radius: 0.5rem;
        padding: 0.5rem;
    }

    .dark #table-card.tabellar #data-table tbody tr {
        border-color: rgb(55 65 81);
    }

    #table-card.tabellar #data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        border-bottom: 1px solid rgb(243 244 246);
    }

    .dark #table-card.tabellar #data-table tbody td {
        border-bottom-color: rgb(55 65 81);
    }

    #table-card.tabellar #data-table tbody td:last-child {
        border-bottom: none;
    }

    #table-card.tabellar #data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: rgb(55 65 81);
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .dark #table-card.tabellar #data-table tbody td::before {
        color: rgb(156 163 175);
    }
}

/* DataTables wrapper and table overflow */
.dataTables_scroll,
.dataTables_scrollBody {
    overflow-x: auto;
}

#data-table td {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#data-table td.actions-column {
    white-space: nowrap;
    width: 1%;
}

#data-table td.checkbox-column {
    width: 1%;
}

/* Column specific widths */
#data-table th.dt-orderable-none:first-child,
#data-table td:first-child {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
}

/* Actions dropdown styling */
.dt-actions-dropdown {
    position: relative;
    display: inline-block;
}

.dt-actions-menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
    min-width: 160px;
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: none;
}

.dark .dt-actions-menu {
    background-color: rgb(31 41 55);
    border-color: rgb(55 65 81);
}

.dt-actions-menu.show {
    display: block;
}

.dt-actions-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: rgb(55 65 81);
    text-decoration: none;
    transition: background-color 0.15s;
}

.dark .dt-actions-menu a {
    color: rgb(209 213 219);
}

.dt-actions-menu a:hover {
    background-color: rgb(243 244 246);
}

.dark .dt-actions-menu a:hover {
    background-color: rgb(55 65 81);
}

.dt-actions-menu a.text-danger {
    color: rgb(220 38 38);
}

.dt-actions-menu a.text-danger:hover {
    background-color: rgb(254 242 242);
}

.dark .dt-actions-menu a.text-danger:hover {
    background-color: rgba(220, 38, 38, 0.2);
}

