@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #09090b;
    --sidebar-bg: rgba(9, 9, 11, 0.6);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-1: #6366f1; /* Indigo */
    --accent-2: #ec4899; /* Pink */
    --accent-3: #14b8a6; /* Teal */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.06);
    --danger: #f43f5e;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Luxury Animated Background Gradients */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: float 20s infinite ease-in-out alternate;
    opacity: 0.5;
}

body::before {
    top: -10%; left: -10%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, var(--accent-1), transparent 70%);
}

body::after {
    bottom: -10%; right: -10%;
    width: 700px; height: 700px;
    background: radial-gradient(circle, var(--accent-3), transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(100px, 50px); }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Update for User Profile */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    padding: 2.5rem 1.5rem;
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem; /* ridotto per il profile */
}

.brand-logo {
    width: 45px; height: 45px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.logo h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem; font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* User Profile Sidebar */
.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.user-profile .avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--accent-1);
}
.user-info h3 { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom:0.2rem; }
.user-info p { font-size: 0.8rem; color: var(--text-muted); }

.sidebar nav { flex: 1; display:flex; flex-direction:column; }
nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500; display: flex; align-items: center;
    gap: 1rem; padding: 1rem 1.25rem; border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}

nav a::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(99,102,241,0.1), transparent);
    opacity: 0; transition: opacity 0.4s ease;
}

nav li.active a, nav a:hover { color: var(--text-main); }
nav li.active a::before, nav a:hover::before { opacity: 1; }
nav li.active a i {
    color: var(--accent-1);
    filter: drop-shadow(0 0 8px rgba(99,102,241,0.5));
}
.logout-li { margin-top: auto; }
.logout-li a { color: #f87171; }
.logout-li a:hover { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 4rem;
    display: flex;
    flex-direction: column;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    display: flex; align-items: center; gap: 1rem;
    padding: 0.8rem 1.5rem; border-radius: 20px;
    width: 400px;
}
.search-bar i { color: var(--text-muted); }
.search-bar input {
    background: transparent; border: none; color: #fff; width: 100%;
    outline: none; font-family: inherit; font-size: 0.95rem;
}
.header-actions { display:flex; gap:1rem; }
.icon-only { padding: 0.8rem 1.1rem; border-radius:12px; font-size:1.1rem; }

/* Premium Buttons */
.btn {
    padding: 0.8rem 1.8rem; border-radius: 12px;
    font-weight: 600; font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer; border: none; transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-1), #4f46e5); color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4); position: relative; overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px); box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05); color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* Prog Cards */
.prog-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem;
}
.prog-info h3 { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 0.5rem; font-family: 'Outfit'; }
.prog-info p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; max-width: 200px;}

.circle-prog { position: relative; width: 90px; height: 90px; }
.circular-chart { display: block; margin: 0 auto; max-width: 100%; max-height: 250px; }
.circle-bg { fill: none; stroke: rgba(255, 255, 255, 0.05); stroke-width: 3.8; }
.circle { fill: none; stroke-width: 2.8; stroke-linecap: round; animation: progress 1.5s ease-out forwards; }
@keyframes progress { 0% { stroke-dasharray: 0 100; } }

.circular-chart.indigo .circle { stroke: var(--accent-1); }
.circular-chart.pink .circle { stroke: #ec4899; }
.circular-chart.teal .circle { stroke: #14b8a6; }

.prog-value {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 0.95rem; font-weight: 600; color: #fff; font-family:'Outfit';
}

/* Overview Cards from before */
.overview-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.card {
    padding: 2rem; display: flex; align-items: center; gap: 1.5rem;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    position: relative; overflow: hidden;
}
.card:hover {
    transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2);
}

.chart-card { display: flex; flex-direction:column; align-items: flex-start; padding:1.5rem; }

/* Sections */
.section-header {
    width: 100%;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem;
}
.section-header h2 { font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 600; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 1.2rem 2rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.03); }
.data-table th { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table tbody tr { transition: all 0.3s ease; }
.data-table tbody tr:hover { background: var(--glass-hover); transform: scale(1.01) translateX(5px); }
.price-col { font-family: 'Outfit', sans-serif; font-weight: 600; color: var(--text-main); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 1.2rem; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.03); }
th { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; position: sticky; top: 0; background: rgba(15, 15, 20, 0.95); z-index: 5; backdrop-filter: blur(10px); }
tr:hover { background: var(--glass-hover); }

.table-responsive {
    max-height: 450px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}
.table-responsive::-webkit-scrollbar { width: 6px; height: 6px; }
.table-responsive::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 4px; }
.table-responsive::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.table-responsive::-webkit-scrollbar-thumb:hover { background: var(--accent-1); }

/* Supplier List Modal */
.supplier-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin:0; padding:0; width:100%; }
.supplier-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem; background: rgba(255,255,255,0.02);
    border-radius: 8px; border: 1px solid transparent;
}
.supplier-item:hover { border-color: var(--glass-border); background: rgba(255,255,255,0.04); }
.supplier-name { font-weight: 500; font-size: 0.9rem;}
.supplier-total { font-family: 'Outfit', sans-serif; font-weight: 600; color: var(--text-main); font-size: 0.9rem;}

/* Modal Rest */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.4s ease; z-index: 1000;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    width: 100%; max-width: 550px; padding: 2.5rem;
    transform: translateY(30px) scale(0.95); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(15, 15, 20, 0.85); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.5rem; }
.close-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s ease; }
.close-btn:hover { color: #fff; background: rgba(255,255,255,0.1); transform: rotate(90deg); }
.form-group { margin-bottom: 1.5rem; width:100%;}
label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
input, select {
    width: 100%; padding: 0.9rem 1.2rem; background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border); border-radius: 10px; color: var(--text-main);
    font-family: inherit; outline: none; transition: all 0.3s ease;
}
input:focus, select:focus { border-color: var(--accent-1); background: rgba(255,255,255,0.04); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); }
input[type="file"] { background: rgba(0,0,0,0.1); border: 1px dashed var(--accent-1); padding: 1rem; color: var(--text-main); cursor: pointer; }
input[type="file"]::file-selector-button { background: var(--accent-1); border: none; border-radius: 8px; padding: 0.5rem 1rem; color: #fff; margin-right: 1rem; cursor: pointer; font-weight: 500; }
select option { background-color: var(--bg-dark); color: var(--text-main); }
.login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark); display: flex; align-items: center; justify-content: center;
    z-index: 10000; opacity: 0; visibility: hidden; transition: opacity 0.4s ease;
}
.login-overlay.active { opacity: 1; visibility: visible; }
.login-box { width: 100%; max-width: 400px; padding: 3rem 2rem; display: flex; flex-direction: column; }
::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.5; cursor: pointer; }
::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 1rem; }
.header-title h1 { font-family: 'Outfit'; font-size: 2rem;}

@media (max-width: 900px) {
    .dashboard-container { flex-direction: column; padding-bottom: 80px; }
    .sidebar { position: fixed; bottom: 0; left: 0; width: 100%; height: 75px; flex-direction: row; padding: 0; z-index: 1000; }
    .logo, .user-profile { display: none; }
    nav ul { flex-direction: row; justify-content: space-around; align-items: center; width: 100%; }
    nav a { padding: 0.5rem; flex-direction: column; gap: 0.2rem; font-size: 0.7rem; border-radius: 8px; }
    .main-content { padding: 1.5rem; }
    .mixed-charts { grid-template-columns: 1fr !important; }
    .prog-cards { grid-template-columns: 1fr !important; }
}

/* ---- NOTIFICATION PANEL ---- */
#notification-panel {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: 380px;
    z-index: 1600;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}
#notification-panel.active {
    transform: translateX(0);
}
.notif-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: background 0.2s ease;
}
.notif-item:hover { background: rgba(255, 255, 255, 0.05); }
.notif-action-btn {
    margin-top: 0.6rem;
    padding: 0.3rem 0.8rem;
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.2s;
}
.notif-action-btn:hover { background: rgba(99, 102, 241, 0.3); }

@keyframes bell-ring {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    75% { transform: rotate(5deg); }
}
#bell-btn.has-alerts i { animation: bell-ring 1.5s ease-in-out; }
