/* ──────────────────────────────────────────────────────────────
   FORM + HEADER ALIGNMENT LOGIC
   ---------------------------------------------------------------
   - The `.form-main` class centers forms on most pages
     (login page, data entry, etc.) using margin: 0 auto.
   - However, the header's status section (".login-div")
     should stay right-aligned — it displays:
         "Logged In As ...", "Your Security Level = ...", and Logout.
   - To preserve both behaviors:
       → Keep global .form-main centered everywhere
       → Override .form-main *inside* .login-div to disable centering
       → Make .login-div a full-width flex container aligned to flex-end
   - This separation ensures that:
       * Login form stays centered on desktop and mobile
       * Header status area stays neatly right-aligned
   ---------------------------------------------------------------
   Added: Nov 2025 (CKG layout update by JCC913z)
   ────────────────────────────────────────────────────────────── */





/*#region ---Variables and Core Mechanics--- */
    :root{
        --page_BGC: rgb(50, 50, 60);
        --header_BGC: rgb(91, 199, 133);
        --font_color_main: rgb(192, 255, 239);
        --link_hover_color: rgb(114, 21, 45);
    }

    body{    
        background-color: var(--page_BGC);
    }

    /*Preloads hover images and hides them
    to prevent image flicker when first engaged*/
    body:after{        
        position: absolute;
        width: 0;
        height: 0;
        overflow: hidden;
        z-index: -1;
        content: url(../img/union_bug_color.jpg);
        content: url(../img/smacna_color.png);
    }
/*#endregion */

/*-------*/

/*#region ---Overrides For Tables and Anchors--- */
    a{
        cursor: pointer;
    }

    table, th, td{      
        border: 3px solid rgb(3, 145, 109);
        text-align: center;
        font-size: 20px;
        font-weight: 800;        
    }
    table{
        width: fit-content;
        height: fit-content;
    }
    th{
        font-size: 30px;
        background-color: rgb(93, 228, 116);
        color: rgb(30, 37, 28);
        padding: 0 5px;
    }
    td{
        color: rgb(165, 230, 241);
        align-content: center;
        margin: 0 15px;
        
    }
    td a{
        display: block;
    }
    tr:nth-child(even){
        background-color: rgb(15, 58, 28);
    }
    tr:nth-child(odd){
        background-color: rgb(11, 31, 17);
    }
/*#endregion */

/*-------*/



/*#region ---Classes--- */

    /*#region ---Header--- */
    .header-main{
        width: 100%;
        height: 60px;
        background-color: var(--header_BGC);
        display: flex;
        justify-content: space-between;    
    }

    .header-main-logo { 
        display:flex; 
        align-items:center; 
        justify-content:space-between; 
        gap:12px; 
    }

    .header-main-logo img{
        height: 100%;
        align-self: center;
    }

    .header-main-nav{
        width: fit-content;
        height: 100%;
        margin-left: 10px;
    }

    .header-main-nav ul{
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;          /* row layout */
        gap: 12px;
        align-items: center;
        flex-wrap: nowrap;      /* never wrap */
    }

    .header-main-nav ul li{
        display: block;         /* no floats with flex */
        float: none;
    }

    .header-main-nav ul li a{
        padding: 0 10px;
        font-family: Arial, Helvetica, sans-serif;
        line-height: 60px;              /* DESKTOP line-height; mobile overrides above */
        color: var(--font_color_main);
        font-weight: 900;
        display: block;
        height: 100%;
    }

    .header-main-nav ul li a:hover{
        color: var(--link_hover_color);
    }

   

    .header-main-sm{
        width: fit-content;
        height: 100%;
        padding-right: 20px;
        display: flex;
        align-items: center;
        column-gap: 10px;
    }

    .header-main-sm-smart{
        width: 40px;
        height: 40px;
        background-image: url(../img/union_bug_bw.jpg);
        background-repeat: no-repeat;
        background-size: cover;
    }

    .header-main-sm-smart:hover{
        background-image: url(../img/union_bug_color.jpg);    
    }

    .header-main-sm-smacna{
        width: 75px;
        height: 40px;
        background-image: url(../img/smacna_bw.png);
        background-repeat: no-repeat;
        background-size: cover;
    }

    .header-main-sm-smacna:hover{
        background-image: url(../img/smacna_color.png);
    }

    .header-container {
        overflow-x: auto;
        white-space: nowrap;
    }

    /*#endregion */

    /*#region ---Body--- */
    .body-main{
        display: flex;
        flex-direction: column;                
    }
    /*#endregion */

    /*#region ---Divs--- */    
    .div-fatmargin{
        margin: 40%;
    }
    .div-left{
        margin-left: 2%;
        display: flex;
        justify-content: left;
    }

    .div-center{
        display: flex;
        justify-content: center;
    }

    .div-right{
        margin-right: 2%;
        display: flex;
        justify-content: right;
    }

    .div-column{
        flex-direction: column;        
    }

    .div-row{
        flex-direction: row;
    }


    .div-spaceAround{
        display: flex;
        justify-content: space-around;
    }

    .login-div{
        font-size: 20px;
        color: var(--font_color_main);
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 12px;
        justify-content: flex-end;
        text-align: right;
        width: 100%; 
        margin-right: 10px; 
    }      

    .login-div .form-main {
        margin: 0;    
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .header-main .login-div:first-of-type {
        margin-left: auto;
    }

    .header-main .login-div .form-main {
        margin: 0; 
        max-width: none;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .header-main .login-div p { margin: 0; }


    /*#endregion */

    /*#region ---Tables--- */
    .tr-main{
        display: flex;
        flex-shrink: 3;
    }
    .tr-main2{
        display: block;
    }

    .tr-main:hover{
        background-color: rgb(45, 211, 30);
    }   
    .tr-main2:hover{
        background-color: rgb(45, 211, 30);
    }  

    .td-widthcap{
        max-width: 500px;
    }
    .div-table-1{
        margin-top: 10%;
        margin-bottom: 10%;
        display: flex;
        justify-content: center;
        flex-shrink: 3;
    }
    /*#endregion */

    /*#region ---Forms--- */
    .form-main{
        display: flex;
        flex-direction: column;
        justify-content: center;    
    }

    .div-form{
        display: flex;
        justify-content: center;
        padding: 15px;
    }

    .div-form-2{
        width: fit-content;
        height: fit-content;
        background-color: rgb(57, 65, 71);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-content: center;
        border: 2px;
        margin-top: 20px;
        padding: 15px;
    }

    .div-form3{
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
    }
    /*#endregion */

    /*#region ---Text--- */
    .h1_main{
        margin-bottom: 1%;
        width: 100%;
        font-size: 50px;
        font-weight: 600;
        color: var(--font_color_main);
        display: flex;
        justify-content: center;
    }

    .p_main{
        margin-left: 5%;
        color: var(--font_color_main);
        font-size: 15px;
    }
    
    .p_seclvl{
        margin-right: 30px;
        justify-items: right;
        color: var(--font_color_main);
        font-size: 15px;
    }
    /*#endregion */
    
    .spiral_setup{
        padding-right: 10%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }    
/*#endregion */



@media (max-width: 700px){
  /* keep header tidy on phones */
  .header-main{
    height: 56px;                 /* fixed height again */
    align-items: center;          /* vertically center contents */
    padding: 0 10px;
  }

  /* cap the logo size so it can't blow up */
  .header-main-logo img{
    height: 36px;                 /* was 80px in your file */
    width: auto;
    max-width: 160px;             /* optional guard */
  }

  /* keep the nav on one line and scroll sideways if needed */
  .header-main-nav{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .header-main-nav ul{
    flex-wrap: nowrap;            /* force single row */
  }
  .header-main-nav a{
    white-space: nowrap;          /* no wrapping text */
    display: block;
    padding: 8px 10px;
    font-size: 14px;              /* a touch smaller on phones */
    line-height: 1.2;             /* decouple from header height */
  }
}


.user-link { text-decoration: none; border-bottom: 1px dashed currentColor; }
.user-link:hover { border-bottom-style: solid; }


  .day-divider {
    background: rgba(0,0,0,.06);
    font-weight: 600;
    border-top: 2px solid #bbb;
  }
  .day-divider td {
    padding-top: .8rem;
  }


  .env-badge{
  display:inline-block;
  margin-left:.5rem;
  padding:.15rem .45rem;
  font-size:.75rem;
  font-weight:600;
  border-radius:.4rem;
  border:1px solid rgba(255,0,0,.35);
  background:rgba(255,0,0,.08);
  text-transform:uppercase;
  letter-spacing:.05em;
}

.dashboard-table .totals-row td {
  text-align: center;
  border-top: 2px solid #a5c71d;
  font-weight: 600;
  color:rgb(235, 255, 106)
}
    
input[type="date"] {
  background-color: #202028;
  color: #eee;
  border: 1px solid #444;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1); /* flips black to white */
  cursor: pointer;
}

.preview{
  font-weight: 800;                           /* bolder */
  font-size: clamp(1.4rem, 2.5vw + .25rem, 2.2rem); /* scales nicely */
  line-height: 1.15;
  letter-spacing: .2px;
}
.preview #previewName{ font-weight: 600; opacity: .95; }




/* === LOGIN FORM REWORK (autocomplete + mobile friendly) === */

.form-main {
  max-width: 420px;
  padding: 12px;
  margin: 0 auto;
}

.field {
  margin: 12px 0;
}

.field label {
  display: block;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  font-size: 16px;              /* prevents iOS zoom-on-focus */
  line-height: 1.25;
  padding: 10px 12px;
  min-height: 44px;             /* Apple touch target size */
  border-radius: 8px;
  border: 1px solid #555;
  background: #1c1c1f;
  color: #eaeaea;
}

button {
  display: inline-block;
  font-size: 18px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: #2e7d32;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover,
button:focus-visible {
  background: #388e3c;
}

/* === Autocomplete suggestion box === */
.ac-group {
  position: relative;
}

.ac-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 1000;
  background: #222;
  border: 1px solid #555;
  border-radius: 10px;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.ac-popover[hidden] {
  display: none;
}

.ac-item {
  padding: 12px;
  font-size: 16px;
  cursor: pointer;
  color: #eaeaea; 
  background: #222; 
}

.ac-item:hover,
.ac-item.is-active {
  background: #2e7d32;
  color: #fff;
}