/* ============================================================
   CreaGestionale.it — Light Professional Theme 2026
   Clean, modern design matching the landing page
   ============================================================ */

/* -- CSS Variables ------------------------------------------ */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    --header-height: 64px;

    /* Brand — matches landing */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-glow: rgba(37, 99, 235, 0.15);

    /* Semantic */
    --success: #059669;
    --success-light: #10b981;
    --success-50: #ecfdf5;
    --warning: #d97706;
    --warning-light: #f59e0b;
    --warning-50: #fffbeb;
    --danger: #dc2626;
    --danger-light: #ef4444;
    --danger-50: #fef2f2;
    --info: #0891b2;
    --info-light: #06b6d4;
    --info-50: #ecfeff;

    /* Surfaces */
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #ffffff;
    --bg-elevated: #ffffff;
    --bg-gray: #f3f4f6;

    /* Borders */
    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;
    --border-color-strong: #d1d5db;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-tertiary: #9ca3af;

    /* Sidebar */
    --sidebar-bg: #ffffff;
    --sidebar-text: #6b7280;
    --sidebar-active: #2563eb;

    /* Header */
    --header-bg: rgba(255, 255, 255, 0.9);

    /* Motion */
    --transition-speed: 0.2s;
    --transition-smooth: 0.3s cubic-bezier(0.22, 1, 0.36, 1);

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: #e5e7eb;
    --glass-blur: 20px;
}

/* -- Base --------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--primary-200);
    color: var(--primary-hover);
}

/* -- Scrollbar ---------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* -- Layout ------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 40;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-smooth);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .sidebar-label,
.app-sidebar.collapsed .sidebar-section-title,
.app-sidebar.collapsed .sidebar-logo-text,
.app-sidebar.collapsed .sidebar-user-info,
.app-sidebar.collapsed .sidebar-badge {
    display: none;
}

.app-sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    padding: 0.65rem;
    margin: 0.15rem 0.5rem;
}

.app-sidebar.collapsed .sidebar-logo {
    justify-content: center;
    padding: 1.25rem 0.5rem;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-smooth);
    background: var(--bg-primary);
    min-height: 100vh;
}

.app-sidebar.collapsed ~ .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

.app-header {
    height: var(--header-height);
    background: var(--header-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 30;
    transition: all var(--transition-smooth);
}

.app-content {
    padding: 1.5rem;
    background: transparent;
}

/* -- Sidebar Nav -------------------------------------------- */
.sidebar-logo {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    transition: all var(--transition-smooth);
}

.sidebar-logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: opacity var(--transition-smooth);
}

.sidebar-section-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 1.25rem 1rem 0.5rem;
    font-weight: 600;
    transition: all var(--transition-smooth);
}

.sidebar-nav {
    padding: 0.5rem 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 10px;
    margin: 0.15rem 0.5rem;
    transition: all var(--transition-smooth);
    position: relative;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
    border-left-color: var(--primary-200);
}

.sidebar-nav a.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 500;
    border-left-color: transparent;
}

/* Active accent bar */
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav a .nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.55;
    transition: all var(--transition-smooth);
}

.sidebar-nav a:hover .nav-icon {
    opacity: 0.8;
}

.sidebar-nav a.active .nav-icon {
    opacity: 1;
    color: var(--primary);
}

.sidebar-label {
    transition: opacity var(--transition-smooth);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav a.active .sidebar-label {
    color: var(--primary);
}

.sidebar-badge {
    transition: all var(--transition-smooth);
}

/* -- Cards -------------------------------------------------- */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
    border-color: var(--border-color-strong);
    transform: translateY(-2px);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* -- Tables ------------------------------------------------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
}

table.app-table {
    width: 100%;
    border-collapse: collapse;
}

table.app-table thead th {
    background: var(--bg-gray);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

table.app-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color-light);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

table.app-table tbody tr {
    transition: all var(--transition-smooth);
}

table.app-table tbody tr:nth-child(even) {
    background: var(--bg-gray);
}

table.app-table tbody tr:hover {
    background: var(--primary-50);
}

table.app-table tbody tr:hover td {
    color: var(--text-primary);
}

/* -- Buttons ------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    background: #b91c1c;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
    background: #047857;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 10px;
}

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

.badge-success {
    background: var(--success-50);
    color: var(--success);
    border: 1px solid #d1fae5;
}

.badge-warning {
    background: var(--warning-50);
    color: var(--warning);
    border: 1px solid #fef3c7;
}

.badge-danger {
    background: var(--danger-50);
    color: var(--danger);
    border: 1px solid #fecaca;
}

.badge-info {
    background: var(--info-50);
    color: var(--info);
    border: 1px solid #cffafe;
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary);
    border: 1px solid var(--primary-200);
}

/* -- Forms -------------------------------------------------- */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.form-input {
    width: 100%;
    padding: 0.55rem 0.85rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
}

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

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
    background: var(--bg-secondary);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* Select styling */
.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* -- Auth layout -------------------------------------------- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 40%, #ecfdf5 100%);
}

.auth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 672px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.auth-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* -- Mobile responsive -------------------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 35;
    transition: all var(--transition-smooth);
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }

    .app-sidebar.mobile-open {
        transform: translateX(0);
    }

    .app-sidebar.mobile-open ~ .sidebar-overlay {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .app-content {
        padding: 1rem;
    }

    .modal-card {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
}

@media (max-width: 640px) {
    .page-header {
        flex-direction: column;
    }

    .global-search-wrapper {
        max-width: 100%;
        margin: 0 0.5rem;
    }
}

/* -- Loading spinner ---------------------------------------- */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.6s linear infinite;
}

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

/* -- Stats cards -------------------------------------------- */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    position: relative;
}

.stat-icon.primary {
    background: var(--primary-50);
    color: var(--primary);
}

.stat-icon.success {
    background: var(--success-50);
    color: var(--success);
}

.stat-icon.warning {
    background: var(--warning-50);
    color: var(--warning);
}

.stat-icon.danger {
    background: var(--danger-50);
    color: var(--danger);
}

.stat-icon.info {
    background: var(--info-50);
    color: var(--info);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* -- Skeleton loading --------------------------------------- */
.skeleton {
    background: linear-gradient(90deg,
        #f3f4f6 25%,
        #e5e7eb 50%,
        #f3f4f6 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-card {
    height: 120px;
}

.skeleton-table-row {
    height: 48px;
    margin-bottom: 4px;
}

/* -- Modal -------------------------------------------------- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-gray);
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

.modal-close:hover {
    background: var(--danger-50);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-gray);
}

/* -- Notification dropdown ---------------------------------- */
.notification-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 360px;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color-light);
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--bg-gray);
}

.notification-item.unread {
    background: var(--primary-50);
}

.notification-item:last-child {
    border-bottom: none;
}

/* -- Global search ------------------------------------------ */
.global-search-wrapper {
    position: relative;
    max-width: 400px;
    flex: 1;
    margin: 0 1rem;
}

.global-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
}

.global-search-input::placeholder {
    color: var(--text-muted);
}

.global-search-input:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.global-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 20px;
}

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-group {
    padding: 0.5rem 0;
}

.search-results-group-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0.25rem 1rem;
    font-weight: 600;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--transition-smooth);
}

.search-result-item:hover {
    background: var(--bg-gray);
    color: var(--text-primary);
}

/* -- Page header -------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.page-header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.page-header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-smooth);
}

.page-header-breadcrumb a:hover {
    color: var(--primary);
}

/* -- Empty state -------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    font-size: 64px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* -- Dropzone ----------------------------------------------- */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    background: var(--bg-gray);
}

.file-upload-zone:hover,
.file-upload-zone.dz-drag-hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

/* -- DataTables overrides ----------------------------------- */
.dataTables_wrapper {
    color: var(--text-secondary);
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all var(--transition-smooth);
}

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

.dataTables_wrapper .dataTables_length select {
    padding: 0.3rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.dataTables_wrapper .dataTables_length select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.dataTables_wrapper .dataTables_info {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.8rem;
    margin: 0 2px;
    color: var(--text-secondary) !important;
    border: 1px solid transparent !important;
    transition: all var(--transition-smooth);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-gray) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: var(--text-muted) !important;
    opacity: 0.4;
}

.dataTables_processing {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 10px !important;
    padding: 0.75rem 1.5rem !important;
    color: var(--text-secondary) !important;
}

/* -- Tabs --------------------------------------------------- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-smooth);
}

.tab-item:hover {
    color: var(--text-secondary);
    background: var(--bg-gray);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

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

/* -- Progress bar ------------------------------------------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-gray);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* -- Tooltip ------------------------------------------------ */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 0.35rem 0.65rem;
    background: var(--text-primary);
    color: #ffffff;
    font-size: 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* -- Divider ------------------------------------------------ */
.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* -- Avatar ------------------------------------------------- */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.avatar-lg {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
}

/* -- Utility classes ---------------------------------------- */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.bg-glass { background: var(--glass-bg); }
.border-glass { border: 1px solid var(--glass-border); }

/* -- SweetAlert2 light overrides ---------------------------- */
.swal2-popup {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1) !important;
}

.swal2-title {
    color: var(--text-primary) !important;
}

.swal2-html-container {
    color: var(--text-secondary) !important;
}

.swal2-confirm {
    background: var(--primary) !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3) !important;
}

.swal2-cancel {
    background: var(--bg-gray) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-secondary) !important;
    border-radius: 10px !important;
}

.swal2-input {
    background: var(--bg-secondary) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 10px !important;
}

/* -- Select2 light overrides -------------------------------- */
.select2-container--default .select2-selection--single {
    background: var(--bg-secondary) !important;
    border: 1.5px solid var(--border-color) !important;
    border-radius: 10px !important;
    height: auto !important;
    padding: 0.35rem 0;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
    padding-left: 0.85rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
}

.select2-dropdown {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
    overflow: hidden;
}

.select2-container--default .select2-results__option {
    color: var(--text-secondary) !important;
    padding: 0.5rem 0.85rem;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--primary-50) !important;
    color: var(--primary) !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-radius: 8px;
}

/* -- Toastr Light Theme ------------------------------------- */
#toast-container {
    pointer-events: auto;
}

#toast-container > div {
    background-color: #ffffff !important;
    background-image: none !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    padding: 16px 20px 16px 56px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    color: #111827 !important;
    opacity: 1 !important;
    min-width: 320px;
    max-width: 420px;
    animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) !important;
    position: relative;
    overflow: hidden;
}

/* Kill default toastr SVG icons */
#toast-container > .toast-success,
#toast-container > .toast-error,
#toast-container > .toast-warning,
#toast-container > .toast-info {
    background-image: none !important;
}

#toast-container > div::before {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-family: 'Material Icons' !important;
    font-size: 22px !important;
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
}

/* Left accent bar */
#toast-container > div::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 4px !important;
    border-radius: 14px 0 0 14px !important;
}

/* -- Success -- */
#toast-container > .toast-success {
    border-color: #d1fae5 !important;
}
#toast-container > .toast-success::before {
    content: 'check_circle' !important;
    color: #059669 !important;
    background: #ecfdf5 !important;
}
#toast-container > .toast-success::after {
    background: #059669 !important;
}

/* -- Error -- */
#toast-container > .toast-error {
    border-color: #fecaca !important;
}
#toast-container > .toast-error::before {
    content: 'error' !important;
    color: #dc2626 !important;
    background: #fef2f2 !important;
}
#toast-container > .toast-error::after {
    background: #dc2626 !important;
}

/* -- Warning -- */
#toast-container > .toast-warning {
    border-color: #fef3c7 !important;
}
#toast-container > .toast-warning::before {
    content: 'warning' !important;
    color: #d97706 !important;
    background: #fffbeb !important;
}
#toast-container > .toast-warning::after {
    background: #d97706 !important;
}

/* -- Info -- */
#toast-container > .toast-info {
    border-color: var(--primary-200) !important;
}
#toast-container > .toast-info::before {
    content: 'info' !important;
    color: var(--primary) !important;
    background: var(--primary-50) !important;
}
#toast-container > .toast-info::after {
    background: var(--primary) !important;
}

/* -- Close Button -- */
#toast-container .toast-close-button {
    color: #9ca3af !important;
    font-weight: 300 !important;
    font-size: 20px !important;
    text-shadow: none !important;
    opacity: 1 !important;
    position: absolute !important;
    right: 12px !important;
    top: 10px !important;
    transition: color 0.2s, transform 0.2s !important;
}
#toast-container .toast-close-button:hover {
    color: #111827 !important;
    transform: scale(1.2) !important;
}

/* -- Progress Bar -- */
#toast-container .toast-progress {
    height: 3px !important;
    background: #e5e7eb !important;
    border-radius: 0 0 14px 14px !important;
    opacity: 1 !important;
    bottom: 0 !important;
}
.toast-success .toast-progress { background: linear-gradient(90deg, #059669, #10b981) !important; }
.toast-error .toast-progress { background: linear-gradient(90deg, #dc2626, #ef4444) !important; }
.toast-warning .toast-progress { background: linear-gradient(90deg, #d97706, #f59e0b) !important; }
.toast-info .toast-progress { background: linear-gradient(90deg, #2563eb, #3b82f6) !important; }

/* -- Title -- */
#toast-container .toast-title {
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    margin-bottom: 2px !important;
    letter-spacing: 0.02em !important;
    color: #111827 !important;
}

/* -- Message -- */
#toast-container .toast-message {
    font-weight: 400 !important;
    font-size: 0.85rem !important;
    color: #6b7280 !important;
    line-height: 1.5 !important;
}

/* -- Hover -- */
#toast-container > div:hover {
    border-color: #d1d5db !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06) !important;
    transform: translateX(-4px);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* -- Slide-in Animation -- */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(80px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* -- Chart.js support --------------------------------------- */
.chart-container {
    position: relative;
    padding: 1rem 0;
}

/* -- Kanban columns ----------------------------------------- */
.kanban-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem;
    min-width: 280px;
}

.kanban-column-header {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.kanban-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: grab;
    transition: all var(--transition-smooth);
}

.kanban-card:hover {
    border-color: var(--primary-200);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.kanban-card:active {
    cursor: grabbing;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* -- Print styles ------------------------------------------- */
@media print {
    .app-sidebar,
    .app-header,
    .sidebar-overlay,
    .btn,
    .no-print {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
    }

    body {
        background: white !important;
        color: #000 !important;
    }

    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
    }
}
