/* css/style.css - Versione rinnovata con palette calda ed elegante */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #faf3ed;
    /* caldo e avvolgente */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: #3a2c1f;
    /* testo principale caldo */
}

#app-container {
    width: 100%;
    max-width: 1400px;
    background: #ffffff;
    border-radius: 36px;
    /* più morbido */
    box-shadow: 0 20px 40px -12px rgba(157, 126, 106, 0.25);
    /* ombra calda */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 80vh;
}

/* Login */
#login-page {
    padding: 48px 24px;
    max-width: 480px;
    margin: 0 auto;
}

#login-page h1 {
    text-align: center;
    color: #3a2c1f;
    margin-bottom: 8px;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#login-page .subtitle {
    text-align: center;
    color: #7d6b5a;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.auth-card {
    background: #ffffff;
    border-radius: 28px;
    /* più morbido */
    padding: 32px;
    box-shadow: 0 8px 24px -8px rgba(157, 126, 106, 0.2);
    border: 1px solid #f0eae3;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0eae3;
    padding-bottom: 8px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #7d6b5a;
    cursor: pointer;
    border-radius: 12px 12px 0 0;
    transition: all 0.2s;
}

.auth-tab.active {
    color: #d97742;
    /* accento caldo */
    border-bottom: 3px solid #d97742;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #5f4e3e;
    font-size: 0.9rem;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5ddd5;
    border-radius: 16px;
    /* più morbido */
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fefaf5;
}

.auth-form input:focus {
    outline: none;
    border-color: #d97742;
    box-shadow: 0 0 0 3px rgba(217, 119, 66, 0.15);
}

.auth-form .btn {
    width: 100%;
    padding: 14px;
    background: #d97742;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.auth-form .btn:hover {
    background: #bf6a39;
}

.auth-form .forgot-password {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #d97742;
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-error {
    background: #fae1e1;
    color: #b55656;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #ffffff;
    border-bottom: 1px solid #f0eae3;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3a2c1f;
    letter-spacing: -0.02em;
}

.logo i {
    color: #d97742;
    margin-right: 8px;
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #5f4e3e;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.help-btn {
    background: #f0eae3;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f4e3e;
    cursor: pointer;
    transition: background 0.2s;
}

.help-btn:hover {
    background: #e5ddd5;
}

.user-menu {
    position: relative;
}

.user-icon {
    width: 44px;
    height: 44px;
    background: #f0eae3;
    color: #3a2c1f;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.user-icon:hover {
    background: #e5ddd5;
}

.dropdown {
    position: absolute;
    right: 0;
    top: 52px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px -8px rgba(90, 70, 55, 0.2);
    width: 220px;
    display: none;
    z-index: 1000;
    border: 1px solid #f0eae3;
}

.dropdown.active {
    display: block;
}

.dropdown a,
.dropdown button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    width: 100%;
    text-align: left;
    border: none;
    background: none;
    font-size: 0.95rem;
    color: #3a2c1f;
    cursor: pointer;
    transition: background 0.2s;
}

.dropdown a:hover,
.dropdown button:hover {
    background: #faf3ed;
}

.dropdown i {
    width: 20px;
    color: #d97742;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    padding: 16px 32px 0;
    background: #ffffff;
    border-bottom: 1px solid #f0eae3;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #7d6b5a;
    cursor: pointer;
    border-radius: 24px;
    transition: all 0.2s;
}

.tab-btn i {
    margin-right: 8px;
}

.tab-btn:hover {
    background: #faf3ed;
    color: #5f4e3e;
}

.tab-btn.active {
    background: #faede4;
    color: #bf6a39;
    font-weight: 600;
}

/* Page container */
.page {
    padding: 32px;
    flex: 1;
    display: none;
}

.page.active {
    display: block;
}

/* Filtri e card */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: #ffffff;
    padding: 24px;
    border-radius: 28px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    border: 1px solid #f0eae3;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #5f4e3e;
    font-size: 0.9rem;
}

/* Uniformità per tutti i select */
select,
.filter-group select,
.creator-item select,
.modal select {
    padding: 8px 12px;
    border: 1px solid #e5ddd5;
    border-radius: 16px;
    background: #fefaf5;
    font-size: 0.95rem;
    color: #3a2c1f;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cpath%20fill%3D%22%235f4e3e%22%20d%3D%22M4%206l4%204%204-4z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}

select:focus,
.filter-group select:focus,
.creator-item select:focus,
.modal select:focus {
    outline: none;
    border-color: #d97742;
    box-shadow: 0 0 0 3px rgba(217, 119, 66, 0.15);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background: #d97742;
    color: white;
}

.btn-primary:hover {
    background: #bf6a39;
}

.btn-danger {
    background: #c45d5d;
    color: white;
}

.btn-danger:hover {
    background: #aa4f4f;
}

.btn-warning {
    background: #e6a57e;
    color: white;
}

.btn-warning:hover {
    background: #d48f6a;
}

.btn-success {
    background: #5f8b7a;
    color: white;
}

.btn-success:hover {
    background: #4e7566;
}

.btn-secondary {
    background: #f0eae3;
    color: #3a2c1f;
}

.btn-secondary:hover {
    background: #e5ddd5;
}

.add-btn {
    margin-bottom: 20px;
}

/* Griglie e card */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.item-card {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f0eae3;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(157, 126, 106, 0.2);
}

.item-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #f0eae3;
}

.item-info {
    padding: 20px;
}

.item-type {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3a2c1f;
    margin-bottom: 8px;
}

.item-attr {
    color: #5f4e3e;
    font-size: 0.9rem;
    margin: 4px 0;
}

.item-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Outfit card */
.outfit-card {
    background: #ffffff;
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    border: 1px solid #f0eae3;
    position: relative;
}

.outfit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.outfit-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #3a2c1f;
}

.outfit-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin: 20px 0;
}

.outfit-item-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 20px;
    border: 2px solid #f0eae3;
}

.outfit-details {
    background: #faf3ed;
    padding: 20px;
    border-radius: 20px;
    margin: 16px 0;
}

.outfit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin-top: 12px;
}

.outfit-table th {
    background: #faede4;
    color: #3a2c1f;
    font-weight: 600;
    padding: 8px;
    text-align: left;
}

.outfit-table td {
    padding: 8px;
    border-bottom: 1px solid #f0eae3;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(90, 70, 55, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(6px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 36px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 50px -20px rgba(90, 70, 55, 0.4);
}

.modal-content h2 {
    margin-bottom: 24px;
    color: #3a2c1f;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #5f4e3e;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5ddd5;
    border-radius: 16px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fefaf5;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d97742;
    box-shadow: 0 0 0 3px rgba(217, 119, 66, 0.15);
}

.required::after {
    content: " *";
    color: #c45d5d;
}

.preview-img {
    max-width: 100%;
    max-height: 200px;
    margin-top: 12px;
    border-radius: 16px;
    border: 1px solid #f0eae3;
    padding: 4px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Paginazione */
.pagination {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    align-items: center;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Calendario */
.calendar-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 8px;
    min-width: 560px;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: #5f4e3e;
    padding: 8px;
    font-size: 0.9rem;
}

.calendar-day {
    background: #ffffff;
    border-radius: 20px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(157, 126, 106, 0.05);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #f0eae3;
}

.calendar-day.empty {
    background: transparent;
    box-shadow: none;
    cursor: default;
    border: none;
}

.calendar-day.selected {
    background: #faede4;
    border-color: #d97742;
}

.calendar-day.has-outfit {
    border: 2px solid #5f8b7a;
}

.calendar-day.today {
    border: 3px solid #d97742;
}

.calendar-day img {
    width: 35px;
    height: 35px;
    object-fit: cover;
    border-radius: 50%;
    margin: 2px;
}

/* Dashboard */
.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    border: 1px solid #f0eae3;
    text-align: center;
}

.metric-card h4 {
    color: #5f4e3e;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
}

.metric-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3a2c1f;
    line-height: 1.2;
}

.chart-container {
    background: #ffffff;
    border-radius: 24px;
    padding: 20px;
    margin: 0 auto 20px auto;
    border: 1px solid #f0eae3;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    max-width: 600px;
}

.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.chart-col {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
}

canvas {
    max-width: 100%;
    height: auto !important;
}

/* Pagina Crea Outfit */
.creator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.creator-item {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(157, 126, 106, 0.05);
    border: 1px solid #f0eae3;
}

.creator-item label {
    font-weight: 600;
    display: block;
    margin-bottom: 12px;
    color: #5f4e3e;
}

.creator-preview-thumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    min-height: 70px;
}

.creator-preview-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 16px;
    border: 2px solid #f0eae3;
}

.preview-outfit {
    background: #ffffff;
    border-radius: 28px;
    padding: 24px;
    margin-top: 24px;
    border: 1px solid #f0eae3;
}

/* Tutorial dinamico */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(90, 70, 55, 0.5);
    z-index: 3000;
    display: none;
    pointer-events: none;
}

.tutorial-overlay.active {
    display: block;
}

.tutorial-highlight {
    position: absolute;
    border: 4px solid #d97742;
    border-radius: 20px;
    box-shadow: 0 0 0 9999px rgba(90, 70, 55, 0.5);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 3001;
}

.tutorial-card {
    position: absolute;
    background: white;
    border-radius: 28px;
    padding: 24px;
    max-width: 300px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(90, 70, 55, 0.3);
    z-index: 3002;
    pointer-events: auto;
}

.tutorial-card h3 {
    margin-bottom: 12px;
    color: #3a2c1f;
}

.tutorial-card p {
    margin-bottom: 20px;
    color: #5f4e3e;
}

.tutorial-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tutorial-actions button {
    flex: 1 1 auto;
    min-width: 80px;
}

/* Footer */
.footer {
    padding: 24px 32px;
    text-align: center;
    color: #7d6b5a;
    border-top: 1px solid #f0eae3;
    background: #ffffff;
    margin-top: auto;
}

.footer a {
    color: #d97742;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
}

.footer .version {
    font-size: 0.8rem;
    color: #b3a397;
    margin-top: 8px;
}

/* Loading e warning */
.loading,
.empty-state,
.warning {
    text-align: center;
    padding: 40px;
    color: #5f4e3e;
    background: #faf3ed;
    border-radius: 28px;
}

.warning {
    background: #fef0e5;
    color: #aa5e3a;
}

.success {
    background: #e7f3ef;
    color: #2f5e4c;
    padding: 12px;
    border-radius: 16px;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #3a2c1f;
    color: #fefaf5;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 -2px 10px rgba(90, 70, 55, 0.2);
}

.cookie-banner p {
    margin: 0;
    font-size: 0.95rem;
}

.cookie-banner a {
    color: #e6a57e;
    text-decoration: underline;
    margin-left: 5px;
}

.cookie-banner button {
    margin-left: 20px;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 16px;
    }

    .cookie-banner button {
        margin-left: 0;
    }
}

/* Stili specifici per armocromia (già presenti, ora adattati) */
.chromy-container {
    max-width: 900px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #e5ddd5;
    border-radius: 28px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #faf3ed;
    margin-bottom: 24px;
}

.upload-area:hover {
    border-color: #d97742;
    background: #faede4;
}

.upload-area i {
    font-size: 48px;
    color: #7d6b5a;
    margin-bottom: 12px;
}

.upload-area p {
    color: #5f4e3e;
    font-size: 1rem;
}

.result-card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.05);
    border: 1px solid #f0eae3;
    margin: 24px 0;
}

.result-season {
    font-size: 1.5rem;
    font-weight: 700;
    color: #3a2c1f;
    margin: 8px 0;
}

.history-list {
    margin-top: 20px;
}

.history-item {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #f0eae3;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(157, 126, 106, 0.1);
}

.history-item img {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    object-fit: cover;
    border: 2px solid #f0eae3;
}

.history-info {
    flex: 1;
}

.history-season {
    font-weight: 600;
    color: #d97742;
    font-size: 1.1rem;
}

.history-date {
    color: #7d6b5a;
    font-size: 0.9rem;
    margin: 4px 0;
}

.delete-analysis {
    align-self: center;
}

.btn-save {
    background: #5f8b7a;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #4e7566;
}

.btn-save:disabled {
    background: #e5ddd5;
    cursor: not-allowed;
}

/* Badge limiti */
.limit-badge {
    background: #f0eae3;
    border-radius: 30px;
    padding: 8px 16px;
    display: inline-block;
    margin: 15px 0;
    font-weight: 500;
    color: #3a2c1f;
}

.limit-badge.warning {
    background: #fae1e1;
    color: #b55656;
}

.limit-badge.success {
    background: #e7f3ef;
    color: #2f5e4c;
}

/* Materiali dinamici */
.material-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: center;
}

.material-row input[type="text"] {
    flex: 2;
    padding: 8px;
    border: 1px solid #e5ddd5;
    border-radius: 12px;
    background: #fefaf5;
}

.material-row input[type="number"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #e5ddd5;
    border-radius: 12px;
    background: #fefaf5;
}

.material-row button {
    padding: 8px 12px;
}

/* Categorie */
.category-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    background: white;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid #f0eae3;
}

.category-badge {
    background: #faf3ed;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #f0eae3;
}

.category-badge.full {
    background: #fae1e1;
    color: #b55656;
    border-color: #f5c2c2;
}

.category-badge .count {
    font-weight: 700;
    color: #3a2c1f;
}

.category-badge .limit {
    color: #7d6b5a;
}

/* Rating */
.rating-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.rating-perfetto {
    background: #5f8b7a;
    color: white;
}

.rating-ottimo {
    background: #d97742;
    color: white;
}

.rating-quasi {
    background: #e6a57e;
    color: white;
}

.feedback-text {
    background: #faede4;
    padding: 12px;
    border-radius: 16px;
    margin: 10px 0;
    font-style: italic;
    color: #aa5e3a;
}

/* Selettore tipi (come badge) */
.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0;
    justify-content: center;
    background: white;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid #f0eae3;
}

.type-checkbox {
    display: none;
}

.type-label {
    background: #faf3ed;
    border: 1px solid #f0eae3;
    border-radius: 30px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.type-checkbox:checked+.type-label {
    background: #d97742;
    color: white;
    border-color: #d97742;
}

.type-label:hover {
    background: #e5ddd5;
}

.type-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0eae3;
}

.type-label .count {
    font-weight: 700;
    color: #3a2c1f;
}

.type-checkbox:checked+.type-label .count {
    color: white;
}

/* Outfit card con rating in alto */
.outfit-card {
    position: relative;
    padding-top: 40px;
}

.rating-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
}

.outfit-selector {
    position: absolute;
    top: 12px;
    left: 12px;
}

/* Profilo - piano e limiti */
.plan-badge {
    display: inline-block;
    background: #f0eae3;
    border-radius: 30px;
    padding: 8px 20px;
    margin: 20px 0;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5ddd5;
}

.plan-badge:hover {
    background: #e5ddd5;
    transform: scale(1.02);
}

.limits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 20px 0;
}

.limit-item {
    background: #faf3ed;
    border-radius: 20px;
    padding: 16px;
    border: 1px solid #f0eae3;
}

.limit-item h4 {
    margin: 0 0 10px 0;
    color: #3a2c1f;
}

.limit-progress {
    height: 8px;
    background: #e5ddd5;
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.limit-progress-bar {
    height: 100%;
    background: #d97742;
    border-radius: 4px;
}

.limit-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #5f4e3e;
}

/* Loader */
#app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fefaf5;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loader-spinner {
    border: 4px solid #f0eae3;
    border-top: 4px solid #d97742;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    background: #fae1e1;
    color: #b55656;
    padding: 16px;
    border-radius: 16px;
    text-align: center;
    margin: 20px;
}

/* Media query responsive */
@media (max-width: 360px) {
    .navbar {
        padding: 12px 16px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-actions {
        gap: 8px;
    }

    .user-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .help-btn {
        width: 36px;
        height: 36px;
    }

    .tabs {
        padding: 12px 16px 0;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .page {
        padding: 16px;
    }

    .filters {
        padding: 16px;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .creator-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .chart-container {
        padding: 12px;
    }

    .modal-content {
        padding: 20px;
    }

#confirm-modal {
    z-index: 10000;
}

    .tutorial-card {
        max-width: 90%;
        left: 5% !important;
        transform: none !important;
    }

    .footer {
        padding: 16px;
        font-size: 0.8rem;
    }

    .type-selector {
        gap: 8px;
        padding: 12px;
    }

    .type-label {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (min-width: 361px) and (max-width: 576px) {
    .navbar {
        padding: 12px 20px;
    }

    .tabs {
        padding: 12px 20px 0;
    }

    .page {
        padding: 20px;
    }

    .filter-group {
        width: 100%;
    }

    .items-grid {
        grid-template-columns: 1fr;
    }

    .creator-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .filter-group {
        width: auto;
    }

    .creator-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .creator-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
