/* General styles 2 */
body { font-family: 'Segoe UI', Arial, sans-serif; background: #fcfcfc; padding: 20px; font-size: 14px; color: #333; }
.container { max-width: 1000px; margin: auto; }

/* Navigation Bar */
.top-nav { display: flex; gap: 20px; margin-bottom: 20px; align-items: center; background: #fff; padding: 10px 15px; border-radius: 8px; border: 1px solid #ddd; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.nav-link { text-decoration: none; color: #333; font-weight: bold; margin-right: 30px; }
.nav-link:hover { color: #007bff; }
.badge { background: #d9534f; color: white; border-radius: 10px; padding: 2px 7px; font-size: 11px; margin-left: 5px; }

.nav-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Boxes and Cards */
.box, .error-card { border: 1px solid #ddd; padding: 20px; border-radius: 8px; background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 20px; }
.error-card { border-color: #f5c6cb; }
.error-header { background: #f8d7da; padding: 12px 15px; color: #721c24; font-weight: bold; display: flex; justify-content: space-between; align-items: center; border-radius: 8px 8px 0 0; margin: -20px -20px 0 -20px; }

/* Tables */
table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 10px; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: center; }
th { background: #f8f9fa; text-transform: uppercase; font-size: 11px; color: #666; }
.date-col { text-align: left; font-weight: bold; width: 140px; }
.err-row { background-color: #ffdce0 !important; }

/* Time Display Logic */
.actual-time { display: block; font-size: 11px; color: #888; }
.rounded-time { display: block; font-weight: bold; color: #333; }

/* Forms and Inputs */
textarea { width: 100%; height: 280px; margin-bottom: 15px; font-family: 'Courier New', monospace; padding: 12px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; background: #fafafa; }
input[type="time"], select { padding: 4px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; }
.instructions { background: #e7f3ff; padding: 15px; border-left: 5px solid #007bff; margin-bottom: 20px; font-size: 13px; line-height: 1.6; border-radius: 0 4px 4px 0; }

/* Buttons */
button, .btn-add { padding: 8px 18px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s; }
button:hover { background: #218838; }
.btn-del { color: #d9534f; cursor: pointer; border: none; background: none; font-weight: bold; font-size: 12px; }

.filter-box {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    background: #fff;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Utility Classes */
.source-icon { font-size: 9px; color: #999; margin-left: 3px; cursor: help; }
.no-print { display: block; }

/* Printing Styles (Optimized for A4) */
@media print { 
    /* Hide unnecessary elements for a clean report */
    .no-print, .top-nav, button, form, select, .source-icon, .actual-time { 
        display: none !important; 
    } 
    
    /* Reset body for paper */
    body { 
        padding: 0; 
        margin: 0; 
        background: #fff; 
        font-size: 10pt; 
    }

    .container { max-width: 100%; width: 100%; }
    .box { border: none; box-shadow: none; padding: 0; margin: 0; }

    /* Compact table to ensure it fits vertically on A4 */
    table { 
        border: 1px solid #000; 
        width: 100%; 
        border-collapse: collapse;
    }
    
    th, td { 
        border: 1px solid #000; 
        padding: 2px 4px !important; 
        line-height: 1.1 !important; 
    }

    th { background: #eee !important; -webkit-print-color-adjust: exact; }

    /* Visual indicators for errors in print */
    .err-row { 
        background-color: transparent !important; 
        outline: 1px solid red; 
    }

    /* Emphasize rounded times in print */
    .rounded-time { 
        font-size: 10pt; 
        font-weight: bold; 
        color: #000;
        margin: 0;
    }
    
    h2 { margin-top: 0; margin-bottom: 10px; font-size: 14pt; }
}