/* =============================================================================
   GLOBAL SETTINGS
============================================================================= */

* {
    box-sizing: border-box;
}

input {
    width: 100%;
    height: 40px;
    padding: 8px 10px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* =============================================================================
   LOGIN PAGE
============================================================================= */

.login-body {
    background: #f5f6f7;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: "Segoe UI", sans-serif;
}

.login-container {
    background: white;
    padding: 40px;
    width: 350px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.login-body .login-logo img {
    width: 60px;
    display: block;
    margin: 0 auto 20px auto;
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 22px;
    font-weight: 600;
}

label {
    font-size: 14px;
    margin-top: 10px;
    display: block;
}

.btn-primary {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #2c7be5;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1a5fc4;
}

.error-box {
    margin-top: 20px;
    padding: 10px;
    background: #ffdddd;
    color: #a10000;
    border: 1px solid #ffb3b3;
    border-radius: 4px;
}

/* Password field */
.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-eye {
    width: 20px;
    height: 20px;
    fill: #666;
}

.toggle-password:hover .icon-eye {
    fill: #000;
}

/* =============================================================================
   DASHBOARD LAYOUT
============================================================================= */

.dashboard-body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    background: #f5f6f7;
}

/* HEADER */
.dashboard-header {
    height: 60px;
    background: #2c7be5;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
}

.dashboard-header .header-logo {
    width: 22px;
    height: auto;
    object-fit: contain;
    margin-right: 16px;
    flex-shrink: 0;
}

.header-title {
    font-size: 20px;
    font-weight: 600;
}

.logout-btn {
    background: #ffffff33;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.logout-btn:hover {
    background: #ffffff55;
}

/* MAIN LAYOUT */
.dashboard-layout {
    display: flex;
    height: calc(100vh - 60px);
}

/* SIDEBAR */
.dashboard-sidebar {
    width: 220px;
    background: white;
    border-right: 1px solid #ddd;
    padding-top: 20px;
}

.dashboard-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 15px;
}

.menu-item:hover {
    background: #eef3ff;
}

.menu-item.active {
    background: #dce6ff;
    font-weight: 600;
}

.menu-separator {
    height: 1px;
    margin: 8px 0;
    background: #ddd;
    list-style: none;
}



/* CONTENT AREA */
.dashboard-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.section {
    display: none;
}

.section.visible {
    display: block;
}

/* Bottoni piccoli */
.btn-small {
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #2c7be5;
    color: white;
    margin-right: 6px;
}

.btn-small:hover {
    background: #1a5fc4;
}

.btn-danger {
    background: #d9534f;
}

.btn-danger:hover {
    background: #c9302c;
}

/* =============================================================================
   SECTION HEADER (bottone Nuovo a destra)
============================================================================= */

.section-header {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

/* =============================================================================
   TABLES
============================================================================= */

.registry-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border: 1px solid #ddd;
    color: #000;
}

.registry-table th {
    background: #cccccc;
    padding: 10px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.registry-table td {
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.registry-table tr:nth-child(odd) {
    background: #ffffff;
}

.registry-table tr:nth-child(even) {
    background: #e8e8e8;
}

.registry-table tr:hover {
    background: #dddddd;
}

.registry-table td.enabled-cell {
    text-align: center;
}

/* =============================================================================
   POPUP MODAL
============================================================================= */

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.popup-box {
    background: white;
    padding: 25px;
    width: 350px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.25);
}

#popup-registry .popup-box {
    width: 600px !important;
}

.popup-box h3 {
    margin-top: 0;
    margin-bottom: 20px;
}

.popup-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.popup-btn {
    width: 48%;
    padding: 12px;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-btn-primary {
    background: #2c7be5;
    color: white;
}

.popup-btn-primary:hover {
    background: #1a5fc4;
}

.popup-btn-secondary {
    background: #ccc;
    color: #000;
}

.popup-btn-secondary:hover {
    background: #b3b3b3;
}

/* =============================================================================
   CHECKBOX + FLAG TABLE
============================================================================= */

.popup-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    padding: 0;
    vertical-align: middle;
}

.registry-flag-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.registry-flag-table td {
    padding: 6px 4px;
    vertical-align: middle;
    font-size: 14px;
}

.registry-flag-table td:first-child {
    width: 85%;
}
