/* Ruolo: stile base layout admin (header, sidebar, main) */

/* Reset minimale */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f6f8;
    color: #222;
}

/* HEADER */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 16px;
    background-color: #1f2933;
    color: #fff;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

/* STATUS */
.status-pill {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    background-color: #4b5563;
}

.status-ok {
    background-color: #16a34a;
}

.status-danger {
    background-color: #dc2626;
}

.status-off {
    background-color: #6b7280;
}

/* USER */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
}

/* LAYOUT WRAPPER */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
}

/* SIDEBAR */
.app-sidebar {
    width: 220px;
    flex: 0 0 220px;
    background-color: #111827;
    color: #e5e7eb;
    padding: 16px 0;
    overflow: hidden;
    transition: width 0.2s ease, padding 0.2s ease;
}

.app-sidebar.collapsed {
    width: 0;
    flex-basis: 0;
    padding: 0;
}

/* Evita scroll orizzontale quando la sidebar è chiusa */
.app-wrapper {
    display: flex;
    min-height: calc(100vh - 56px);
    overflow-x: hidden;
}


.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-section {
    list-style: none;
    padding: 0 16px;
}

.sidebar-section-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #9ca3af;
    margin-bottom: 8px;
}

.sidebar-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: block;
    padding: 6px 8px;
    color: #e5e7eb;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.sidebar-link:hover {
    background-color: #1f2937;
}

.sidebar-link.is-active {
    background-color: #1f2937;
    font-weight: 600;
}

.sidebar-item.disabled .sidebar-link {
    opacity: 0.4;
    cursor: not-allowed;
}

/* MAIN */
.app-main {
    flex: 1;
    min-width: 0;
    padding: 24px;
}

.app-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.app-content {
    background-color: #fff;
    padding: 24px;
    border-radius: 6px;
    min-height: 200px;
    min-width: 0;
    overflow-x: auto;
}

/* FOOTER */
.app-footer {
    height: 32px;
    padding: 0 16px;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #374151;
}

