/* style.css */

/* ===== Layout base ===== */

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f5f7;
    color: #222;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0b3b6f;
    color: #fff;
    padding: 10px 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text-block {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.logo-badge {
    margin-top: 2px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #16a085;
    color: #fff;
    display: inline-block;
}

.user-area span {
    margin-right: 10px;
    font-size: 13px;
}

.btn-logout {
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
}

/* nav principale */

.main-nav {
    background: #0b3b6f;
    padding: 4px 15px 8px 15px;
}

.main-nav .nav-link {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    margin-right: 10px;
}

.main-nav .nav-link:hover {
    text-decoration: underline;
}

.main-content {
    padding: 15px;
}

h1, h2 {
    margin-top: 0;
}

/* ===== Hero dashboard ===== */

.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.hero-left {
    flex: 2 1 260px;
}

.hero-right {
    flex: 1 1 220px;
}

.hero-card {
    background: linear-gradient(135deg, #0b3b6f, #1f6ab5);
    color: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.hero-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.hero-subtitle {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
    margin-bottom: 10px;
}

.hero-tag {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
}

.hero-kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
}

.hero-kpi-item {
    flex: 1 1 80px;
}

.hero-kpi-label {
    opacity: 0.8;
    margin-bottom: 2px;
}

.hero-kpi-value {
    font-size: 18px;
    font-weight: 700;
}

/* ===== Cards & grid ===== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.card-subtitle {
    font-size: 11px;
    color: #777;
    margin-bottom: 6px;
}

.card-value {
    font-size: 22px;
    font-weight: 700;
}

/* ===== Nav tiles ===== */

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.nav-tile {
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
    color: #222;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-left: 4px solid #0b3b6f;
}

.nav-tile:nth-child(2) {
    border-left-color: #16a085;
}
.nav-tile:nth-child(3) {
    border-left-color: #e67e22;
}
.nav-tile:nth-child(4) {
    border-left-color: #8e44ad;
}
.nav-tile:nth-child(5) {
    border-left-color: #2c3e50;
}

.nav-tile-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.nav-tile-desc {
    font-size: 12px;
    color: #555;
}

/* ===== Buttons, table, form ===== */

.btn {
    display: inline-block;
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: #0b3b6f;
    color: #fff;
}

.btn-secondary {
    background: #7f8c8d;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid #0b3b6f;
    color: #0b3b6f;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th, .table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f0f2f5;
    text-align: left;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.form-group {
    flex: 1 1 150px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    margin-bottom: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 6px;
    font-size: 13px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.footer {
    text-align: center;
    padding: 10px;
    font-size: 11px;
    color: #777;
}

/* ===== Print layout scheda lavoro ===== */

.print-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
    background: #fff;
    color: #000;
    font-size: 13px;
}

.print-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.print-logo-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.print-logo-title {
    font-size: 16px;
    font-weight: 700;
}

.print-logo-subtitle {
    font-size: 11px;
}

.print-title-block {
    text-align: right;
}

.print-title {
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
}

.print-meta {
    font-size: 11px;
}

.print-section-title {
    font-weight: 600;
    border-bottom: 1px solid #000;
    margin-top: 12px;
    margin-bottom: 4px;
    padding-bottom: 2px;
}

.print-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.print-label {
    font-weight: 600;
    font-size: 12px;
}

.print-value {
    font-size: 12px;
}

.print-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    font-size: 12px;
}

.print-sign-box {
    width: 45%;
}

/* elementi solo a video */
.no-print {
}

/* ===== Responsive ===== */

@media (max-width: 600px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .hero {
        flex-direction: column;
    }

    .hero-right {
        order: -1;
    }
}

/* ===== Modalità stampa ===== */

@media print {
    body {
        background: #fff;
    }

    .topbar,
    .footer,
    .main-nav,
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .no-print {
        display: none !important;
    }

    .print-wrapper {
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
}
