/* public/css/dashboard.css */
:root {
    --primary: #0f6ea8;
    --primary-dark: #0b5480;
    --accent: #f4c542;
    --olive: #5f7d3a;
    --secondary: #6b7a90;
    --success: #2f9f6b;
    --danger: #da5a4f;
    --bg-dark: #123b6d;
    --bg-light: #f7f5ef;
    --surface: rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --text-dark: #203047;
    --text-light: #f8fafc;
    --border: rgba(18, 59, 109, 0.12);
    --shadow: 0 18px 40px rgba(18, 59, 109, 0.14);
    --shadow-sm: 0 10px 26px rgba(18, 59, 109, 0.08);
    --radius-md: 16px;
    --radius-lg: 22px;
    --border-color: rgba(18, 59, 109, 0.14);
    --text-color: #203047;
}

/* Autocomplete Ordini */
.autocomplete-container {
    position: relative;
    width: 100%;
}
.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}
.autocomplete-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}
.autocomplete-item:hover, .autocomplete-item.active {
    background: rgba(15, 110, 168, 0.08);
}
.autocomplete-item strong {
    color: var(--primary-dark);
}
.autocomplete-item small {
    display: block;
    color: var(--secondary);
    font-size: 0.8rem;
    margin-top: 0.2rem;
}
.autocomplete-item .price {
    float: right;
    font-weight: bold;
    color: var(--success);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top right, rgba(244, 197, 66, 0.24), transparent 26%),
        radial-gradient(circle at top left, rgba(15, 110, 168, 0.16), transparent 24%),
        linear-gradient(180deg, #fbfaf6 0%, #f3f7f4 100%);
    color: var(--text-dark);
}

/* Utility */
.w-100 { width: 100%; }
.mt-auto { margin-top: auto; }
.text-danger { color: var(--danger); }
.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 1.5rem;
}

.btn {
    padding: 0.7rem 1.1rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
    font-weight: 600;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(18, 59, 109, 0.14);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover { background: linear-gradient(135deg, #1380c1 0%, var(--primary-dark) 100%); }
.btn-secondary {
    background: rgba(255, 255, 255, 0.84);
    color: var(--text-dark);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.98);
}
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 0.45rem 0.8rem; }

.btn-ricezione-operativa {
    background: linear-gradient(135deg, var(--olive) 0%, #47612a 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(95, 125, 58, 0.22);
}

.btn-ricezione-operativa:hover {
    background: linear-gradient(135deg, #6d8e43 0%, #47612a 100%);
}

.btn-ricezione-storico {
    background: rgba(15, 110, 168, 0.12);
    color: var(--primary-dark);
    border: 1px solid rgba(15, 110, 168, 0.22);
    box-shadow: none;
}

.btn-ricezione-storico:hover {
    background: rgba(15, 110, 168, 0.2);
    color: var(--primary-dark);
}

.btn-sollecito-stato {
    background: rgba(244, 197, 66, 0.18);
    color: #8a6700;
    border: 1px solid rgba(244, 197, 66, 0.35);
    box-shadow: none;
}

.btn-sollecito-stato:hover {
    background: rgba(244, 197, 66, 0.28);
    color: #6c5000;
}

.btn-action-label {
    margin-left: 0.25rem;
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    color: inherit;
    text-decoration: none;
}

.brand-lockup-sidebar {
    color: white;
    width: 100%;
}

.brand-lockup-login {
    margin-bottom: 2rem;
    justify-content: flex-start;
    align-items: flex-start;
    width: 100%;
}

.brand-lockup strong,
.brand-lockup h2 {
    letter-spacing: 0.01em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.brand-lockup span,
.brand-eyebrow {
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--olive);
    font-weight: 700;
}

.brand-lockup-sidebar span,
.sidebar .brand-eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.brand-mark {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.brand-mark-login {
    width: 82px;
    height: 82px;
    padding: 0.25rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(234, 241, 248, 0.92));
    box-shadow: 0 18px 34px rgba(15, 110, 168, 0.18);
}

.brand-mark-sidebar {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark-topbar {
    width: 52px;
    height: 52px;
    padding: 0.2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 241, 247, 0.92));
    box-shadow: 0 10px 22px rgba(18, 59, 109, 0.14);
}

.brand-logo {
    width: 88px;
    max-width: 100%;
    height: auto;
    display: block;
}

.brand-lockup-sidebar .brand-logo {
    background: rgba(255, 255, 255, 0.96);
    padding: 0.35rem 0.5rem;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.brand-logo-topbar {
    width: 72px;
}

.brand-title {
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1.05;
    color: var(--text-dark);
}

.brand-title-small {
    font-size: 1.1rem;
    letter-spacing: 0.01em;
    color: inherit;
}

.brand-subtitle {
    max-width: 28rem;
    color: var(--secondary);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Login */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.form-container {
    width: 100%;
    max-width: 560px;
    padding: 2.4rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.76));
    border: 1px solid rgba(255, 255, 255, 0.7);
}

#login-form {
    position: relative;
    overflow: hidden;
}

#login-form::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, rgba(15, 110, 168, 0.08), rgba(244, 197, 66, 0.12));
    pointer-events: none;
}

#login-form > * {
    position: relative;
    z-index: 1;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 700; font-size: 1rem; }
.form-group input {
    width: 100%;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(233, 240, 249, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(15, 110, 168, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 110, 168, 0.14);
    transform: translateY(-1px);
}

/* Layout */
#app-container { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 290px;
    background:
        linear-gradient(180deg, rgba(18, 59, 109, 0.98) 0%, rgba(15, 110, 168, 0.94) 100%);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    box-shadow: 18px 0 30px rgba(18, 59, 109, 0.12);
}

.sidebar-header {
    padding: 1.6rem 1.4rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 0.75rem 1.2rem;
    gap: 0.35rem;
}

.nav-link {
    padding: 0.9rem 1rem;
    color: rgba(248, 250, 252, 0.82);
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
    border-radius: 16px;
    margin: 0 0.45rem;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.14);
    color: white;
    transform: translateX(4px);
}

/* Main */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    background: rgba(255, 255, 255, 0.78);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(14px);
}

.topbar-left,
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-copy-topbar .brand-eyebrow {
    color: var(--olive);
}

.brand-copy-sidebar .brand-title-small,
.brand-copy-sidebar .brand-eyebrow {
    color: var(--text-light);
}

.topbar-menu {
    font-size: 1.2rem;
    padding: 0.2rem 0.6rem;
}

.user-info {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--border);
    font-weight: 600;
}

.content-area { flex: 1; padding: 1.75rem; overflow-y: auto; }

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.view-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--olive);
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.view-title {
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.1;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.view-subtitle {
    color: var(--secondary);
    max-width: 56rem;
    line-height: 1.6;
    font-size: 0.96rem;
}

.action-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-panel {
    margin-bottom: 1rem;
}

.input-shell,
.form-group input,
.form-group select,
.filter-group input,
.filter-group select,
.ord-articolo-search,
.ord-prezzo,
.ord-quantita {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(233, 240, 249, 0.9);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
    font-family: inherit;
}

.input-shell:focus,
.form-group input:focus,
.form-group select:focus,
.filter-group input:focus,
.filter-group select:focus,
.ord-articolo-search:focus,
.ord-prezzo:focus,
.ord-quantita:focus {
    outline: none;
    border-color: rgba(15, 110, 168, 0.45);
    box-shadow: 0 0 0 4px rgba(15, 110, 168, 0.14);
    transform: translateY(-1px);
}

/* Filtri Pannello */
.filters-panel {
    padding: 1.5rem;
    margin-bottom: 2rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.2rem;
}

/* Tables & CRUD */
.crud-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    background: var(--surface-strong);
    border-radius: 22px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.table-panel {
    overflow-x: auto;
    overflow-y: hidden;
}

.table-floating {
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap; /* Impedisce al testo di andare a capo distruggendo il layout */
}
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border); }

th {
    background: linear-gradient(180deg, rgba(15, 110, 168, 0.08), rgba(95, 125, 58, 0.08));
    cursor: pointer;
    user-select: none;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

th:hover { background: rgba(15, 110, 168, 0.12); }

tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

tbody tr:hover {
    background: rgba(15, 110, 168, 0.04);
}

td {
    color: var(--text-color);
    vertical-align: middle;
}

.ricezione-merce-table {
    table-layout: fixed;
    white-space: normal;
}

.ricezione-merce-table th,
.ricezione-merce-table td {
    white-space: normal;
}

.ricezione-merce-table th:first-child,
.ricezione-merce-table td:first-child {
    min-width: 320px;
    width: 30%;
}

.articolo-ricezione-nome {
    display: block;
    font-weight: 600;
    word-break: break-word;
}

.articolo-ricezione-codice,
.articolo-ricezione-note {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.35;
    color: var(--secondary);
    word-break: break-word;
}

.ricezione-storico {
    margin-top: 0.55rem;
    display: grid;
    gap: 0.35rem;
}

.ricezione-storico-item {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(15, 110, 168, 0.12);
    border-radius: 10px;
    background: rgba(15, 110, 168, 0.04);
    font-size: 0.78rem;
    color: var(--secondary);
}

.ricezione-storico-item small {
    flex-basis: 100%;
    color: var(--text-color);
    white-space: normal;
}

.ricezione-storico-empty {
    margin-top: 0.55rem;
    font-size: 0.78rem;
    color: var(--secondary);
}

.ricezione-modal-info {
    margin-top: 0.75rem;
    margin-bottom: 0;
    color: var(--secondary);
    font-size: 0.9rem;
}

.ricezione-merce-table input,
.ricezione-merce-table textarea {
    width: 100%;
    min-width: 130px;
}

.ricezione-merce-table textarea {
    resize: vertical;
}

.table-empty {
    text-align: center;
    color: var(--secondary);
    padding: 1.5rem;
}

/* Righe articoli fuori produzione: evidenziate ma leggibili */
tr.row-fp {
    background: rgba(244, 197, 66, 0.10);
    border-left: 4px solid var(--accent);
}

tr.row-fp td {
    color: var(--secondary);
    font-style: italic;
}

tr.row-fp td:first-child {
    border-left: 4px solid var(--accent);
}

tr.row-fp:hover {
    background: rgba(244, 197, 66, 0.18);
}

/* Avviso articolo fuori produzione nel form ordini */
.ord-articolo-warning {
    margin-top: 0.5rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    background: rgba(244, 197, 66, 0.12);
    border: 1px solid rgba(244, 197, 66, 0.35);
    color: var(--text-dark);
}

.ord-articolo-warning-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ord-articolo-warning-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ord-articolo-warning-body {
    font-size: 0.9rem;
}

.ord-articolo-warning-alt {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ord-articolo-warning-alt-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ord-articolo-warning-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modale stato solleciti - azioni */
.solleciti-summary-actions {
    margin: 0.6rem 0 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.ord-sollecito-invia-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ord-sollecito-invia-btn:hover {
    background: var(--primary-dark, #1d4ed8);
}

.ord-sollecito-invia-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    min-width: 150px;
}

.status-cell {
    white-space: normal;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 0.45rem;
}

.status-draft {
    background: rgba(107, 122, 144, 0.14);
    color: var(--secondary);
}

.status-info {
    background: rgba(15, 110, 168, 0.12);
    color: var(--primary-dark);
}

.status-progress {
    background: rgba(95, 125, 58, 0.14);
    color: var(--olive);
}

.status-success {
    background: rgba(47, 159, 107, 0.14);
    color: var(--success);
}

.status-warning {
    background: rgba(244, 197, 66, 0.2);
    color: #8a6700;
}

.status-danger {
    background: rgba(218, 90, 79, 0.14);
    color: var(--danger);
}

.status-neutral {
    background: rgba(32, 48, 71, 0.1);
    color: var(--text-dark);
}

.status-meta,
.status-email {
    display: block;
    color: var(--secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.status-inline-meta {
    margin-top: 0.35rem;
}

.solleciti-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.solleciti-summary-card {
    background: rgba(15, 110, 168, 0.04);
    border: 1px solid rgba(15, 110, 168, 0.12);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.solleciti-summary-card small {
    display: block;
    color: var(--secondary);
    margin-bottom: 0.35rem;
}

.solleciti-summary-card strong {
    color: var(--text-dark);
    display: block;
}

.solleciti-summary-state {
    margin-bottom: 1rem;
}

.sollecito-log-list {
    display: grid;
    gap: 0.75rem;
}

.sollecito-log-item {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.9);
}

.sollecito-log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.sollecito-log-body {
    display: grid;
    gap: 0.25rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

.sollecito-log-body small {
    color: var(--text-dark);
    white-space: pre-wrap;
}

.pagination {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

.page-info {
    color: var(--secondary);
    font-weight: 600;
}

.table-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0.25rem 0 0.75rem;
}

.table-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(244, 197, 66, 0.18);
    border: 1px solid rgba(244, 197, 66, 0.35);
    color: #8a6700;
    font-size: 0.88rem;
    font-weight: 700;
}

/* Modals / Forms */
.modal { display: none; position: fixed; inset: 0; background: rgba(18, 59, 109, 0.35); align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal.active { display: flex; }
.modal-content {
    background: rgba(255, 255, 255, 0.96);
    padding: 2rem;
    border-radius: 24px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 28px 70px rgba(18, 59, 109, 0.2);
}
.modal-header { display: flex; justify-content: space-between; margin-bottom: 1.5rem; align-items: center; }

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Toast */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; }
.toast {
    background: white;
    border-left: 4px solid var(--primary);
    padding: 1rem 1.1rem;
    margin-top: 0.5rem;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(18, 59, 109, 0.16);
    animation: slideIn 0.3s ease forwards;
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Dashboard Charts */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
    padding: 1.5rem;
    border-radius: 22px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px rgba(18, 59, 109, 0.18);
}

.stat-card h3 { color: var(--secondary); font-size: 1rem; margin-bottom: 0.5rem; }
.stat-card .value { font-size: 2rem; font-weight: bold; color: var(--primary); }

.chart-card {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.section-card {
    padding: 1.75rem;
}

.order-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-heading {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    color: var(--text-dark);
}

.section-note {
    color: var(--secondary);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.order-details-table {
    table-layout: fixed;
}

.order-details-table .col-articolo {
    width: 70%;
}

.order-details-table .col-quantita {
    width: 20%;
}

.order-details-table .col-azioni {
    width: 10%;
}

.order-details-table th,
.order-details-table td {
    white-space: normal;
}

.order-details-table .autocomplete-container,
.order-details-table .ord-articolo-search {
    min-width: 100%;
}

.table-total-label {
    text-align: right;
    color: var(--secondary);
}

.table-total-strong {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.table-total-value {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary);
}

.section-divider {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid var(--border);
}

.btn-submit-order {
    font-size: 1.05rem;
}

.app-credit {
    text-align: center;
    font-size: 0.82rem;
    color: var(--secondary);
    margin-top: 1.4rem;
    margin-bottom: 0;
}

.sidebar-footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.64);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.6;
}

.mobile-only { display: none; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar { position: fixed; height: 100%; z-index: 1000; transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: 18px 0 30px rgba(0, 0, 0, 0.5); }
    .mobile-only { display: block; }
    .topbar {
        padding: 0.75rem 1rem;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
    .topbar-left,
    .topbar-actions {
        gap: 0.65rem;
    }
    .topbar-brand {
        justify-content: flex-start;
    }
    .brand-copy-topbar .brand-eyebrow {
        font-size: 0.7rem;
    }
    .brand-title-small {
        font-size: 1rem;
    }
    .user-info {
        display: none;
    }
    .content-area {
        padding: 1rem;
    }
    .view-header {
        align-items: stretch;
    }
    .action-group,
    .form-actions {
        width: 100%;
    }
    .pagination {
        flex-direction: column;
    }
    .brand-lockup-login {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .brand-mark-login {
        width: 74px;
        height: 74px;
    }
    .brand-subtitle {
        font-size: 0.9rem;
    }
    .form-container {
        max-width: 100%;
        padding: 1.75rem 1.2rem;
    }
    .order-form-grid {
        grid-template-columns: 1fr;
    }
    .order-details-table {
        table-layout: auto;
    }
    .table-actions {
        min-width: 180px;
    }
    .crud-header > div {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
}
