/* Style 5: Professional Gray Theme */

/* basic page background and font */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: "Segoe UI","Helvetica Neue",Arial,sans-serif;
    color: #2c3e50;
    min-height: 100vh;
}

/* subtle shadow on navigation bar to lift it from the background */
.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
    background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
    border: none;
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
    color: #ecf0f1 !important;
}

.navbar .nav-link:hover {
    color: #bdc3c7 !important;
}

/* main content container with card-like appearance */
.container-fluid.main {
    width: 98%;
    max-width: 1920px; /* cap at typical full HD width */
    margin: 0 auto;
    background: #ecf0f1;
    padding: 1.5rem;
    border-radius: .5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1);
    margin-top: 2rem;
    border: 1px solid #bdc3c7;
}

/* --- row layout for hours entry form ---
   Flex containers senza Bootstrap .row: nessuna interferenza di gutter o width:100% */
.row-entry,
.entry-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

/* Base per ogni cella: previene overflow, azzeramento padding Bootstrap */
.row-entry > div,
.entry-header > div {
    min-width: 0;
    box-sizing: border-box;
    padding: 0 2px;
    flex: 0 0 auto; /* fallback per celle senza classe specifica */
}

/* Larghezze colonne — doppio selettore (.parent .col-x) garantisce specificità
   superiore alla regola generica > div, evitando il bug di override */
.row-entry .col-emp,   .entry-header .col-emp   { flex: 0 0 14%; }
.row-entry .col-year,  .entry-header .col-year  { flex: 0 0 6%;  }
.row-entry .col-month, .entry-header .col-month { flex: 0 0 10%; }
.row-entry .col-type,  .entry-header .col-type  { flex: 0 0 24%; }
.row-entry .col-date,  .entry-header .col-date  { flex: 0 0 9%;  }
.row-entry .col-time,  .entry-header .col-time  { flex: 0 0 5%;  }
.row-entry .col-hours, .entry-header .col-hours { flex: 0 0 6%;  }
.row-entry .col-desc,  .entry-header .col-desc  { flex: 1 1 20%; }
.row-entry .col-btn,   .entry-header .col-btn   { flex: 0 0 auto; }

/* Input/select riempiono la cella al 100% */
.row-entry .form-control,
.row-entry .form-select {
    width: 100%;
    box-sizing: border-box;
    padding: 2px 6px;
    font-size: 1.1rem;
    border-radius: 0.375rem;
    border: 1px solid #95a5a6;
    background: #ffffff;
    color: #2c3e50;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.row-entry .form-control:focus,
.row-entry .form-select:focus {
    border-color: #34495e;
    box-shadow: 0 0 0 0.2rem rgba(52, 73, 94, 0.25);
}

/* Celle header: stesso padding-left degli input → testo allineato al contenuto del campo */
.entry-header > div { padding: 2px 6px; }

/* keeping nowrap by default; use .wrap-row if a row should be allowed to wrap */
.wrap-row { flex-wrap: wrap; }

/* history table compact styling */
#history-table td, #history-table th { padding: 0.15rem 0.4rem; vertical-align: middle; }
#history-table { font-size: 0.9rem; line-height:1.2; }
#history-table thead th {
    background: linear-gradient(90deg, #34495e 0%, #2c3e50 100%);
    color: white;
}

/* small tweaks for general form layout */
.form-label { font-weight: 600; color: #2c3e50; }

/* override bootstrap container margin if needed */
.container { max-width: none !important; }

/* add spacing between adjacent buttons */
.btn + .btn { margin-left: .5rem; }

/* Button font weight */
.btn {
    font-weight: bold;
}

/* larger, darker section headings */
h2, h3, h4 { color: #34495e; }

/* UI utility classes */
.toast-container { z-index: 1100; }
#operator-rows { display: none; }

/* input width helpers for employee form */
.minw-350 { min-width: 350px; }
.minw-220 { min-width: 220px; }

/* brand emphasis */
.navbar-brand { font-weight: 600; color: #ecf0f1; }

/* generic overlay used during sending */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(236, 240, 241, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* login page container narrower than main app */
.login-wrapper {
    width: 30%;           /* 30% of viewport width */
    max-width: 400px;     /* don't grow too large on big screens */
    margin: 8rem auto 0;  /* vertically center-ish */
    padding: 2rem 1.5rem; /* add generous inner spacing */
    background: #ecf0f1;     /* ensure light gray card appearance */
    border-radius: .5rem;
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1);
    border: 1px solid #bdc3c7;
    color: #2c3e50;
}

/* Custom buttons */
.btn-primary {
    background: #3498db;
    border: none;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success {
    background: #27ae60;
    border: none;
}

.btn-warning {
    background: #f39c12;
    border: none;
}

.btn-danger {
    background: #e74c3c;
    border: none;
}

/* Outline buttons for navbar */
.btn-outline-primary {
    color: #5dade2;
    border-color: #5dade2;
}

.btn-outline-primary:hover {
    background-color: #5dade2;
    border-color: #5dade2;
}

/* Profilo button su tema Professional opponente su navbar scura */
.navbar .btn-outline-success {
    color: #f7f9fa;
    border-color: #f7f9fa;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar .btn-outline-success:hover,
.navbar .btn-outline-success:focus {
    color: #2c3e50;
    background-color: #f7f9fa;
    border-color: #f7f9fa;
}

.btn-outline-info {
    color: #85c1e9;
    border-color: #85c1e9;
}

.btn-outline-info:hover {
    background-color: #85c1e9;
    border-color: #85c1e9;
}

.btn-outline-warning {
    color: #f1c40f !important;
    border-color: #f1c40f !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    color: #2c3e50 !important;
    background-color: #f7dc6f !important;
    border-color: #f1c40f !important;
    box-shadow: 0 0.25rem 0.5rem rgba(243, 156, 18, 0.30);
}

.btn-outline-secondary {
    color: #aab7b8;
    border-color: #aab7b8;
}

.btn-outline-secondary:hover {
    background-color: #aab7b8;
    border-color: #aab7b8;
}

/* Audit settings specific high-contrast style */
.audit-settings-btn {
    color: #f1c40f !important;
    border-color: #f1c40f !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.audit-settings-btn:hover,
.audit-settings-btn:focus {
    color: #2c3e50 !important;
    background-color: #f7dc6f !important;
    border-color: #f1c40f !important;
    box-shadow: 0 0.25rem 0.5rem rgba(243, 156, 18, 0.30);
}
