/* DDT Manager - Custom Styles */

:root {
    --mud-typography-default-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --field-height: 40px;
}

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== HIDE FLOATING LABELS - USE ONLY PLACEHOLDERS ===== */
.mud-input-label {
    display: none !important;
}

/* ===== UNIFORM FIELD HEIGHTS WITH VERTICAL CENTERING ===== */
.mud-input.mud-input-outlined {
    min-height: var(--field-height) !important;
    height: var(--field-height) !important;
}

.mud-input.mud-input-outlined .mud-input-slot {
    min-height: calc(var(--field-height) - 2px) !important;
    height: calc(var(--field-height) - 2px) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Fix text alignment inside inputs */
.mud-input-slot input,
.mud-input-slot .mud-input-root-text {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: normal !important;
}

/* Remove text truncation - allow full text */
.mud-input-slot input {
    text-overflow: clip !important;
    overflow: visible !important;
}

/* Fix for text offset in outlined inputs */
.mud-input.mud-input-outlined .mud-input-slot {
    box-sizing: border-box !important;
}

.mud-input.mud-input-outlined input {
    box-sizing: border-box !important;
    width: 100% !important;
}

/* Fix textarea alignment */
.mud-input-slot textarea {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    line-height: 1.4 !important;
}

/* Multiline textfields need different height */
.mud-input.mud-input-outlined.mud-input-multiline {
    height: auto !important;
    min-height: var(--field-height) !important;
}

/* Select specific fix - center the selected value */
.mud-select .mud-input-slot {
    display: flex !important;
    align-items: center !important;
}

.mud-select .mud-input-slot > div {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* Autocomplete fix */
.mud-autocomplete .mud-input-slot {
    display: flex !important;
    align-items: center !important;
}

/* DatePicker/TimePicker fix */
.mud-picker .mud-input-slot {
    display: flex !important;
    align-items: center !important;
}

/* Placeholder styling */
.mud-input-slot input::placeholder,
.mud-input-slot textarea::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
    opacity: 1 !important;
}

/* Adornment alignment */
.mud-input-adornment {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* Clear button alignment */
.mud-input-outlined .mud-icon-button {
    display: flex !important;
    align-items: center !important;
}

/* ===== CARDS STYLING ===== */
.stat-card {
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-accent, #1976D2), transparent);
}

.stat-card.today { --card-accent: #1976D2; }
.stat-card.week { --card-accent: #7B1FA2; }
.stat-card.month { --card-accent: #00897B; }
.stat-card.year { --card-accent: #F57C00; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
}

.stat-icon {
    opacity: 0.15;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem !important;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(25, 118, 210, 0.1);
}

.section-header .mud-icon-root {
    color: var(--mud-palette-primary);
}

/* ===== TABLE IMPROVEMENTS ===== */
.mud-table {
    border-radius: 8px !important;
    overflow: hidden;
}

.mud-table-head .mud-table-cell {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(0,0,0,0.02);
}

.mud-table-row:hover {
    background-color: rgba(25, 118, 210, 0.04) !important;
}

/* ===== DRAWER STYLING ===== */
.mud-drawer {
    border-right: 1px solid rgba(0,0,0,0.08) !important;
}

.mud-navmenu .mud-nav-link {
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.mud-navmenu .mud-nav-link:hover {
    background-color: rgba(25, 118, 210, 0.08);
}

.mud-navmenu .mud-nav-link.active {
    background-color: rgba(25, 118, 210, 0.12);
    font-weight: 600;
}

/* ===== PAPER & BUTTONS ===== */
.mud-paper {
    border-radius: 12px !important;
}

.mud-button-root {
    border-radius: 8px !important;
    text-transform: none !important;
    font-weight: 500 !important;
}

.mud-chip {
    font-weight: 500;
}

.mud-appbar {
    box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
}

/* ===== LOGIN PAGE ===== */
.login-background {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ===== FILTER PANEL ===== */
.filter-panel {
    background: linear-gradient(to bottom, rgba(25, 118, 210, 0.02), transparent);
    border: 1px solid rgba(25, 118, 210, 0.08);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-state .mud-icon-root {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 16px;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* ===== ERROR BOUNDARY ===== */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHh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Nzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "Si è verificato un errore."
}
