* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #eef1f5;
    color: #1f2937;
}

/* LOGIN */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 460px;
    background: #f3f4f6;
    border-radius: 18px;
    padding: 34px 34px 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.login-logo {
    display: block;
    max-width: 250px;
    width: 100%;
    height: auto;
    margin: 0 auto 22px;
}

.login-box form {
    width: 100%;
}

.login-box input {
    display: block;
    width: 100%;
    height: 52px;
    margin: 0 0 14px 0;
    padding: 0 16px;
    border: 1px solid #8d99a8;
    border-radius: 0;
    background: #dbe3ef;
    font-size: 18px;
    color: #111827;
    outline: none;
}

.login-box input:focus {
    border-color: #ff3152;
    background: #ffffff;
}

.login-box button {
    display: block;
    width: 100%;
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 0;
    background: #ff3152;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.login-box button:hover {
    background: #e72b49;
}

.error {
    margin: 14px 0 0;
    color: #c62828;
    font-size: 14px;
}

/* LAYOUT */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
    width: 250px;
    background: #1f2937;
    color: #cbd5e1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar .logo {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar .logo img {
    max-width: 160px;
    width: 100%;
    height: auto;
}

.sidebar .menu {
    list-style: none;
    padding: 14px 10px;
    margin: 0;
}

.sidebar .menu li {
    margin-bottom: 2px;
}

.sidebar .menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    border-radius: 999px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.2s ease;
}

.sidebar .menu li a i {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    color: inherit;
    flex-shrink: 0;
}

.sidebar .menu li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #38bdf8;
}

.sidebar .menu li.active a {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-weight: 600;
}

.sidebar .menu li.active a i {
    background: #ff3152;
    color: #ffffff;
}

/* MAIN */
.main {
    flex: 1;
    min-width: 0;
}

/* TOPBAR */
.topbar {
    height: 90px;
    background: #ffffff;
    border-bottom: 1px solid #e8edf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    gap: 20px;
}

.topbar-search-wrap {
    flex: 1;
    display: flex;
    justify-content: left;
}

.topbar-search {
    position: relative;
    width: 100%;
    max-width: 460px;
}

.topbar-search input {
    width: 100%;
    height: 52px;
    padding: 0 62px 0 22px;
    border-radius: 999px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    box-shadow: none;
    transition: all 0.2s ease;
}

.topbar-search input:focus {
    background: #ffffff;
    border-color: #ff3152;
    box-shadow: 0 0 0 4px rgba(255, 49, 82, 0.08);
}

.topbar-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #eef2f7;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-search button:hover {
    background: #ff3152;
    color: #ffffff;
}

.topbar-search button i {
    font-size: 14px;
}

.topbar-actions {
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.topbar-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topbar-icon:hover {
    background: #ff3152;
    color: #ffffff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px; /* spazio tra Sito e Admin */
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px; /* spazio tra testo e icona */
}

/* CONTENT */
.content {
    padding: 30px;
}

.content h1 {
    margin: 0 0 26px;
    font-size: 56px;
    line-height: 1.1;
    font-weight: 800;
    color: #1e293b;
}

.tag-manager-inline {
    min-width: 0;
}

.tag-manager-inline label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #12233d;
    font-size: 15px;
}

.tag-inline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag-selector {
    min-width: 280px;
    max-width: 360px;
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    padding: 13px 42px 13px 14px;
    font-size: 15px;
    background-color: #fff;
    color: #12233d;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%2312233d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px 14px;
    box-sizing: border-box;
}

.tag-add-btn {
    white-space: nowrap;
    height: 48px;
}

.tag-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    flex: 1;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff1f4;
    color: #c2185b;
    border: 1px solid #ffd1dc;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.tag-chip-remove {
    border: none;
    background: transparent;
    color: #c2185b;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.tag-chip-remove:hover {
    background: rgba(194, 24, 91, 0.08);
}

.scheda-tag-inline {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    background: #fff1f4;
    color: #c2185b;
    border: 1px solid #ffd1dc;
}

.tag-picker-box {
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
}

.tag-picker-top {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

.tag-picker-top select {
    flex: 1;
}

.selected-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 20px;
}

.selected-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #eef2f7;
    border: 1px solid #d8e1ec;
    color: #12233d;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
}

.selected-tag-text {
    line-height: 1;
}

.selected-tag-remove {
    width: 24px;
    height: 24px;
    border: none;
    background: #ff3152;
    color: #fff;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.selected-tag-remove:hover {
    background: #e62c49;
}

.tags-box-disabled {
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    background: #f8fafc;
    color: #64748b;
    padding: 14px;
    font-size: 14px;
}

/* DASHBOARD CARDS */
.cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.card {
    background: #ffffff;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    min-width: 150px;
}

/* PAGE HEAD */
.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-subtitle {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 15px;
}

/* BUTTON */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #ff3152;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #e72b49;
}

/* PANEL */
.panel {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* EMPTY */
.empty-state {
    padding: 30px 10px;
    text-align: center;
    color: #6b7280;
    font-size: 15px;
}

/* CATEGORIES LIST */
.cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-row {
    width: 100%;
}

.cat-main {
    min-height: 58px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cat-name-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.cat-tree-icon {
    color: #94a3b8;
    font-size: 14px;
    flex-shrink: 0;
}

.cat-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
}

.cat-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.cat-id {
    font-size: 13px;
    color: #64748b;
    background: #eef2f7;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}


.btn-edit {
    background: rgba(56, 189, 248, 0.12);
    color: #0369a1;
}

.btn-edit:hover {
    background: rgba(56, 189, 248, 0.2);
}

.btn-delete {
    background: rgba(255, 49, 82, 0.12);
    color: #c81e3a;
}

.btn-delete:hover {
    background: rgba(255, 49, 82, 0.2);
}

.drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    cursor: grab;
    color: #1f2a44;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.drag-handle:hover {
    color: #ff3152;
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.cat-section-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #1f2a44;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* USER AREA */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
}

/* FORM */
.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-panel {
    padding: 24px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #dbe3ec;
    border-radius: 14px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.form-group textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: #ffffff;
    border-color: #ff3152;
    box-shadow: 0 0 0 4px rgba(255, 49, 82, 0.08);
}

.form-group-checkbox {
    justify-content: flex-end;
}

.checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.language-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.language-title h2 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
}

.language-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 49, 82, 0.12);
    color: #ff3152;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.language-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.language-flag {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff1f4;
    border: 1px solid #ffd3dc;
    flex-shrink: 0;
}

.language-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.required {
    color: #ff3152;
}

.alert {
    border-radius: 16px;
    padding: 16px 18px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 4px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: #eed400;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

@media (max-width: 1100px) {
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}
/* ACTION ICONS */
.cat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BUTTON ICON */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

/* EDIT */
.btn-edit {
    background: rgba(56, 189, 248, 0.12);
    color: #0369a1;
}

.btn-edit:hover {
    background: #38bdf8;
    color: #fff;
}

/* DELETE */
.btn-delete {
    background: rgba(255, 49, 82, 0.12);
    color: #c81e3a;
}

.btn-delete:hover {
    background: #ff3152;
    color: #fff;
}

/* STATUS DOT */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.on {
    background: #22c55e;
}

.status-dot.off {
    background: #ef4444;
}

.status-toggle {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.status-toggle .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
}

.status-toggle.is-on {
    background: rgba(34, 197, 94, 0.10);
}

.status-toggle.is-on .status-dot {
    background: #22c55e;
}

.status-toggle.is-off {
    background: rgba(239, 68, 68, 0.10);
}

.status-toggle.is-off .status-dot {
    background: #ef4444;
}

.status-toggle:hover {
    transform: scale(1.08);
}

.cat-actions-order {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-order {
    background: rgba(148, 163, 184, 0.12);
    color: #475569;
}

.btn-order:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-head-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-filter-inline {
    margin: 0;
}

.section-filter-inline select {
    height: 42px;
    min-width: 160px;
    padding: 0 42px 0 14px;
    border: 1px solid #ffd3dc;
    border-radius: 999px;
    background: #fff;
    color: #1f2a44;
    font-size: 14px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: 0 4px 14px rgba(20, 31, 56, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%23ff3152' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    transition: all 0.2s ease;
}

.section-filter-inline select:hover {
    border-color: #ff3152;
    box-shadow: 0 6px 16px rgba(255, 49, 82, 0.10);
}

.section-filter-inline select:focus {
    border-color: #ff3152;
    box-shadow: 0 0 0 4px rgba(255, 49, 82, 0.10);
}

.btn-primary {
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .page-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .section-filter-inline {
        flex: 1;
    }

    .section-filter-inline select {
        width: 100%;
        min-width: 0;
    }
}/* VIMAFUN Studio additions are in studio.css */
