/* Layout base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #f5f7fa;
}

/* Top bar */
.topbar {
    height: 52px;
    background-color: #2c3e50;
    color: #ecf0f1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    z-index: 10;
    position: relative;
}

.topbar-logo img {
    height: 32px; /* regola questa altezza per adattarla al tuo header */
    display: block;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user {
    font-weight: 600; /* grassetto */
    font-size: 14px; /* leggermente più grande */
}

.btn-full {
    width: 100%;
    margin-top: 6px;
}

.btn-top {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    text-decoration: none; /* niente sottolineatura */
}

/* Logout blu pieno */
.btn-logout {
    background-color: #007bff;
    border: 1px solid #007bff;
    color: #ffffff;
}

    .btn-logout:hover {
        background-color: #0069d9;
        border-color: #0062cc;
        text-decoration: none; /* niente sottolineatura anche in hover */
    }

.btn-green {
    background-color: #27ae60;
    color: #fff;
}

.btn-outline {
    background-color: transparent;
    color: #fff;
    border: 1px solid #7f8c8d;
}

.topbar-search {
    background-color: #fff;
    border-radius: 3px;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    margin-left: 20px;
}

    .topbar-search input {
        border: none;
        outline: none;
        font-size: 13px;
    }

/* Layout wrapper */
.layout {
    display: flex;
    height: calc(100vh - 52px);
}

/* Sidebar */
.sidebar {
    width: 200px;
    background-color: #222f3e;
    color: #ecf0f1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
    .sidebar a i {
        width: 18px;
        text-align: center;
        font-size: 16px;
    }

    .sidebar a:hover {
        background-color: #f5f5f5;
    }


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

    .sidebar-menu li a {
        display: block;
        padding: 8px 16px;
        color: #ecf0f1;
        text-decoration: none;
        font-size: 14px;
    }

        .sidebar-menu li a:hover {
            background-color: #34495e;
        }

.sidebar-logo-bottom {
    padding: 12px 12px 16px 12px;
    text-align: left;
}

    .sidebar-logo-bottom img {
        max-width: 70%;
        height: auto;
        display: block;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

.sidebar-section-title {
    font-size: 11px;
    text-transform: uppercase;
    padding: 10px 15px 4px 15px;
    color: #7f8c8d;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    color: #bdc3c7;
    font-size: 13px;
}

    .sidebar li a:hover,
    .sidebar li a.active {
        background-color: #1e90ff;
        color: #fff;
    }

/* Main area */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px 20px;
    overflow-y: auto;
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

    .page-header h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 500;
        color: #34495e;
    }

    .page-header .page-actions {
        margin-left: 20px;
    }

        .page-header .page-actions .btn {
            margin-right: 8px;
        }

/* Buttons */
.btn {
    border: none;
    border-radius: 3px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #ffffff;
}

.btn-primary {
    background-color: #28a745;
}

    .btn-primary:hover {
        background-color: #218838;
    }

.btn-secondary {
    background-color: #f39c12;
}

    .btn-secondary:hover {
        background-color: #d98a0f;
    }
/* versione piccola per i bottoni nella griglia */
.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
}

/* Filters row */
.filters-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

    .filters-row select,
    .filters-row input {
        padding: 4px 6px;
        font-size: 13px;
    }

/* Grid */
.grid {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    font-size: 13px;
}

    .grid th,
    .grid td {
        padding: 6px 8px;
        border-bottom: 1px solid #ecf0f1;
        text-align: left;
    }

    .grid thead {
        background-color: #f0f2f5;
    }

    .grid tr:hover {
        background-color: #f9fbff;
    }

/* Badges (non ancora usati, ma pronti) */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    color: #fff;
}

.badge-stato-aperto {
    background-color: #3498db;
}

.badge-stato-lavorazione {
    background-color: #f1c40f;
    color: #273238;
}

.badge-stato-attesa {
    background-color: #e67e22;
}

.badge-stato-risolto {
    background-color: #2ecc71;
}

.badge-stato-chiuso {
    background-color: #7f8c8d;
}

.badge-urg-bassa {
    background-color: #7f8c8d;
}

.badge-urg-media {
    background-color: #3498db;
}

.badge-urg-alta {
    background-color: #e67e22;
}

.badge-urg-critica {
    background-color: #e74c3c;
}

/* Form */
.form-field-label {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: #34495e;
}

input[type=text], input[type=password], textarea, select {
    padding: 5px 8px;
    border-radius: 3px;
    border: 1px solid #ccd1d9;
    font-size: 13px;
    width: 100%;
    max-width: 600px;
}

/* Login */


.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #2b3038;
}

.login-body {
    background-size: cover;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', sans-serif;
}

.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #ffffff;
    width: 400px;
    padding: 35px 40px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0px 0px 18px rgba(0, 0, 0, 0.25);
}

    .login-box h2 {
        margin-top: 0;
        margin-bottom: 15px;
        font-size: 20px;
        color: #34495e;
    }

    .login-box .btn-primary {
        width: 100%;
        margin-top: 10px;
    }

    .login-box img {
        max-width: 100%;
        height: auto;
    }

.login-title {
    font-size: 18px;
    color: #000;
    font-weight: 600;
    margin-bottom: 25px;
}

.login-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

    .login-input:focus {
        outline: none;
        border-color: #28a745;
    }

.login-logo {
    width: 160px;
    margin-bottom: 12px;
    display: inline-block;
}

.logo-top {
    max-width: 40px; /* regola qui la dimensione del marchio */
    height: auto;
    display: inline-block;
    margin-bottom: 6px;
}

.logo-bottom {
    max-width: 60px; /* regola qui finché ti soddisfa */
    height: auto;
    display: inline-block;
    margin-top: 16px;
}

.login-logo-bottom {
    margin-top: 18px;
}

/* Icona circolare per apertura ticket */
.icon-button {
    background: none;
    border: none;
    padding: 2px 4px;
    cursor: pointer;
}

    .icon-button span.icon-edit {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: linear-gradient(135deg, #0f7ecb, #1ba4b8);
        color: #ffffff;
        font-size: 13px;
    }

.grid td:first-child {
    text-align: center;
    vertical-align: middle;
    width: 45px;
}

.btn-open-ticket {
    width: 28px;
    height: 28px;
    border: none;
    cursor: pointer;
    padding: 2px;
}

    .btn-open-ticket:hover {
        opacity: 0.8;
    }

a.btn {
    text-decoration: none !important;
}

.grid th.text-center,
.grid td.text-center {
    text-align: center !important;
}
