﻿html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}


body {
  margin-bottom: 60px;
}

/* ====== Layout / Responsiveness ====== */
.table-container {
    overflow-x: auto; /* horizontal scroll on small screens */
    margin-bottom: 1rem;
   /* border: 1px solid #cfd4da;*/
    background: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

/* ====== Base Table ====== */
.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed; /* equalize widths */
    /*min-width: 980px;*/ /* scroll on phones if smaller */
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.2;
}

    /* Base cell styling */
    .custom-table th,
    .custom-table td {
        text-align: center;
        padding: 6px 8px;
        border-bottom: 1px solid #cfd4da;
        box-sizing: border-box;
        white-space: nowrap;
    }

    /* First column (Room) */
    .custom-table thead th:first-child,
    .custom-table tbody td:first-child {
        width: 110px;
        background-color: #D3E8EB; /* same as day header */
        font-weight: 600;
    }

    /* Day sub-columns: 14 total */
    .custom-table thead th:not(:first-child),
    .custom-table tbody td:not(:first-child) {
        width: calc((100% - 110px) / 14);
    }

    /* Remove double right borders */
    .custom-table thead tr th:last-child,
    .custom-table tbody tr td:last-child {
        border-right: none;
    }

    /* ====== Headers ====== */
    /* Row 1: Day headers */
    .custom-table thead tr:first-child th {
        background-color: #D3E8EB;
        font-weight: 700;
        border-left: 1px solid #999; /* day divider */
        border-bottom: 1px solid #999; /* day divider */
        align-content: center;
    }

        /* Add left border before first day */
        .custom-table thead tr:first-child th:nth-child(2) {
            border-left: 1px solid #999;
        }

    /* Row 2: Sub-headers */
    .custom-table thead tr:nth-child(2) th {
        background-color: #ced4da;
        font-weight: 600;
    }
        /* Odd sub-headers = Hours (left side of group) */
        .custom-table thead tr:nth-child(2) th:nth-child(odd) {
            border-left: 1px solid #999;
            border-right: 1px solid #cfd4da;
        }
        /* Even sub-headers = Planned Staff (end of group) */
        .custom-table thead tr:nth-child(2) th:nth-child(even) {
            border-right: 0px solid #999;
        }

    /* ====== Body Cells ====== */
    /* Regular cells */
    .custom-table tbody td {
        background-color: #E9ECEF;
        vertical-align: middle;
    }
        /* Start of each day group */
        .custom-table tbody td:nth-child(even) {
            border-left: 1px solid #999;
            border-right: 1px solid #cfd4da;
        }
        /* End of each day group */
        .custom-table tbody td:nth-child(odd):not(:first-child) {
            border-right: 0px solid #999;
        }

        /* ====== Inputs ====== */
        .custom-table tbody td input.form-control,
        .custom-table tbody td input.cell-input {
            display: block;
            max-width: 70px;
            width: 100%;
            margin: 2px auto;
            padding: 2px 4px;
            font-size: 0.9rem;
            text-align: center;
            background: #fff;
            border: 1px solid #cfd4da;
            border-radius: 6px;
            box-shadow: none;
            outline: none;
        }

        /* Focus state */
        .custom-table tbody td input:focus {
            border-color: #86b7fe;
            box-shadow: 0 0 0 2px rgba(13,110,253,.15);
        }

        .custom-table tbody td:first-child {
            position: sticky;
            left: 0;
            z-index: 1;
            border-left: none !important; /* prevents double left edge */
        }
    .custom-table tbody tr:last-child td {
        border-bottom: none; /* remove the extra dark line */
    }

    /* Hide spinners */
    .custom-table input[type="number"]::-webkit-outer-spin-button,
    .custom-table input[type="number"]::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .custom-table input[type="number"] {
        -moz-appearance: textfield;
    }
    .custom-table thead tr:first-child th:first-child {
        border-left: none !important; /* remove the dark border from top-left cell */
    }

/* === Vertical lines on every column except the first === */
#indirectHoursCollapse .custom-table td,
#trainingOrientationTable td,
#actualMetricsCollapse .custom-table td {
    border-left: 1px solid #cfd4da !important;
}

    /* Remove line on the first column only */
    #indirectHoursCollapse .custom-table td:first-child,
    #trainingOrientationTable td:first-child,
    #actualMetricsCollapse .custom-table td:first-child {
        border-left: none !important;
    }

    /* ====== Corners ====== */
    .custom-table thead tr:first-child th:first-child {
        border-top-left-radius: 8px;
    }

    .custom-table thead tr:first-child th:last-child {
        border-top-right-radius: 8px;
    }

    .custom-table tbody tr:last-child td:first-child {
        border-bottom-left-radius: 8px;
    }

    .custom-table tbody tr:last-child td:last-child {
        border-bottom-right-radius: 8px;
    }

/* ====== Small Screens ====== */
@media (max-width: 600px) {
    .custom-table th,
    .custom-table td {
        padding: 4px 6px;
    }

    .custom-table thead th:not(:first-child),
    .custom-table tbody td:not(:first-child) {
        width: 60px; /* tighter on phones */
    }

    .custom-table tbody td input {
        max-width: 54px;
        font-size: 0.85rem;
    }
}

/* ====== Sticky header + sticky Room column ====== */

/* ===== RESPONSIVE TABLE WRAPPER ===== */
.table-container {
    width: 100%;
    overflow-x: auto; /* allows side scroll on small screens */
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    background: #fff; /* keeps background clean */
    border-radius: 8px;
}

    .table-container table {
        width: 100%;
       /* min-width: 500px;*/ /* ensures columns don't shrink too far */
        border-collapse: collapse;
    }


/* Fix header row heights so we can offset row 2 cleanly */
:root {
    --hdr1-h: 42px; /* Day headers (row 1) height */
    --hdr2-h: 36px; /* Sub-headers (row 2) height */
}

/* Row 1 (Days) */
.custom-table thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 3; /* above cells and row 2 */
    height: var(--hdr1-h);
}

/* Row 2 (Hours / Planned Staff) */
.custom-table thead tr:nth-child(2) th {
    position: sticky;
    top: var(--hdr1-h); /* sit right below row 1 */
    z-index: 2;
    height: var(--hdr2-h);
}

/* Sticky first column (Room) in body */
.custom-table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 1; /* beneath sticky headers */
}

/* Sticky first column header cell ("Room") — spans both header rows */
.custom-table thead tr:first-child th:first-child {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 4; /* highest: sits over everything at the corner */
}

/* Ensure sticky cells render over neighbors and keep their backgrounds */
.custom-table thead th,
.custom-table tbody td:first-child {
    background-clip: padding-box; /* avoid bleed under borders when overlapping */
}

/* (Optional) Slight shadow to separate sticky header/column while scrolling */
.custom-table thead tr:first-child th,
.custom-table thead tr:nth-child(2) th {
    box-shadow: 0 1px 0 rgba(0,0,0,.05);
}

.custom-table tbody td:first-child {
    box-shadow: 1px 0 0 rgba(0,0,0,.05);
}



/* =======================
   Compact mode
   Apply to: .custom-table.compact
   ======================= */
.custom-table.compact {
    font-size: 13px; /* slightly smaller text */
   /* min-width: 860px;*/ /* narrower overall; was 980px */
}

/* Tighten header heights (works with sticky offsets if you use them) */
:root {
    --hdr1-h: 36px; /* was 42px */
    --hdr2-h: 30px; /* was 36px */
}

/* Reduce cell padding */
.custom-table.compact th,
.custom-table.compact td {
    padding: 4px 6px; /* was 6px 8px */
}

/* Narrow day columns (still equal widths with table-layout: fixed) */
.custom-table.compact thead th:not(:first-child),
.custom-table.compact tbody td:not(:first-child) {
    width: calc((100% - 100px) / 14); /* shrink Room to 100px below */
}

/* Slightly smaller Room column */
.custom-table.compact thead th:first-child,
.custom-table.compact tbody td:first-child {
    width: 100px; /* was 110px */
}

/* Slim inputs */
.custom-table.compact tbody td input.form-control,
.custom-table.compact tbody td input.cell-input {
    max-width: 56px; /* was 70px */
    padding: 1px 3px; /* was 2px 4px */
    font-size: 0.85rem; /* slightly smaller */
    margin: 1px auto; /* tighter vertical spacing */
}

/* Make borders a bit lighter for a cleaner look (optional) */
.custom-table.compact th,
.custom-table.compact td {
    border-bottom-color: #d9dee3;
}

.custom-table.compact thead tr:first-child th,
.custom-table.compact thead tr:nth-child(2) th,
.custom-table.compact tbody td:nth-child(even) {
    /* keep the day-group structure but slightly soften the lines */
    border-left-color: #a8b0b7;
    border-right-color: #d9dee3; /* thin internal Hours→Staff divider (if used elsewhere) */
}

    .custom-table.compact thead tr:first-child th,
    .custom-table.compact thead tr:nth-child(2) th:nth-child(even),
    .custom-table.compact tbody td:nth-child(odd):not(:first-child) {
        border-right-color: #a8b0b7; /* end-of-day thick divider color */
    }

/* Small screens even tighter */
@media (max-width: 600px) {
    .custom-table.compact {
        min-width: 760px;
    }

        .custom-table.compact th,
        .custom-table.compact td {
            padding: 3px 4px;
        }

        .custom-table.compact tbody td input.form-control,
        .custom-table.compact tbody td input.cell-input {
            max-width: 48px;
            font-size: 0.8rem;
        }
}

input.is-invalid,
.form-control.is-invalid {
    border-color: #dc3545 !important; /* red border */
    background-color: #f8d7da !important; /* light red background */
}

/* Style the icon itself */
.info-icon {
    color: #0d6efd; /* Bootstrap primary blue */
    cursor: pointer;
    margin-left: 6px;
}

    .info-icon:hover {
        color: #0b5ed7; /* darker blue */
    }

/* Customize popover body */
.popover {
    border-radius: 0.5rem;
    border: 1px solid #d0d7de;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 300px;
}

/* Make popover title bold and slightly larger */
.popover-header {
    font-weight: 600;
    font-size: 0.95rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Make popover content more readable */
.popover-body {
    font-size: 0.9rem;
    line-height: 1.4;
}

.card {
    border-radius: 10px;
}

/* === Top Calculation Section Styling === */
/* ===== CALCULATION SECTION STYLING ===== */
/* ===== CALC HEADER ===== */
.calc-header {
     background: var(--Gradient-brand-horizontal, linear-gradient(90deg, var(--colors-custom-secondary-dark, #102C50) 8.28%, var(--colors-cyan-cyan-700, #087990) 100%));
    color: #fff;
    display: flex;
    align-items: center;
    min-height: 160px;
}

    .calc-header h2 {
        font-size: 1.8rem;
        font-weight: 600;
    }

.calc-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex: 1 1 auto;
    max-width: 70%;
    min-width: 600px;
}

    .calc-card .btn-primary {
        background-color: #138ba5;
        border-color: #138ba5;
        font-size: 0.95rem;
    }

    .calc-card .d-flex .metric:nth-child(5) {
        border-left: 1px solid #dee2e6;
        padding-left: 1.5rem;
        margin-left: 0.5rem;
    }

    .calc-card .d-flex.flex-wrap {
        flex-wrap: nowrap; /* keep all metrics on one line */
        align-items: center; /* vertically center all items */
        justify-content: space-between; /* equal spacing between metrics */
    }

/* Make each metric uniform */
.metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 120px;
    text-align: center;
    height: 60px; /* uniform height for all metrics */
}

.metric-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--colors-black, #000);
    text-align: center;
    /* body/high-emphasis */
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px; /* 150% */
    letter-spacing: 0.008px;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--colors-black, #000);
    text-align: center;
    /* Body/Base text */
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px; /* 175% */
}

.finalmetric-value {
    color: var(--colors-black, #000);
    text-align: center;
    /* Semi-Bold / H5 Heading */
    font-family: Inter;
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
}

.metric.text-primary .metric-label,
.metric.text-primary .metric-value {
    color: #138ba5 !important;
}

/* Table layout for perfectly aligned metrics */
.metrics-table {
    table-layout: fixed; /* force equal column widths */
    border-collapse: separate;
    border-spacing: 0; /* no gaps between cells */
}

    .metrics-table td {
        vertical-align: middle;
        text-align: center;
        padding: 10px 12px;
    }

    /* Vertical divider between 4th and 5th columns (both rows) */
    .metrics-table tr > *:nth-child(5) {
        border-left: 1px solid #dee2e6;
    }
    /* Vertical divider between 4th and 5th columns (both rows) */
    .metrics-table {
        border-top: 1px solid #dee2e6;
    }

    /* Optional: add some spacing after divider */
    .metrics-table tr > *:nth-child(5) {
        padding-left: 20px;
    }



/* RESPONSIVE */
@media (max-width: 992px) {
    .calc-card {
        max-width: 100%;
        min-width: unset;
    }

    .calc-header {
        text-align: center;
        flex-direction: column;
    }

    .vr {
        border-left: 1px solid #dee2e6;
        height: 40px;
        align-self: center;
    }
}



/* ===== Section Header Styling ===== */
.section-header {
    background: var(--Gradient-brand-horizontal, linear-gradient(90deg, var(--colors-custom-secondary-dark, #102C50) 8.28%, var(--colors-cyan-cyan-700, #087990) 100%));
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Info box (tooltip-style inline) */
.info-box {
    background: #f8f9fa;
    color: #212529;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 6px;
    max-width: 320px;
    line-height: 1.2;
}

/* Input + button styling */
.section-header input[type="number"] {
    background: #f8f9fa;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.section-header .collapse-btn {
    border-radius: 6px;
    padding: 3px 6px;
    transition: 0.2s;
}

    .section-header .collapse-btn:hover {
        background: rgba(255,255,255,0.15);
    }

/* Responsive tweaks */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .info-box {
        max-width: 100%;
    }
}

.dropdownlistbutton {
    display: flex;
    height: 38px;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    background: var(--Primary-Primary-Light, #BDDAE1);
    color: var(--colors-custom-primary-dark, #0F383E);
    text-align: center;
    /* Body/Strong */
    font-family: Inter;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 28px; /* 175% */

}

#trainingOrientationTable {
    table-layout: fixed;
    width: 100%;
}

#trainingOrientationTable th,
#trainingOrientationTable td {
    width: 25%; /* 4 equal columns (2 for training, 2 for orientation) */
    word-wrap: break-word;
}

    /* Match header color for label cells in the first and third columns */
    #trainingOrientationTable td:nth-child(1),
    #trainingOrientationTable td:nth-child(3) {
        background-color: #D3E8EB; /* match your header color */
        font-weight: 600;
        color: #495057;
        border-left: 1px solid #a8b0b7; /* end-of-day thick divider color */
    }

    /* Match header color for label cells in the first and third columns */
#staffingTable td:nth-child(1),
#staffingTable td:nth-child(3),
#staffingTable td:nth-child(5),
#staffingTable td:nth-child(7) {
    border-left: 1px solid #a8b0b7; /* end-of-day thick divider color */
}

input.form-control,
select.form-control,
textarea.form-control {
    border-radius: 2px !important;
    border: 1px solid #ADB5BD !important;
    background: #FFF !important;
    box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.25) !important;
}

.numberOfRooms {
    display: flex;
    height: 38px;
    padding: 8px 16px;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
    background: var(--Primary-Primary-Light, #BDDAE1);
}

.calculateButton {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 48px;
    border-radius: 6px;
    background: var(--Primary-Primary, #258B9B);
    border-color: var(--Primary-Primary, #258B9B);
    gap: 8px;
    color: #fff;
    text-align: center;
    font-family: Inter;
    font-size: 20px;
    font-weight: 500;
    line-height: normal;
    box-shadow: none;
}

/* ===== BREADCRUMB BAR ===== */
.breadcrumb-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    font-family: Inter, sans-serif;
    font-size: 0.95rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    color: #6c757d;
}

.breadcrumb-link {
    color: #258B9B;
    text-decoration: none;
    font-weight: 500;
}

    .breadcrumb-link:hover {
        text-decoration: underline;
        color: #1b6f7e;
    }


#actualMetricsCollapse table {
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

@media (max-width: 768px) {
    /* Compact headers and cells */
    .custom-table th,
    .custom-table td {
        padding: 4px 6px !important;
        font-size: 0.85rem;
    }

    /* Shrink numeric inputs */
    .custom-table input[type='number'] {
        max-width: 80px;
        font-size: 0.85rem;
        padding: 4px;
    }

    /* Stack Training & Orientation side by side vertically */
    #trainingOrientationTable th[colspan="2"] {
        font-size: 0.9rem;
    }

    /* Ensure container scrolls instead of clipping */
    #trainingOrientationCollapse .table-container,
    #actualMetricsCollapse .table-container {
        overflow-x: auto;
    }
}




/* === Only for Planned Hours metrics === */
.highlight-metric .metric-label {
    color: #000 !important; /* solid black for clarity */
    font-weight: 600;
}

.highlight-metric .finalmetric-value {
    color: #138BA5 !important; /* brand teal-blue for emphasis */
    font-weight: 700;
}


/* === Highlighted Metric: Gray Background + Blue Value, Now with Contained Text === */
.highlight-border {
    background: #F1F3F4;
    border-left: 6px solid #138BA5;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 4px 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 140px;
    max-width: 200px; /* keep reasonable width */
    min-height: 80px; /* ensures text fits vertically */
    overflow: hidden; /* prevents spillover */
    word-wrap: break-word; /* breaks long labels */
    white-space: normal; /* allows multi-line wrapping */
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .highlight-border:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    }

    /* Label and Value colors */
    .highlight-border .metric-label {
        color: #000;
        font-weight: 600;
        font-size: .9rem;
        margin-bottom: 4px;
        line-height: 1.2;
        text-align: center;
        overflow-wrap: break-word;
    }

    .highlight-border .finalmetric-value {
        color: #138BA5;
        font-size: 1.4rem;
        font-weight: 700;
        line-height: 1.2;
        text-align: center;
        overflow-wrap: break-word;
    }


/* === Mobile Fix for Calculation Section === */
@media (max-width: 768px) {

    /* Let the calc card take full width and auto height */
    .calc-card {
        max-width: 100% !important;
        min-width: unset !important;
        padding: 1rem;
        margin: 0 auto;
    }

        /* Stack metrics vertically instead of squeezing horizontally */
        .calc-card .d-flex.flex-wrap {
            flex-wrap: wrap !important;
            justify-content: center !important;
            gap: 0.75rem !important;
        }

    /* Each metric becomes its own row block */
    .metric,
    .highlight-border {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        text-align: center;
    }

        /* Reduce the visual weight a bit to fit small screens */
        .metric .metric-label,
        .highlight-border .metric-label {
            font-size: 0.95rem;
            line-height: 1.3;
        }

        .metric .finalmetric-value,
        .highlight-border .finalmetric-value {
            font-size: 1.25rem;
            line-height: 1.3;
        }

        /* Add a touch of spacing between stacked metrics */
        .metric + .metric,
        .highlight-border + .highlight-border {
            margin-top: 0.5rem;
        }

    /* Prevent overflow horizontally */
    .metrics-table,
    .calc-card,
    .calc-card .metric {
        overflow-x: hidden;
    }
}

.icon {
    width: 138px;
    height: 19.24px;
    flex-shrink: 0;
    color: #258B9B; /* sets the fill color since fill="currentColor" */
}


.headericon {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    fill: white !important;
}
