html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Environment banner */
.env-banner {
    width: 100%;
    text-align: center;
    font-weight: bold;
    padding: 8px;
    color: white;
    z-index: 9999;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.dev-env {
    background-color: #dc3545;
}

.staging-env {
    background-color: #dc3545;
}

html {
  position: relative;
  min-height: 100%;
  overflow: auto;
}

body {
  margin-bottom: 60px;
  overflow: auto;
}

.form-outline .form-control {
    min-height: auto;
    padding-top: .32rem;
    padding-bottom: .32rem;
    padding-left: .75rem;
    padding-right: .75rem;
    border: 0;
    background: rgba(0,0,0,0);
    transition: all .2s linear;
}

.form-outline .form-control ~ .form-label {
    position: absolute;
    top: 0;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    left: .75rem;
    padding-top: .37rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: all .2s ease-out;
    color: var(--mdb-form-control-label-color);
    margin-bottom: 0;
}

.cascading-right {
    margin-right: -50px;
}

@media (max-width: 991.98px) {
    .cascading-right {
        margin-right: 0;
    }
}

#btn-add-client.btn-floating,
#btn-add-project.btn-floating,
#btn-add-deliverable.btn-floating,
#btn-add-phase.btn-floating,
#btn-refresh-project.btn-floating,
#btn-refresh-deliverable.btn-floating,
#btn-refresh-phase.btn-floating,
#btn-refresh-client.btn-floating,
#btn-refresh-project-client.btn-floating,
#btn-refresh-deliverable-projects.btn-floating,
#btn-refresh-phase-deliverables.btn-floating {
    width: 1rem;
    height: 1rem;
    margin-bottom: 6px;
}

#btn-add-client.btn-floating .fas,
#btn-add-project.btn-floating .fas,
#btn-add-deliverable.btn-floating .fas,
#btn-add-phase.btn-floating .fas,
#btn-refresh-client.btn-floating .fas,
#btn-refresh-project.btn-floating .fas,
#btn-refresh-deliverable.btn-floating .fas,
#btn-refresh-phase.btn-floating .fas,
#btn-refresh-deliverable-projects.btn-floating .fas,
#btn-refresh-phase-deliverables.btn-floating .fas,
#btn-refresh-project-client.btn-floating .fas {
    width: 1rem;
    line-height: 1rem;
}

#span-refresh-client,
#span-refresh-project,
#span-refresh-deliverable,
#span-refresh-phase {
    margin-left: 5px;
}

#timer-container li:not(:last-child) {
    margin-right: 5px;
}

#timer-container.eaglenest-timer-nav {
    gap: 0.35rem;
}

#timer-container .eaglenest-timer-pill {
    display: flex;
    align-items: center;
}

#timer-container .eaglenest-timer-pill .badge {
    margin-top: 0;
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.45em 0.65em;
    line-height: 1.25;
    white-space: nowrap;
    color: #fff !important;
}

#timer-container .eaglenest-timer-stop .header-stop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #fff;
    text-decoration: none;
}

#timer-container .eaglenest-timer-stop .header-stop:hover {
    background-color: #f8f9fa;
}
header {
    min-height: 51px;
}
.navbar {
    padding-bottom: 0rem;
    min-height: 51px;
}

/* Mobile nav toggle — high contrast on white header */
.eaglenest-navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.45rem 0.65rem;
    background-color: #f1f3f5;
    border: 2px solid #343a40 !important;
    border-radius: 0.375rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    color: #212529;
}

.eaglenest-navbar-toggler:focus,
.eaglenest-navbar-toggler:hover {
    background-color: #e9ecef;
    border-color: #1266f1 !important;
    box-shadow: 0 0 0 0.2rem rgba(18, 102, 241, 0.25);
}

.eaglenest-navbar-toggler-icon {
    font-size: 1.25rem;
    line-height: 1;
    color: #212529;
}

.navbar-nav .nav-item.btn-sm {
    padding: .15rem .1rem .15rem;
    font-size: .7rem;
}

#timer-container .badge {
    margin-top: 5px;
}
.navbar-light .navbar-nav.eaglenest-main-nav .nav-link.active,
.navbar-light .navbar-nav.eaglenest-main-nav .show > .nav-link {
    color: #1266f1;
}

.eaglenest-app-status .eaglenest-app-status-label {
    cursor: default;
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.eaglenest-app-status .eaglenest-app-status-icon {
    margin-right: 0;
    font-size: 0.7rem;
}

.eaglenest-status-nav {
    margin-left: 0.25rem;
}

.eaglenest-status-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.eaglenest-status-floating {
    color: #2f4a6e;
}

.eaglenest-status-floating img,
.eaglenest-status-watch img {
    display: block;
    object-fit: contain;
}

.eaglenest-status-watch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #b42318;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
@media (min-width: 576px) {
    .navbar-expand-sm .navbar-nav .nav-link {
        padding-right: .5rem;
        padding-left: .5rem;
        padding-bottom: 5px;
        padding-top: 5px;
    }
}

/* Full cell background for date columns */
.date-cell-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem; /* Match DataTables default cell padding */
}

/* Past due styling - full cell background + readable text */
.past-due-cell {
    background-color: #ffebee !important;
    color: #d32f2f !important; /* Dark red text for contrast */
}

.past-due-cell .row-text {
    color: #d32f2f !important;
    width: 100%;
}

th[title="Effort Now"],
th[title="Estimated Effort"] {
    width: 50px;
}

td input[data-field="EffortNow"].form-control,
td input[data-field="EffortPerDay"].form-control {
    width: 50px !important;
}

.eaglenest-nav-icon {
    margin-right: 0.35rem;
}

.eaglenest-nav-iconlink .eaglenest-nav-icon {
    margin-right: 0;
    font-size: 1.05rem;
}

.eaglenest-time-state {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    vertical-align: middle;
}

.eaglenest-time-on {
    background-color: #198754;
}

.eaglenest-time-off {
    background-color: #dc3545;
}

#timer-container .header-stop {
    padding: .5rem .1rem;
}

.hide-column {
    display: none;
}

#tasks-dt .btn-floating {
    width: 1.3125rem;
    height: 1.3125rem;
}

#tasks-dt .entry-video-col {
    min-width: 5.75rem;
    white-space: nowrap;
    vertical-align: middle;
}

.entry-video-watch {
    color: #1266f1;
    font-weight: 600;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    text-decoration: none;
}

button.entry-video-watch:hover,
button.entry-video-watch:focus {
    text-decoration: underline;
}

.entry-video-missing {
    color: #6c757d;
}

.entry-play-video {
    width: 100%;
    max-height: min(70vh, 720px);
    background: #000;
    display: block;
}

.entry-play-shell {
    background: #000;
}

.entry-play-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.6rem 0.55rem;
    background: #111;
}

.entry-play-seek {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: #1266f1;
}

.entry-play-time {
    color: #f8f9fa;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.entry-play-rates .entry-play-rate.is-on,
.entry-play-rates .btn-secondary {
    font-weight: 600;
}

#tasks-dt .btn-floating .fas {
    width: 1rem;
    line-height: 1rem;
}

.row-input.form-check-input {
    width: none;
}

.modal-footer {
    border-top: none;
}

.btn-add-keyitem {

}

/* Make editing textarea resizable and visually match other form fields */
textarea#KeyItemDescription {
    resize: both; /* allow height + width changes */
    overflow: auto;
    min-height: 160px;
    min-width: 200px;
    box-sizing: border-box;
    border: 1px solid #ced4da; /* same border as Bootstrap form-control */
    border-radius: .25rem;
    padding: .375rem .75rem;
    font-family: inherit;
    font-size: 1rem;
}

/* When CKEditor replaces textarea it creates a div with class .ck-editor__editable.
               Apply form-control-like styles and allow visual resizing of the editor container. */
.ck-editor__editable.form-control {
    resize: both;
    overflow: auto;
    box-sizing: border-box;
    min-height: 160px;
    min-width: 200px;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    padding: .375rem .75rem;
    font-family: inherit;
    font-size: 1rem;
}

/* style for the readonly description view (fallback if CKEditor not available) */
.description-view {
    min-height: 200px;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    padding: .5rem;
    background-color: #fff;
    overflow: auto;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

.ck-editor__main {
    height: 100%;
}

.ck-editor__editable_inline {
    min-height: 200px
}

/* ==========================================================================
   Eagle Nest — mobile & tablet responsive (desktop layout unchanged ≥992px)
   ========================================================================== */

@media (max-width: 991.98px) {
    .navbar .container-fluid.flex-wrap {
        align-items: center;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }

    .eaglenest-navbar-toggler {
        flex-shrink: 0;
        margin-left: auto;
        z-index: 1035;
    }

    .navbar-collapse.eaglenest-navbar-collapse.show,
    .navbar-collapse.eaglenest-navbar-collapse.collapsing {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-collapse.eaglenest-navbar-collapse {
        max-height: calc(100vh - 3.5rem);
        overflow-y: auto;
        padding-bottom: 0.75rem;
        flex-basis: 100%;
    }

    .navbar-collapse.eaglenest-navbar-collapse > .navbar-nav {
        width: 100%;
    }

    .navbar-collapse.eaglenest-navbar-collapse .dropdown-menu {
        position: static;
        float: none;
        border: 1px solid rgba(0, 0, 0, 0.08);
        border-radius: 0.375rem;
        box-shadow: none;
        background-color: #fff;
        padding: 0.35rem 0.75rem;
        margin-top: 0.25rem;
    }

    .navbar-collapse.eaglenest-navbar-collapse .dropdown-item {
        border-radius: 0.25rem;
    }

    .navbar-collapse.eaglenest-navbar-collapse .dropdown-item:hover,
    .navbar-collapse.eaglenest-navbar-collapse .dropdown-item:focus {
        background-color: #f1f3f5;
    }

    #timer-container.eaglenest-timer-nav {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem;
        width: 100%;
        margin: 0.5rem 0 0;
        padding: 0.5rem 0 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    #timer-container.eaglenest-timer-nav .nav-item.badge,
    #timer-container.eaglenest-timer-nav .eaglenest-timer-pill {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
        text-align: left;
    }

    #timer-container.eaglenest-timer-nav .eaglenest-timer-pill .badge {
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
        text-align: left;
    }

    #timer-container.eaglenest-timer-nav .nav-link {
        white-space: normal;
        line-height: 1.25;
        padding: 0.35rem 0.5rem;
    }

    .eaglenest-user-nav {
        width: 100%;
        margin-top: 0.25rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    .eaglenest-user-nav .dropdown-menu {
        position: static;
    }

    .eaglenest-main {
        max-width: 100%;
        overflow-x: clip;
    }

    .eaglenest-table-scroll,
    .table-responsive.eaglenest-table-scroll {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.75rem;
    }

    .eaglenest-table-scroll > table,
    .eaglenest-table-scroll > .dataTables_wrapper,
    .eaglenest-table-scroll .dataTables_wrapper {
        min-width: max-content;
    }

    .dataTables_wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    div.dataTables_wrapper div.dataTables_scroll {
        overflow-x: auto;
        width: 100% !important;
    }

    div.dataTables_wrapper div.dataTables_scrollHead,
    div.dataTables_wrapper div.dataTables_scrollBody {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    table.dataTable {
        width: max-content !important;
        min-width: 100%;
    }

    .timesheet-card .eaglenest-table-scroll > table {
        min-width: 52rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        max-width: 100%;
        margin-left: 0 !important;
        display: block;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
        width: 100%;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }

    .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .dt-buttons .btn,
    #tasks-dt .btn-floating,
    #tasks-dt-priority .btn-floating,
    .btn-edit-subtask,
    .btn-delete-subtask,
    .goal-task-restore {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .navbar-nav .nav-item.btn-sm {
        width: 100%;
        margin-top: 0.25rem;
    }

    .navbar-nav .nav-item.btn-sm .nav-link {
        text-align: center;
    }
}

@media (max-width: 767.98px) {
    .eaglenest-main {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    main .container,
    main .container-fluid {
        padding-left: 0;
        padding-right: 0;
    }

    .row > [class*="col-md-"],
    .row > [class*="col-lg-"] {
        margin-bottom: 0.5rem;
    }

    .row > [class*="col-md-"]:last-child,
    .row > [class*="col-lg-"]:last-child {
        margin-bottom: 0;
    }

    .filter-section .form-select,
    .filter-section .form-control {
        max-width: 100%;
    }

    .daily-update-header h2 {
        font-size: 1.45rem;
    }

    .submission-card-grid {
        flex-direction: column;
    }

    .submission-card {
        width: 100%;
    }

    .row.my-5 .col-md-3 {
        margin-bottom: 0.75rem;
    }

    .row.my-5 .btn-lg {
        width: 100%;
    }

    .card-header.d-flex {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.75rem;
    }

    .card-header.d-flex .btn,
    .card-header.d-flex a.btn {
        width: 100%;
    }

    .btn-action-row,
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .btn-action-row .btn,
    .timesheet-card .d-flex.gap-2 .btn {
        flex: 1 1 auto;
        min-width: min(100%, 10rem);
    }

    .modal-dialog.modal-fullscreen-md-down {
        margin: 0;
    }

    .modal-dialog.modal-fullscreen-md-down .modal-body {
        overflow-y: auto;
    }

    #taskModal .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        border-bottom: 1px solid #dee2e6;
    }

    #taskModal .nav-tabs .nav-link {
        white-space: nowrap;
    }

    textarea#KeyItemDescription,
    .ck-editor__editable.form-control,
    .description-view {
        min-width: 0;
        width: 100%;
    }

    .select2-container {
        width: 100% !important;
        max-width: 100%;
    }

    .task-autocomplete-menu {
        max-width: 100vw;
    }

    .timesheet-summary {
        margin-top: 0.5rem;
    }
}

.eaglenest-mobile-table-host[data-mobile-profile="release-notes"] .dataTables_wrapper,
.eaglenest-mobile-table-host[data-mobile-profile="change-logs"] .dataTables_wrapper,
.eaglenest-mobile-table-host[data-mobile-profile="key-items"] .dataTables_wrapper {
    overflow-x: visible;
}

.eaglenest-mobile-table-host[data-mobile-profile="release-notes"] .eaglenest-table-scroll,
.eaglenest-mobile-table-host[data-mobile-profile="change-logs"] .eaglenest-table-scroll,
.eaglenest-mobile-table-host[data-mobile-profile="key-items"] .eaglenest-table-scroll {
    overflow-x: auto;
}