@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@300;400;700&display=swap');

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Roboto Condensed', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
    color: #212529;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 90%;
    max-width: 1920px;
    margin: 40px auto;
    background: white;
    padding: 40px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    box-sizing: border-box;
}

/* Main menu styles */
.main-menu {
    background-color: #343a40;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.menu-container {
    width: 100%;
    padding: 0 40px;
    box-sizing: border-box;
}

.main-menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.main-menu li {
    margin-right: 5px;
    margin-top: 5px;
    margin-bottom: 5px;
}

.main-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8f9fa;
    padding: 10px 18px;
    text-decoration: none;
    background-color: #495057;
    border-radius: 10px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.main-menu a i {
    font-size: 22px;
    line-height: 1;
}

.main-menu a:hover {
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.35);
}

.main-menu .logout {
    margin-left: auto;
}

.main-menu .logout a {
    background-color: #dc3545;
}

.main-menu .logout a:hover {
    background-color: #c82333;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.4);
}

/* Section header — sotto il menu principale */
.section-header {
    background-color: #f8f9fa;
    padding: 8px 40px;
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    letter-spacing: 0.5px;
}

h2 {
    text-align: center;
    color: #343a40;
    margin-bottom: 30px;
    font-weight: 300;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.full-width {
    grid-column: span 2;
}

label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
input[type="password"],
textarea,
select {
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 7px;
    font-size: 15px;
    background-color: #f5f6f7;
    color: #495057;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

textarea {
    resize: vertical;
    height: 120px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #adb5bd;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

.checkbox-group input[type="checkbox"]:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 13px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkbox-group label {
    cursor: pointer;
    font-size: 15px;
    user-select: none;
}

.btn-icon {
    padding: 0 12px;
    height: 38px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    background-color: #5a6268;
}

.btn-icon.btn-upload {
    background-color: #28a745;
    font-size: 17px;
    padding: 0 14px;
}

.btn-icon.btn-upload:hover {
    background-color: #218838;
}

.btn-icon.btn-danger {
    background-color: #dc3545;
}

.btn-icon.btn-danger:hover {
    background-color: #c82333;
}

.btn-icon.btn-cancel {
    background-color: #6c757d;
    font-size: 18px;
    padding: 0 18px;
    height: 42px;
}

.btn-icon.btn-cancel:hover {
    background-color: #5a6268;
}

.btn-icon.btn-save {
    background-color: #007bff;
    font-size: 18px;
    padding: 0 18px;
    height: 42px;
}

.btn-icon.btn-save:hover {
    background-color: #0069d9;
}

.button-group {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
}

button {
    padding: 12px 25px;
    font-size: 16px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Roboto Condensed', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

button[type="submit"] {
    background-color: #007bff;
    color: white;
}

button[type="submit"]:hover {
    background-color: #0056b3;
    box-shadow: 0 4px 10px rgba(0, 86, 179, 0.3);
}

button[type="reset"] {
    background-color: #6c757d;
    color: white;
}

button[type="reset"]:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 10px rgba(90, 98, 104, 0.3);
}

/* Messaging */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid transparent;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Dashboard styles */
.dashboard-menu {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.dashboard-card {
    display: block;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
    width: 250px;
    text-decoration: none;
    color: #343a40;
    text-align: center;
}

.dashboard-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #007bff;
    color: #007bff;
}

.dashboard-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.dashboard-card p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-15 {
    margin-top: 15px;
}

.mb-20 {
    margin-bottom: 20px;
}

.w-100 {
    width: 100%;
    box-sizing: border-box;
}

.w-40px {
    width: 40px;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 35px;
}

.separator {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 20px 0;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    color: #495057;
}

.password-toggle:focus {
    outline: none;
    color: #007bff;
}

.cancel-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
}

.cancel-link:hover {
    color: #495057;
    text-decoration: underline;
}

/* Row click-selection */
.cb-col { display: none; }

tbody tr { cursor: pointer; user-select: none; }
tbody tr.row-selected { background-color: #cfe2ff !important; }
tbody tr.row-selected:hover { background-color: #b6d4fe !important; }

.employee-card { cursor: pointer; user-select: none; }
.employee-card.row-selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}
.employee-card.row-selected .card-header {
    background-color: #cfe2ff;
}

/* Table Styles (Restored from list_employees.php) */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 14px;
}

th,
td {
    padding: 3px 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    color: #495057;
    font-size: 13px;
    font-weight: 600;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Pagination Styles (Restored from list_employees.php) */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a {
    padding: 8px 16px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #007bff;
    border-radius: 7px;
    transition: background-color 0.15s ease;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a.disabled {
    color: #ccc;
    pointer-events: none;
}

/* Search Section Styles */
.search-section {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.search-form {
    flex: 1;
    min-width: 250px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 80px 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 7px;
    font-size: 15px;
    background-color: #f5f6f7;
    color: #495057;
}

.search-input:focus {
    border-color: #007bff;
    outline: 0;
}

.search-button {
    position: absolute;
    right: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.search-button:hover {
    background-color: #0056b3;
}

.clear-search {
    position: absolute;
    right: 55px;
    background-color: #6c757d;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.clear-search:hover {
    background-color: #5a6268;
    color: white;
}

.total-count {
    font-size: 16px;
    color: #495057;
    white-space: nowrap;
}

.search-info {
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
    margin-left: 5px;
}

/* Action Buttons Styles (Toolbar sottomenu — stile coerente al menu principale) */
.actions-bar {
    display: flex;
    gap: 5px;
    margin: 0;
    background-color: #343a40;
    padding: 5px 40px;
    border-radius: 0;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.actions-bar .btn-modern {
    flex: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 22px;
    justify-content: center;
    background-color: #495057;
    box-shadow: none;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.actions-bar .btn-modern:hover {
    background-color: #007bff;
    filter: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.35);
    color: white;
    text-decoration: none;
}

.actions-bar .btn-delete:hover {
    background-color: #007bff;
    filter: none;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.35);
}

.actions-bar .btn-modern:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
    background-color: #006d75;
    color: white;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

/* Specific overrides to ensure links behave like buttons */
a.btn-modern {
    color: white;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-modern:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    background-color: #00565e;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-modern:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
}

.btn-delete {
    background-color: #dc3545;
}

.btn-delete:hover {
    background-color: #c82333;
    box-shadow: 0 4px 10px rgba(200, 35, 51, 0.35);
}

/* View Employee Page Styles */
.view-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.view-item {
    padding: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.view-label {
    display: block;
    font-size: 13px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.view-value {
    display: block;
    font-size: 16px;
    color: #212529;
    font-weight: 400;
}

/* Print Styles & Logo */
.page-header {
    background-color: #fff;
    padding: 20px 40px;
    border-bottom: 1px solid #dee2e6;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.logo-img {
    height: 30px;
    width: auto;
    display: block;
    max-width: 100%;
}

.only-print {
    display: none;
}

@media print {
    body {
        font-size: 12pt;
        background: white;
    }

    .no-print,
    .main-menu,
    .actions-bar,
    .button-group {
        display: none !important;
    }

    .container {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        border: none;
    }

    .view-grid {
        display: block;
    }

    .view-item {
        border-bottom: 1px solid #ccc;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }

    h2 {
        text-align: left;
        margin-bottom: 20px;
        color: black;
    }

    .only-print {
        display: block !important;
    }
}

/* Employee Card Layout (Mobile) */
.mobile-cards {
    display: none;
}

.employee-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #dee2e6;
}

.card-header input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.employee-name {
    font-size: 18px;
    font-weight: 600;
    color: #343a40;
    margin: 0;
    cursor: pointer;
}

.card-body {
    padding: 15px;
}

.card-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

.card-row:last-child {
    border-bottom: none;
}

.card-label {
    font-weight: 600;
    color: #6c757d;
    font-size: 14px;
}

.card-value {
    color: #212529;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

/* ========================================
   RESPONSIVE MOBILE STYLES (VERTICAL/PORTRAIT)
   ======================================== */

/* Tablets and smaller (portrait) */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .container {
        margin: 15px;
        padding: 15px;
        border-radius: 0;
        width: calc(100% - 30px);
        max-width: 100%;
    }

    .page-header {
        padding: 15px;
    }

    .menu-container {
        padding: 0 10px;
    }

    .main-menu ul {
        flex-direction: column;
        align-items: stretch;
    }

    .main-menu li {
        margin: 0;
        margin-bottom: 5px;
        width: 100%;
    }

    .main-menu a {
        width: 100%;
        padding: 14px 15px;
        font-size: 16px;
        text-align: left;
    }

    .main-menu .logout {
        margin-left: 0;
    }

    /* Switch to card view on mobile */
    .desktop-table {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    /* Search section adjustments */
    .search-section {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .search-form {
        width: 100%;
    }

    .total-count {
        width: 100%;
        text-align: center;
        white-space: normal;
    }

    .search-info {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }

    /* Form adjustments */
    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .full-width {
        grid-column: span 1;
    }

    .button-group {
        grid-column: span 1;
        flex-direction: column;
        gap: 10px;
    }

    .button-group button {
        width: 100%;
    }

    /* Dashboard adjustments */
    .dashboard-menu {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .dashboard-card {
        width: 100%;
        max-width: 350px;
    }

    /* Table adjustments */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 13px;
    }

    th, td {
        padding: 8px 4px;
        font-size: 12px;
    }

    /* View grid adjustments */
    .view-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Action buttons adjustments */
    .actions-bar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        padding: 5px 10px;
    }

    .actions-bar .btn-modern {
        flex: none;
        padding: 10px 14px;
        font-size: 18px;
        width: auto;
    }

    .btn-modern,
    a.btn-modern {
        width: 100%;
        text-align: center;
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Pagination adjustments */
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }

    .pagination a {
        padding: 6px 12px;
        font-size: 14px;
    }

    h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
}

/* Mobile phones (portrait) */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        margin: 10px;
        padding: 12px;
        width: calc(100% - 20px);
        max-width: 100%;
    }

    .page-header {
        padding: 10px;
    }

    .menu-container {
        padding: 0 8px;
    }

    .main-menu a {
        padding: 12px 10px;
        font-size: 15px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }

    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="password"],
    textarea,
    select {
        padding: 10px;
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }

    button {
        padding: 12px 20px;
        font-size: 16px;
    }

    .dashboard-card {
        padding: 20px;
    }

    .dashboard-card h3 {
        font-size: 18px;
    }

    table {
        font-size: 11px;
    }

    th, td {
        padding: 6px 3px;
        font-size: 11px;
    }

    .view-label {
        font-size: 11px;
    }

    .view-value {
        font-size: 14px;
    }

    .btn-modern,
    a.btn-modern {
        padding: 10px 15px;
        font-size: 15px;
    }

    .pagination a {
        padding: 5px 10px;
        font-size: 13px;
    }

    /* Improve touch targets */
    .password-toggle {
        right: 5px;
        padding: 8px;
    }
}

/* ==========================================
   LANDING PAGES (dashboard.php / index.php)
   ========================================== */

body.page-landing {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    padding: 40px 20px;
}

.page-landing .header {
    text-align: center;
    margin-bottom: 50px;
}

.page-landing .header .logo-img {
    width: 300px;
    height: auto;
}

.title {
    margin-top: 20px;
    font-size: 28px;
    font-weight: 200;
    color: #27518b;
    letter-spacing: -1px;
}

.user-info {
    margin-top: 12px;
    font-size: 14px;
    color: #718096;
    font-weight: 300;
}

.cards-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 40px 30px;
    width: 300px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: #ffffff;
}

.card-icon.blue   { background: #3182ce; }
.card-icon.green  { background: #38a169; }
.card-icon.orange { background: #dd6b20; }
.card-icon.purple { background: #6b46c1; }
.card-icon.yellow { background: #ffc400; }

.card-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
}

.card-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.6;
    font-weight: 400;
}

.client-ip {
    text-align: center;
    color: #a0aec0;
    font-size: 11px;
    margin-top: 30px;
    margin-bottom: 4px;
}

.landing-footer {
    margin-top: 10px;
    text-align: center;
    color: #727d8a;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logout-link {
    color: #a0aec0;
    text-decoration: none;
    font-size: 12px;
}

.logout-link:hover {
    color: #718096;
    text-decoration: underline;
}

/* ==========================================
   LOGIN PAGE (index.php)
   ========================================== */

.login-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.separator-text {
    color: #718096;
    margin: 0 10px;
    font-size: 13px;
}

/* ==========================================
   FORM CONTAINER (change_password, set_password)
   ========================================== */

.form-container {
    max-width: 500px;
    margin: 50px auto;
}

/* ==========================================
   EDIT USER FORM (edit_user.php)
   ========================================== */

.edit-form {
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #003366;
    border-bottom: 2px solid #003366;
    padding-bottom: 4px;
    margin: 24px 0 16px;
}

.meta-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ==========================================
   USERS MANAGEMENT TABLE (users.php)
   ========================================== */

.users-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    background: #003366;
    color: white;
}

.users-table tr:hover { background: #f5f5f5; }

.users-table select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 7px;
}

.btn-reset {
    display: inline-block;
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-reset:hover { background: #c82333; }

.btn-enable {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.btn-enable:hover { background: #218838; }

.no-users {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.badge-admin           { background: #dc3545; color: white; }
.badge-amministrazione { background: #fd7e14; color: white; }
.badge-tutor           { background: #007bff; color: white; }
.badge-utente          { background: #28a745; color: white; }
.badge-attesa          { background: #ffc107; color: #000;   }

.total-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #006d75;
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
}

.user-cards { display: none; }

.user-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
}

.user-card-header {
    background-color: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.user-card-body { padding: 15px; }

.user-card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f1f1;
}

.user-card-row:last-child { border-bottom: none; }

.user-card-label { font-weight: 600; color: #6c757d; font-size: 14px; }

.user-card-value {
    color: #212529;
    font-size: 14px;
    text-align: right;
    word-break: break-word;
}

.user-card-actions {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.user-card-actions .btn-reset { width: 100%; }

@media screen and (max-width: 768px) {
    .desktop-table { display: none; }
    .user-cards    { display: block; }
}

/* ==========================================
   LIST EMPLOYEES PAGE
   ========================================== */

.btn-filter-active {
    background: #dc3545 !important;
    color: white !important;
}

.btn-filter-active:hover {
    background: #c82333 !important;
}

/* ==========================================
   ADD ITEM PAGE
   ========================================== */

.hidden-date-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

/* ==========================================
   CHECKLIST PAGE
   ========================================== */

.checklist-table td { padding: 15px; vertical-align: middle; }
.checklist-table td:last-child { text-align: right; }

/* ==========================================
   EMPLOYEE DETAIL PAGE (view_employee.php)
   ========================================== */

.scheda-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #999;
    border-radius: 8px;
}

.foto-container {
    flex-shrink: 0;
    width: 250px;
    height: 305px;
    border: 1px solid #666;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.foto-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-placeholder {
    color: #999;
    text-align: center;
    font-size: 0.9em;
}

.dati-principali {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dati-principali .dato-item { margin-bottom: 12px; }

.dati-principali .dato-label {
    font-weight: bold;
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dati-principali .dato-value {
    font-size: 1.3em;
    font-weight: 600;
    color: #222;
    margin-top: 2px;
}

.scheda-body {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.scheda-body h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #999;
    color: #333;
}

@page { size: A4 portrait; margin: 10mm; }

@media print {
    body.scheda-dipendente { width: 210mm; background: white; color: black; font-size: 9pt; line-height: 1.2; margin: 0; padding: 0; }
    body.scheda-dipendente * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    body.scheda-dipendente h2 { text-align: center; margin-bottom: 8px; font-size: 13pt; }
    body.scheda-dipendente .scheda-header { border: 1px solid #000; border-radius: 0; padding: 8px; margin-bottom: 8px; gap: 12px; background: #f5f5f5 !important; }
    body.scheda-dipendente .foto-container { width: 26mm; height: 34mm; border: 1px solid #000; }
    body.scheda-dipendente .dati-principali .dato-item { margin-bottom: 4px; }
    body.scheda-dipendente .dati-principali .dato-label { font-size: 7pt; }
    body.scheda-dipendente .dati-principali .dato-value { font-size: 9pt; }
    body.scheda-dipendente .scheda-body { padding: 8px; border: 1px solid #000; border-radius: 0; }
    body.scheda-dipendente .scheda-body h3 { font-size: 10pt; margin-bottom: 5px; padding-bottom: 3px; border-bottom: 1px solid #000; margin-top: 8px; }
    body.scheda-dipendente .scheda-body h3:first-child { margin-top: 0; }
    body.scheda-dipendente .view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
    body.scheda-dipendente .view-item { margin-bottom: 2px; page-break-inside: avoid; }
    body.scheda-dipendente .view-item.full-width { grid-column: 1 / -1; }
    body.scheda-dipendente .view-label { font-weight: bold; font-size: 7.5pt; }
    body.scheda-dipendente .view-value { font-size: 8.5pt; }
    body.scheda-dipendente .only-print { display: block !important; }
}

/* Extra small devices */
@media screen and (max-width: 360px) {
    .container {
        margin: 5px;
        padding: 8px;
        width: calc(100% - 10px);
        max-width: 100%;
    }

    .page-header {
        padding: 8px;
    }

    h2 {
        font-size: 18px;
    }

    .main-menu a {
        font-size: 14px;
        padding: 10px 8px;
    }

    .menu-container {
        padding: 0 5px;
    }

    .dashboard-card {
        padding: 15px;
    }

    table {
        font-size: 10px;
    }

    th, td {
        padding: 5px 2px;
        font-size: 10px;
    }
}

/* ── Quattropercento Module ─────────────────────────────────────────────────── */

/* Remove browser spinners from number inputs for a clean, text-like appearance */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.text-right { text-align: right; }

.badge.pos { background-color: #d4edda; color: #155724; }
.badge.neg { background-color: #f8d7da; color: #721c24; }
.badge.neu { background-color: #e9ecef; color: #4D5257; }

/* Metric summary cards */
.qp-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.qp-metric {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px 18px;
}

.qp-metric-label {
    font-size: 11px;
    color: #343a40;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
    font-weight: 600;
}

.qp-metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
}

.qp-metric-value.pos { color: #1D9E75; }
.qp-metric-value.neg { color: #D85A30; }

/* Content cards */
.qp-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.qp-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #343a40;
    margin: 0 0 15px 0;
    text-align: left;
}

.qp-card.danger { border-color: #D85A30; }
.qp-card.danger h3 { color: #A32D2D; }

/* Sub-navigation */
.qp-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.qp-nav a {
    padding: 8px 0;
    width: 130px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qp-nav a:hover { background: #fbbf24; color: #1a1a1a; border-color: #f59e0b; }
.qp-nav a.active { background: #1e40af; color: #fff; border-color: #1e40af; }

.qp-nav button {
    padding: 8px 0;
    width: 150px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    color: #1e40af;
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.qp-nav button:hover:not(:disabled) { background: #fbbf24; color: #1a1a1a; border-color: #f59e0b; }
.qp-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
.qp-nav button.btn-delete { color: #991b1b; background: #fee2e2; border-color: #fecaca; }
.qp-nav button.btn-delete:hover:not(:disabled) { background: #dc3545; color: #fff; border-color: #dc3545; }

/* Researcher card elements */
.qp-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    margin: 12px 0 6px 0;
}

.qp-rc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.qp-rc-name { font-weight: 700; font-size: 14px; color: #343a40; }
.qp-rc-subtext { font-size: 12px; color: #6c757d; margin-bottom: 10px; }

/* Top bar with title + info */
.qp-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.qp-top-bar h3 { margin-bottom: 0 !important; }

/* Utility */
.qp-hint   { font-size: 12px; color: #6c757d; margin-bottom: 12px; }
.qp-empty  { font-size: 13px; color: #6c757d; padding: 8px 0; font-style: italic; }
.qp-divider { border: none; border-top: 1px solid #dee2e6; margin: 12px 0; }

.qp-date-wrap { position: relative; display: flex; align-items: center; }
.qp-date-wrap input { padding-right: 32px; width: 100%; }
.qp-date-wrap .qp-date-ico { position: absolute; right: 10px; color: #6c757d; font-size: 13px; cursor: pointer; }

/* Form rows */
.qp-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.qp-form-row.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Small delete button (inline in tables) */
.qp-btn-delete {
    padding: 5px 10px;
    font-size: 13px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.qp-btn-delete:hover  { opacity: 0.82; }
.qp-btn-delete:active { transform: scale(0.95); }

/* Small icon action buttons for table rows */
.qp-btn-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 15px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
    color: #fff;
}
.qp-btn-sm:hover  { opacity: 0.82; color: #fff; text-decoration: none; }
.qp-btn-sm:active { transform: scale(0.95); }
.qp-btn-sm.default   { background: #0d6efd; }
.qp-btn-sm.warning   { background: #f97316; }
.qp-btn-sm.success   { background: #198754; }
.qp-btn-sm.secondary { background: #6366f1; }
.qp-btn-sm.danger    { background: #dc3545; }

/* Primary submit button */
.qp-submit {
    background-color: #343a40;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    width: fit-content;
}

.qp-submit:hover { background-color: #007bff; }

/* Compact layout modifier (used in researchers.php) */
.qp-compact .qp-card        { padding: 10px 14px; margin-bottom: 8px; }
.qp-compact .qp-rc-subtext  { margin-bottom: 6px; }
.qp-compact .qp-section-label { margin: 8px 0 4px 0; }
.qp-compact .qp-divider     { margin: 8px 0; }
.qp-compact table           { font-size: 12px; }
.qp-compact th, .qp-compact td { padding: 4px 8px; }

/* Responsive */
@media (max-width: 768px) {
    .qp-metrics { grid-template-columns: repeat(2, 1fr); }
    .qp-form-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .qp-metrics { grid-template-columns: 1fr; }
    .qp-form-row,
    .qp-form-row.two { grid-template-columns: 1fr; }
}

/* ============================================================
   OBG — Peoples module
   ============================================================ */

/* Dashboard card grid */
.ob-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Clickable card link wrapper */
.ob-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ob-card-link:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.ob-card-link h3 {
    text-align: center;
    font-size: 17px;
}

.ob-card-link p {
    text-align: center;
}

/* Coloured icon circle inside dashboard cards */
.ob-card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 12px auto;
    color: #fff;
}

.ob-card-icon.blue  { background-color: #1e40af; }
.ob-card-icon.green { background-color: #1D9E75; }

/* Inline form helper (replaces style="display:inline") */
.ob-inline-form {
    display: inline;
}