/* GNS HMS additions on top of the Metrica theme. */

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.ticket-description,
.message-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-internal {
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
}

.stat-card .display-6 {
    font-weight: 600;
}

pre.audit-json {
    font-size: 0.75rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-width: 420px;
}

/* Brand text in the menu header (the template's image logo is not used). */
.brand-text {
    font-weight: 700;
    letter-spacing: .5px;
    font-size: 1.05rem;
    color: #0b51b7;
    text-decoration: none;
    white-space: nowrap;
}

.brand-text span {
    font-weight: 500;
    letter-spacing: 0;
    font-size: .78rem;
    color: #6c7a91;
}

/* Initials avatar (no photos are stored). */
.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-weight: 600;
    font-size: .8rem;
    line-height: 1;
}

.avatar-initials-sm {
    background: #0b51b7;
}

.lang-switch i {
    vertical-align: middle;
}

/* Metrica ships Bootstrap 5.0; keep the cards in the content area readable. */
.page-content-tab .card {
    margin-bottom: 1rem;
}

.page-content-tab .card .card .card-body {
    padding: 1rem;
}

.auth-page .card {
    box-shadow: 0 8px 30px rgba(11, 81, 183, .12);
}
.validation-summary-valid { display: none; }

/* ---- Single-column sidebar (the template's icon rail is not used) ---- */
.leftbar-tab-menu {
    min-width: 0;
}

.leftbar-tab-menu .main-menu-inner {
    display: block;
    left: 0;
    width: 260px;
}

.topbar .navbar-custom {
    margin-left: 260px;
}

.page-wrapper .page-content-tab {
    width: calc(100% - 260px);
}

/* Menu button collapses the sidebar completely. */
body.enlarge-menu .leftbar-tab-menu .main-menu-inner {
    display: none;
}

body.enlarge-menu .topbar .navbar-custom {
    margin-left: 0 !important;
}

body.enlarge-menu .page-wrapper .page-content-tab {
    width: 100% !important;
}

@media (max-width: 1199.98px) {
    .topbar .navbar-custom {
        margin-left: 0 !important;
    }

    .page-wrapper .page-content-tab {
        width: 100% !important;
    }

    .leftbar-tab-menu .main-menu-inner {
        box-shadow: 0 0 24px rgba(0, 0, 0, .15);
    }
}

.brand-mark {
    height: 26px;
    margin-right: 8px;
    vertical-align: middle;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav {
    padding-left: 0 !important;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav > .nav-item > .nav-link {
    padding: 12px 24px !important;
    font-weight: 600 !important;
    font-size: 14px;
    color: #3b4863 !important;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav > .nav-item > .nav-link.active {
    color: #0b51b7 !important;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav .nav-item .nav {
    padding: 0 0 6px 0;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav .nav .nav-link {
    padding: 8px 24px 8px 44px !important;
    font-weight: 500;
    position: relative;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav .nav .nav-link.active {
    color: #0b51b7;
    font-weight: 600;
}

.leftbar-tab-menu .navbar-vertical .navbar-nav .nav-item .nav .nav-item .nav-link:before {
    left: 26px !important;
    top: 17px !important;
}

/* Language buttons (always visible, no dropdown) */
.topbar-nav .lang-buttons {
    display: flex;
    align-items: center;
    height: 70px;
    padding: 0 .75rem;
}
.auth-lang {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
}

/* Modules of later phases */
.menu-disabled {
    display: block;
    cursor: not-allowed;
    opacity: .5;
}
.phase-badge {
    font-size: .625rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: .25rem;
}
body.enlarge-menu .phase-badge { display: none; }

/* ---------- Design polish (all pages) ---------- */
body { background-color: #f4f6fa; }

.card {
    border: 1px solid #e6eaf1;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(20, 40, 80, .05);
    margin-bottom: 1.25rem;
}
.card > .card-header {
    background: #fff;
    border-bottom: 1px solid #edf0f6;
    border-radius: 12px 12px 0 0;
    font-weight: 600;
    padding: .85rem 1.1rem;
}
.card-body { padding: 1.1rem 1.25rem; }
.stat-card { transition: transform .15s ease, box-shadow .15s ease; border-left-width: 4px; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20, 40, 80, .1); }

.table thead th {
    background: #f7f9fc;
    color: #5b6b86;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .4px;
    text-transform: uppercase;
    border-bottom: 1px solid #e6eaf1;
    white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { background-color: #f3f7ff; }
.table > :not(caption) > * > * { padding: .7rem .9rem; }

.form-label { font-weight: 500; font-size: .85rem; color: #44546f; margin-bottom: .3rem; }
.form-control, .form-select, .selectr-selected {
    border-radius: 8px;
    border-color: #d5dbe6;
    min-height: 38px;
}
.form-control:focus, .form-select:focus {
    border-color: #0b51b7;
    box-shadow: 0 0 0 .2rem rgba(11, 81, 183, .12);
}
.btn { border-radius: 8px; font-weight: 500; }
.badge { font-weight: 500; padding: .4em .65em; border-radius: 6px; }
.alert { border-radius: 10px; border: 0; }
.list-group-item { border-color: #edf0f6; }
.page-title-box .page-title, .page-title { font-weight: 600; }

/* ---------- Selectr (match the form controls) ---------- */
.selectr-container { width: 100%; }
.selectr-selected {
    background: #fff;
    padding: .45rem 2rem .45rem .75rem;
    border: 1px solid #d5dbe6;
    font-size: .9rem;
}
.selectr-container.open .selectr-selected { border-color: #0b51b7; box-shadow: 0 0 0 .2rem rgba(11, 81, 183, .12); }
.selectr-options-container { border-radius: 0 0 8px 8px; box-shadow: 0 8px 20px rgba(20, 40, 80, .12); z-index: 1060; }
.selectr-option { padding: .5rem .75rem; font-size: .9rem; }
.selectr-option.active, .selectr-option.selected { background: #e8f0fd; color: #0b51b7; }
.selectr-input-container .selectr-input { border-radius: 6px; padding: .4rem .6rem; }
.selectr-hidden { display: block !important; }
.selectr-container.disabled .selectr-selected { background: #eef1f6; }

/* ---------- File drop zone ---------- */
.gns-dropzone {
    position: relative;
    border: 2px dashed #b9c5d8;
    border-radius: 12px;
    background: #fafbfe;
    transition: border-color .15s, background .15s;
}
.gns-dropzone:hover, .gns-dropzone.is-dragover { border-color: #0b51b7; background: #eef4ff; }
.gns-dropzone-body { text-align: center; padding: 1.6rem 1rem; pointer-events: none; }
.gns-dropzone.has-files .gns-dropzone-body { padding: 1rem; }
.gns-dropzone-icon { font-size: 2.4rem; color: #0b51b7; line-height: 1; }
.gns-dropzone-title { font-weight: 600; color: #2b3a55; margin-top: .35rem; }
.gns-dropzone-hint { font-size: .8rem; color: #8492a9; }
.gns-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}
.gns-dropzone-files { position: relative; z-index: 2; padding: 0 1rem; }
.gns-dropzone-files:not(:empty) { padding-bottom: .9rem; }
.gns-dropzone-file {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #fff;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    padding: .5rem .75rem;
    margin-top: .5rem;
}
.gns-dropzone-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: 6px; }
.gns-dropzone-fileicon { font-size: 1.8rem; color: #6c7a91; }
.gns-dropzone-filename { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gns-dropzone-filename small { display: block; }

/* ---------- Calendar ---------- */
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
#dashboardCalendar .fc-toolbar-title { font-size: 1.1rem; font-weight: 600; }
#dashboardCalendar .fc-button { border-radius: 8px; text-transform: capitalize; }
#dashboardCalendar .fc-button-primary { background: #0b51b7; border-color: #0b51b7; }
#dashboardCalendar .fc-button-primary:not(:disabled).fc-button-active { background: #083a85; border-color: #083a85; }
#dashboardCalendar .fc-event { cursor: pointer; font-size: .78rem; padding: 1px 4px; }

/* ---------- Shift roster ---------- */
.shift-steps { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .85rem; color: #8492a9; }
.shift-step { display: inline-flex; align-items: center; gap: .35rem; }
.shift-step-no { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: #dfe5f1; color: #5b6b86; font-size: .7rem; font-weight: 600; }
.shift-step.done { color: #198754; }
.shift-step.done .shift-step-no { background: #198754; color: #fff; }
.shift-step.current { color: #0b51b7; font-weight: 600; }
.shift-step.current .shift-step-no { background: #0b51b7; color: #fff; }
.shift-stat .card-body { padding: .8rem 1rem; }
.shift-grid { font-size: .8rem; min-width: 1200px; }
.shift-grid th, .shift-grid td { padding: .25rem !important; text-align: center; border-color: #e6eaf1; }
.shift-grid .shift-name-col { text-align: left; min-width: 150px; padding-left: .6rem !important; position: sticky; left: 0; background: #fff; z-index: 1; white-space: nowrap; }
.shift-grid thead .shift-name-col { background: #f7f9fc; }
.shift-grid .weekend { background: #f3f5fa; }
.shift-grid .holiday { background: #fff3e0; }
.shift-grid th.today { background: #0b51b7; color: #fff; }
.shift-grid td.today { box-shadow: inset 2px 0 0 #0b51b7, inset -2px 0 0 #0b51b7; }
.shift-grid .shift-total-col { min-width: 56px; background: #f7f9fc; }
.shift-cell { height: 34px; min-width: 34px; }
.shift-cell.editable { cursor: pointer; }
.shift-cell.editable:hover { background: #e8f0fd; }
.shift-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 5px; border-radius: 5px; color: #fff; font-weight: 700; font-size: .72rem; }
.shift-leave { display: inline-block; padding: 1px 6px; border-radius: 4px; background: #e3e8f4; color: #4a5a78; font-size: .68rem; font-weight: 600; }
.legend-box { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; border: 1px solid #e6eaf1; }
.legend-box.holiday { background: #fff3e0; }
.legend-box.weekend { background: #f3f5fa; }
.shift-pick.active { outline: 2px solid #0b51b7; }

@media print {
    .leftbar-tab-menu, .topbar, .no-print, .footer { display: none !important; }
    .page-wrapper, .page-content { margin: 0 !important; padding: 0 !important; }
    .shift-grid { min-width: 0; font-size: .65rem; }
    .card { box-shadow: none; border: 0; }
}

/* Green Nature wordmark in the menu header. */
.leftbar-tab-menu .main-menu-inner .topbar-left {
    background-color: #f8f9fb;
    padding-left: 38px;
}

.brand-logo {
    height: 37px;
    max-width: 196px;
    width: auto;
    object-fit: contain;
    vertical-align: middle;
}
