/* SAP Style CSS - WorkTime Navigator */
/* Colori SAP: Blu scuro, grigio chiaro, bianco */

/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Header principale con menu orizzontale */
.sap-header {
    background: linear-gradient(135deg, #003366 0%, #1D4C7E 100%);
    color: white;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.sap-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 20px;
}

.sap-logo {
    font-size: 20px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.sap-logo:hover {
    color: #B0C4DE;
}

/* Menu orizzontale */
.sap-nav {
    display: flex;
    align-items: center;
    height: 100%;
}

.sap-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    height: 100%;
}

.sap-nav li {
    position: relative;
    height: 100%;
}

.sap-nav a {
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 100%;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.sap-nav a:hover {
    background-color: rgba(255,255,255,0.1);
    color: #B0C4DE;
}

.sap-nav a.active {
    background-color: #FF6B35;
    color: white;
}

/* Dropdown menu */
.sap-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.sap-nav li:hover .sap-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sap-dropdown a {
    color: #333;
    padding: 12px 20px;
    border-right: none;
    border-bottom: 1px solid #eee;
    height: auto;
}

.sap-dropdown a:hover {
    background-color: #f8f9fa;
    color: #003366;
}

.sap-dropdown a:last-child {
    border-bottom: none;
}

/* User info e logout */
.sap-user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sap-user-name {
    font-size: 14px;
    color: #B0C4DE;
}

.sap-logout-btn {
    background-color: #dc3545;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.sap-logout-btn:hover {
    background-color: #c82333;
}

/* Contenuto principale */
.sap-main-content {
    margin-top: 60px;
    padding: 0;
    min-height: calc(100vh - 60px);
    width: 100%;
}

.sap-container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Titoli e sezioni */
.sap-page-title {
    background: linear-gradient(135deg, #003366 0%, #1D4C7E 100%);
    color: white;
    padding: 20px;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.sap-content {
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.sap-section {
    margin-bottom: 30px;
}

.sap-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #003366;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #003366;
}

/* Form elements */
.sap-form-group {
    margin-bottom: 20px;
}

.sap-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.sap-form-group input,
.sap-form-group select,
.sap-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.sap-form-group input:focus,
.sap-form-group select:focus,
.sap-form-group textarea:focus {
    outline: none;
    border-color: #003366;
    box-shadow: 0 0 0 2px rgba(0,51,102,0.1);
}

/* Form multi-colonna per wide screen */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
}

.form-col-2 {
    flex: 0 0 calc(50% - 10px);
}

.form-col-3 {
    flex: 0 0 calc(33.333% - 14px);
}

.form-col-4 {
    flex: 0 0 calc(25% - 15px);
}

/* Bottoni */
.sap-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.sap-btn-primary {
    background-color: #003366;
    color: white;
}

.sap-btn-primary:hover {
    background-color: #1D4C7E;
}

.sap-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.sap-btn-secondary:hover {
    background-color: #5a6268;
}

.sap-btn-success {
    background-color: #28a745;
    color: white;
}

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

.sap-btn-danger {
    background-color: #dc3545;
    color: white;
}

.sap-btn-danger:hover {
    background-color: #c82333;
}

.sap-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.sap-btn-warning:hover {
    background-color: #e0a800;
}

/* Tabelle ottimizzate per wide screen */
.sap-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    font-size: 13px;
}

.sap-table th {
    background-color: #003366;
    color: white;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

.sap-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    vertical-align: middle;
}

.sap-table tr:hover {
    background-color: #f8f9fa;
}

.sap-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Tabella compatta per wide screen */
.sap-table-compact th {
    padding: 8px 6px;
    font-size: 11px;
}

.sap-table-compact td {
    padding: 8px 6px;
    font-size: 12px;
}

/* Tabella con scroll orizzontale per contenuti lunghi */
.sap-table-container {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
}

.sap-table-container .sap-table {
    margin-top: 0;
    min-width: 800px; /* Larghezza minima per evitare compressione eccessiva */
}

/* Cards */
.sap-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sap-card-header {
    font-size: 18px;
    font-weight: 600;
    color: #003366;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Grid system ottimizzato per wide screen */
.sap-row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
    gap: 0;
}

.sap-col {
    padding: 15px;
}

.sap-col-1 { flex: 0 0 8.333333%; }
.sap-col-2 { flex: 0 0 16.666667%; }
.sap-col-3 { flex: 0 0 25%; }
.sap-col-4 { flex: 0 0 33.333333%; }
.sap-col-5 { flex: 0 0 41.666667%; }
.sap-col-6 { flex: 0 0 50%; }
.sap-col-7 { flex: 0 0 58.333333%; }
.sap-col-8 { flex: 0 0 66.666667%; }
.sap-col-9 { flex: 0 0 75%; }
.sap-col-10 { flex: 0 0 83.333333%; }
.sap-col-11 { flex: 0 0 91.666667%; }
.sap-col-12 { flex: 0 0 100%; }

/* Layout wide screen specifici */
.sap-wide-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.sap-wide-main {
    grid-column: 2;
}

.sap-wide-sidebar {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

.sap-wide-content {
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
}

/* Alert messages */
.sap-alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.sap-alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.sap-alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.sap-alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.sap-alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Login page specific */
.sap-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #003366 0%, #1D4C7E 100%);
}

.sap-login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.sap-login-title {
    font-size: 28px;
    font-weight: 600;
    color: #003366;
    margin-bottom: 10px;
}

.sap-login-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

/* Responsive */
@media (max-width: 768px) {
    .sap-header-content {
        padding: 0 10px;
    }
    
    .sap-nav ul {
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #003366;
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .sap-nav li {
        height: auto;
    }
    
    .sap-nav a {
        height: auto;
        padding: 15px 20px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .sap-main-content {
        padding: 10px;
    }
    
    .sap-content {
        padding: 20px;
    }
    
    .sap-row {
        flex-direction: column;
    }
}

/* Utility classes */
.sap-text-center { text-align: center; }
.sap-text-right { text-align: right; }
.sap-text-left { text-align: left; }
.sap-mt-10 { margin-top: 10px; }
.sap-mt-20 { margin-top: 20px; }
.sap-mb-10 { margin-bottom: 10px; }
.sap-mb-20 { margin-bottom: 20px; }
.sap-p-10 { padding: 10px; }
.sap-p-20 { padding: 20px; }
.sap-hidden { display: none; }
.sap-visible { display: block; }

/* Iframe container */
.iframe-container {
    width: 100%;
    height: 600px;
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Full-screen iframe container */
.iframe-container-fullscreen {
    width: 100%;
    height: calc(100vh - 60px);
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.iframe-container-fullscreen iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Wide screen optimization - grandezza piena */
@media (min-width: 1200px) {
    .iframe-container {
        height: 700px;
    }
    
    .iframe-container-fullscreen {
        height: calc(100vh - 60px);
    }
}

@media (min-width: 1600px) {
    .iframe-container {
        height: 800px;
    }
    
    .iframe-container-fullscreen {
        height: calc(100vh - 60px);
    }
}

/* Allarga le colonne a pieno schermo mantenendo i menu */
.sap-container,
.sap-content,
.sap-main-content {
    max-width: none !important;
    width: 100% !important;
}

.sap-row {
    width: 100% !important;
    max-width: none !important;
}

.sap-col {
    max-width: none !important;
}

/* Assicura che le tabelle utilizzino tutta la larghezza disponibile */
.sap-table {
    width: 100% !important;
    max-width: none !important;
}

/* Forza larghezza completa per tutti gli elementi */
* {
    box-sizing: border-box;
}

.sap-container,
.sap-content,
.sap-main-content,
.sap-header,
.sap-header-content {
    max-width: none !important;
    width: 100% !important;
}

/* Forza larghezza completa anche per elementi interni */
iframe,
.sap-card,
.sap-table,
.sap-row,
.sap-col {
    max-width: none !important;
}

/* Assicura che le tabelle utilizzino tutta la larghezza */
table {
    width: 100% !important;
    max-width: none !important;
}

/* Rimuove eventuali limitazioni sui container */
.container,
.wrapper,
.content {
    max-width: none !important;
    width: 100% !important;
}

/* Home content specific */
.current-datetime {
    font-size: 16px;
    color: #003366;
    font-weight: 500;
}

/* App mobile specific styles */
.app-mobile-container {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.1) 0%, rgba(29, 76, 126, 0.1) 100%);
    min-height: calc(100vh - 60px);
}

.app-mobile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.app-mobile-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-mobile-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.app-mobile-card h3 {
    color: #003366;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
}

.app-mobile-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    background: linear-gradient(135deg, #003366 0%, #1D4C7E 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.app-mobile-btn:hover {
    background: linear-gradient(135deg, #1D4C7E 0%, #003366 100%);
    transform: translateY(-1px);
}

.app-mobile-btn.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.app-mobile-btn.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.app-mobile-btn.danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}