/* ============================================================
   home/static/home/css/home.css
   Nice S.p.A. brandbook styles — Home app templates
   ============================================================ */

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

:root {
    --nice-blue:    #004A93;
    --nice-blue-2:  #007FC8;
    --nice-blue-3:  #002E5A;
    --nice-light:   #E5EEF7;
    --nice-mid:     #CCE0F2;
    --nice-error:   #EF0000;
    --nice-success: #00D355;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

.hidden { display: none !important; }

/* ============================================================
   Global
   ============================================================ */

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
}

.card {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 74, 147, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* Progress bars */
.progress-bar-bg {
    background-color: var(--nice-light);
    overflow: hidden;
    border-radius: 9999px;
    height: 10px;
    width: 100%;
}
.progress-bar-bg.progress-bar-sm { height: 8px; }

.progress-bar-fill    { background-color: var(--nice-blue-2); height: 100%; border-radius: 9999px; }
.progress-bar-channel { background-color: var(--nice-success); height: 100%; border-radius: 9999px; }
.progress-bar-bu      { background-color: var(--nice-blue);    height: 100%; border-radius: 9999px; }
.progress-bar-customer { background-color: var(--nice-error);  height: 100%; border-radius: 9999px; }
.progress-bar-product  { background-color: #f97316;            height: 100%; border-radius: 9999px; }

/* Tabs */
.tab-active {
    border-bottom: 2px solid var(--nice-blue);
    color: var(--nice-blue);
    font-weight: 600;
}
.tab-inactive { color: var(--gray-500); }

/* ============================================================
   Site Header  (base_header.html)
   ============================================================ */

.impersonate-banner {
    background-color: var(--nice-error);
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.impersonate-stop-btn {
    background-color: #fff;
    color: var(--nice-error);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.15s ease;
}
.impersonate-stop-btn:hover { background-color: #fee2e2; }

.site-header {
    background-color: #fff;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 74, 147, 0.08);
    position: sticky;
    top: 0;
    z-index: 40;
}

.site-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header-brand { display: flex; align-items: center; gap: 1rem; }
.site-header-logo  { height: 1.5rem; width: auto; }

.site-header-greeting {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-800);
}

.site-header-nav { display: flex; align-items: center; }

.site-header-nav-link {
    display: flex;
    align-items: center;
    color: var(--gray-600);
    text-decoration: none;
    margin-right: 1rem;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}
.site-header-nav-link:hover { color: var(--nice-blue); }
.site-header-nav-link i { font-size: 1.25rem; margin-right: 0.25rem; }
.site-header-nav-link .link-label { display: none; }
@media (min-width: 640px) { .site-header-nav-link .link-label { display: inline; } }

.site-header-actions { display: flex; align-items: center; color: var(--gray-500); }

.install-btn {
    display: flex;
    align-items: center;
    color: var(--gray-500);
    background: none;
    border: none;
    cursor: pointer;
    margin-right: 1rem;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}
.install-btn:hover { color: var(--nice-blue); }
.install-btn i { font-size: 1.25rem; margin-right: 0.25rem; }
.install-btn .link-label { display: none; }
@media (min-width: 640px) { .install-btn .link-label { display: inline; } }

.logout-link {
    display: flex;
    align-items: center;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.15s ease;
}
.logout-link:hover { color: var(--nice-error); }
.logout-link i { font-size: 1.25rem; margin-right: 0.25rem; }
.logout-link .link-label { display: none; }
@media (min-width: 640px) { .logout-link .link-label { display: inline; } }

/* ============================================================
   Footer Nav  (base_footer_nav.html)
   ============================================================ */

.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-top: 1px solid var(--gray-200);
    padding: 0.5rem 0;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.footer-nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    max-width: 32rem;
    margin: 0 auto;
    width: 100%;
}

.footer-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.15s ease;
}
.footer-nav-item:hover  { color: var(--nice-blue); }
.footer-nav-item.active { color: var(--nice-blue-2); }
.footer-nav-item i    { font-size: 1.25rem; }
.footer-nav-item span { font-size: 0.75rem; margin-top: 0.25rem; }

.other-menu-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.footer-menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-600);
    transition: color 0.15s ease;
    padding: 0;
}
.footer-menu-btn:hover  { color: var(--nice-blue); }
.footer-menu-btn.active { color: var(--nice-blue-2); }
.footer-menu-btn:focus  { outline: none; }
.footer-menu-btn i    { font-size: 1.25rem; }
.footer-menu-btn span { font-size: 0.75rem; margin-top: 0.25rem; }

.footer-nav-submenu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 9999;
    margin-bottom: 8px;
}
.footer-nav-submenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-nav-submenu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.15s ease;
}
.footer-nav-submenu a:hover { background-color: var(--nice-light); }
.footer-nav-submenu a i { width: 24px; margin-right: 12px; color: var(--gray-500); }
.footer-nav-submenu a.active-submenu-item   { color: var(--nice-blue); }
.footer-nav-submenu a.active-submenu-item i { color: var(--nice-blue); }

.submenu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99;
    display: none;
}
.submenu-overlay.active { display: block; }

/* ============================================================
   Homepage  (homepage.html + partials)
   ============================================================ */

.homepage-page { padding-bottom: 5rem; }

.homepage-main {
    padding: 1rem;
    max-width: 1280px;
    margin: 0 auto;
}

.hp-sales-section { margin-bottom: 1.5rem; }

.hp-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.hp-tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.hp-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

/* Card variants */
.hp-card {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 74, 147, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

.hp-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

.hp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.hp-card-link { font-size: 0.75rem; color: var(--nice-blue-2); text-decoration: none; }
.hp-card-link:hover { text-decoration: underline; }

/* Monthly progress */
.hp-progress-section { margin-top: 1rem; }

.hp-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.hp-progress-pct {
    text-align: right;
    color: var(--nice-blue-2);
    font-weight: 600;
    font-size: 1.125rem;
    margin-top: 0.25rem;
}

/* List items */
.hp-list { display: flex; flex-direction: column; gap: 0.5rem; }

.hp-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.hp-item-label     { color: var(--gray-600); }
.hp-item-label-sub { font-size: 0.75rem; }
.hp-value-channel  { font-weight: 500; color: var(--nice-blue); }
.hp-value-bu       { font-weight: 500; color: var(--nice-blue); }
.hp-value-customer { font-weight: 500; color: var(--nice-error); }
.hp-value-product  { font-weight: 500; color: #f97316; }

/* Annual view */
.hp-annual-card {
    background-color: var(--nice-light);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.hp-annual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.hp-annual-title { font-size: 0.95rem; font-weight: 600; color: var(--nice-blue-3); }

.hp-annual-badge {
    font-size: 0.75rem;
    background-color: var(--nice-mid);
    color: var(--nice-blue-3);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.hp-annual-months { display: flex; flex-direction: column; gap: 1rem; }

.hp-annual-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.hp-annual-month { font-size: 0.875rem; font-weight: 500; color: var(--gray-700); }
.hp-annual-value { font-size: 0.875rem; font-weight: 500; color: var(--nice-blue-2); }

/* Export button */
.hp-export-card {
    background-color: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    margin-top: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 74, 147, 0.07);
    display: flex;
    justify-content: center;
}

.hp-export-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--nice-success);
    color: #fff;
    font-weight: 500;
    border-radius: 0.5rem;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
}
.hp-export-btn:hover { background-color: #00b847; }
.hp-export-btn i { margin-right: 0.5rem; }

/* ============================================================
   Impersonate List  (impersonate_list.html)
   ============================================================ */

.impersonate-page { background-color: var(--gray-100); }

.impersonate-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.impersonate-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.impersonate-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.impersonate-back-btn {
    background-color: var(--gray-200);
    color: var(--gray-800);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: filter 0.15s ease;
}
.impersonate-back-btn:hover { filter: brightness(0.93); }

.impersonate-list-card {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 74, 147, 0.08);
    border-radius: 0.375rem;
    border: 1px solid var(--gray-200);
    padding: 1.5rem;
}

.impersonate-search-row { margin-bottom: 1rem; }

.impersonate-search {
    width: 100%;
    max-width: 50%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.impersonate-search:focus {
    border-color: var(--nice-blue-2);
    box-shadow: 0 0 0 2px rgba(0, 127, 200, 0.25);
}

.impersonate-table-wrapper { overflow-x: auto; }

.impersonate-table {
    width: 100%;
    background-color: #fff;
    border-collapse: collapse;
}

.impersonate-table thead {
    background-color: var(--nice-light);
    border-bottom: 1px solid var(--gray-200);
}

.impersonate-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nice-blue-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.impersonate-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background-color 0.1s ease;
}
.impersonate-table tbody tr:hover { background-color: var(--nice-light); }

.impersonate-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.impersonate-action-btn {
    display: inline-flex;
    align-items: center;
    background-color: var(--nice-blue);
    color: #fff;
    font-weight: 500;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.impersonate-action-btn:hover { background-color: var(--nice-blue-3); }
.impersonate-action-btn i { margin-right: 0.25rem; }

/* ============================================================
   Login  (login.html)
   ============================================================ */

.login-page { background-color: #f0f2f5; }

.login-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-logo { margin-bottom: 2rem; }
.login-logo img { height: 3rem; width: auto; display: block; margin: 0 auto; }

.login-card {
    width: 100%;
    max-width: 28rem;
    background-color: #fff;
    padding: 2rem 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 74, 147, 0.12);
}

.login-title {
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nice-blue-3);
}

.login-sso-btn {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-800);
    background-color: #fff;
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.login-sso-btn:hover { background-color: var(--nice-light); }

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.login-lang-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: 28rem;
    margin-bottom: 1rem;
}

.login-lang-select {
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

.login-lang-submit {
    background-color: var(--nice-blue);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
}
.login-lang-submit:hover { background-color: var(--nice-blue-3); }

.login-version {
    position: fixed;
    bottom: 0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}
