/* ============================================================
   Bootstrap 5 overrides for the Leaves app.
   Loaded AFTER App_Themes/default.css, so these rules win even if
   default.css is regenerated by the Theme admin page (frmTheme.aspx).
   Brand/menu colour: #00793A (green).
   ============================================================ */

/* GridView header coloured to match the menu/brand green, left-aligned.
   Targets header cells so it overrides Bootstrap's per-cell background. */
.gv-menu-head th {
    background-color: #00793A !important;
    background-image: none !important;
    color: #ffffff !important;
    border-color: #00793A !important;
    text-align: left !important;
}

/* Navbar background (brand green) */
.imi-navbar {
    background-color: #00793A;
}
/* brighter, fully-visible navbar text (Bootstrap's dark theme dims links to ~55%) */
.imi-navbar .nav-link,
.imi-navbar .navbar-brand {
    color: #ffffff !important;
    font-weight: 500;
}
.imi-navbar .nav-link:hover,
.imi-navbar .nav-link:focus,
.imi-navbar .nav-link.show {
    color: #d8ffe9 !important;
}

/* AjaxControlToolkit TabContainer — restyle as clean tabs.
   (Bootstrap's CSS breaks the toolkit's default sliding-door theme images.) */
.ajax__tab_header {
    background: none !important;
    border-bottom: 2px solid #00793A !important;
    margin-bottom: 12px;
    padding-bottom: 0;
    font-family: inherit;
    white-space: nowrap;
}
.ajax__tab_outer,
.ajax__tab_inner {
    background-image: none !important;
    background-color: transparent !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
}
.ajax__tab_tab {
    background-image: none !important;
    background-color: #f1f3f5 !important;
    color: #00793A !important;
    text-decoration: none !important;
    display: inline-block !important;
    height: auto !important;
    margin: 0 3px 0 0 !important;
    padding: 7px 16px !important;
    border: 1px solid #ced4da !important;
    border-bottom: 0 !important;
    border-radius: 6px 6px 0 0 !important;
    cursor: pointer;
    font-weight: 500;
}
.ajax__tab_hover .ajax__tab_tab {
    background-color: #e2e6ea !important;
}
.ajax__tab_active .ajax__tab_tab {
    background-color: #00793A !important;
    color: #ffffff !important;
    border-color: #00793A !important;
}
.ajax__tab_body {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-top: 0;
    padding: 16px !important;
    font-family: inherit;
}

/* Page title */
.LabelTitle {
    display: block;
    font-family: inherit !important;
    font-size: 1.6rem !important;
    font-weight: 600 !important;
    color: #00793A !important;
    text-align: center;
    padding-bottom: 8px;
    margin: 4px auto 18px;
    border-bottom: 2px solid #00793A;
    letter-spacing: .3px;
}

/* ---------------------------------------------------------------------------
   App button system. Three variants, one shared geometry so buttons sitting
   side by side (e.g. Select + Delete in a grid row) always line up:

     .ButtonStyle        normal action    - green outline
     .DeleteButtonStyle  destructive      - red outline
     .CancelButtonStyle  dismiss          - grey outline

   All are outline buttons and fill in on hover/focus.
   .ButtonStyle keeps its legacy name so the ~100 existing usages restyle
   with no markup change.
   --------------------------------------------------------------------------- */
.ButtonStyle,
.DeleteButtonStyle,
.CancelButtonStyle {
    display: inline-block;
    background-image: none !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    border-radius: .375rem !important;
    padding: .375rem .9rem !important;
    margin: 3px 4px !important;
    min-width: 84px;
    font-weight: 600 !important;
    font-size: 1rem !important;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ButtonStyle {
    color: #00793A !important;
    border-color: #00793A !important;
}
.ButtonStyle:hover,
.ButtonStyle:focus {
    background-color: #00793A !important;
    color: #ffffff !important;
}

.DeleteButtonStyle {
    color: #b02a37 !important;
    border-color: #b02a37 !important;
}
.DeleteButtonStyle:hover,
.DeleteButtonStyle:focus {
    background-color: #b02a37 !important;
    color: #ffffff !important;
}

.CancelButtonStyle {
    color: #5c636a !important;
    border-color: #adb5bd !important;
}
.CancelButtonStyle:hover,
.CancelButtonStyle:focus {
    background-color: #5c636a !important;
    border-color: #5c636a !important;
    color: #ffffff !important;
}

/* ASP.NET renders Enabled='False' as the disabled attribute - mute it so a
   disabled outline button doesn't read as an active one. */
.ButtonStyle:disabled, .ButtonStyle[disabled],
.DeleteButtonStyle:disabled, .DeleteButtonStyle[disabled],
.CancelButtonStyle:disabled, .CancelButtonStyle[disabled] {
    opacity: .45;
    cursor: not-allowed;
}
.ButtonStyle:disabled:hover, .ButtonStyle[disabled]:hover,
.DeleteButtonStyle:disabled:hover, .DeleteButtonStyle[disabled]:hover,
.CancelButtonStyle:disabled:hover, .CancelButtonStyle[disabled]:hover {
    background-color: transparent !important;
}
.ButtonStyle:disabled:hover, .ButtonStyle[disabled]:hover { color: #00793A !important; }
.DeleteButtonStyle:disabled:hover, .DeleteButtonStyle[disabled]:hover { color: #b02a37 !important; }
.CancelButtonStyle:disabled:hover, .CancelButtonStyle[disabled]:hover { color: #5c636a !important; }

/* Buttons inside a GridView are row actions, not page actions: same outline
   look, smaller footprint so they don't dominate the row. Every GridView in
   the app carries .gv-menu-head, so scoping on it covers all of them. */
.gv-menu-head .ButtonStyle,
.gv-menu-head .DeleteButtonStyle,
.gv-menu-head .CancelButtonStyle {
    min-width: 58px;
    padding: .1rem .45rem !important;
    margin: 2px !important;
    font-size: .8125rem !important;
    line-height: 1.35;
    border-radius: .25rem !important;
}
/* Keep a Select + Delete pair on one line even when the action column is
   narrow, instead of stacking and doubling the row height. */
.gv-menu-head td:has(.ButtonStyle),
.gv-menu-head td:has(.DeleteButtonStyle),
.gv-menu-head td:has(.CancelButtonStyle) {
    white-space: nowrap;
}

.btn {
    margin: 2px 3px;
}

/* ---- ModalPopupExtender popup: plain, card-like dialog ---- */
.modalPopupPanel {
    width: 340px;
    max-width: calc(100vw - 2rem);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .175);
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .25);
    overflow: hidden;
    text-align: left;
}
.modalPopupPanel .modalPopupHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .6rem .9rem;
    background: #00793A;
    color: #fff;
    font-weight: 600;
    font-size: .95rem;
}
.modalPopupPanel .modalPopupBody {
    padding: .9rem;
}
.modalPopupPanel .modalPopupBody label,
.modalPopupPanel .modalPopupBody .modalPopupLabel {
    display: block;
    margin-bottom: .35rem;
    font-size: .875rem;
    font-weight: 600;
    color: #333;
}
/* the disabled Sno field reads as a caption, not an input */
.modalPopupPanel .modalPopupSno {
    width: auto;
    max-width: 45%;
    border: 0;
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: .85rem;
    text-align: right;
    padding: 0;
}
.modalPopupPanel .modalPopupFooter {
    padding: .6rem .9rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, .1);
    text-align: right;
}

/* Form field labels: readable, on-brand green */
.LabelStyle {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #00793A !important;
    text-align: left !important;
    display: inline-block;
    vertical-align: middle;
    padding-right: 10px;
    margin-bottom: 0;
}

/* Stacked, responsive form layout for tables marked .form-stack.
   Field/title/button rows form a centred column ~1/3 (lg), ~1/2 (md) or
   full (sm) width; controls fill that width. GridView rows stay full width.
   Child combinators (>) keep nested control tables (e.g. date pickers) intact. */
.form-stack > tbody > tr,
.form-stack > tr {
    display: block;
}
.form-stack > tbody > tr > td,
.form-stack > tr > td {
    display: block;
    width: 100% !important;
    text-align: left;
    padding: 3px 0;
}
/* label sits above its control, left-aligned */
.form-stack .LabelStyle {
    display: block !important;
    text-align: left !important;
    padding-right: 0 !important;
    margin-bottom: 3px;
}
/* controls fill the column width */
.form-stack > tbody > tr > td > .form-control,
.form-stack > tbody > tr > td > .form-select,
.form-stack > tbody > tr > td > .TextboxStyle,
.form-stack > tbody > tr > td > .empTextboxstyle,
.form-stack > tr > td > .form-control,
.form-stack > tr > td > .form-select,
.form-stack > tr > td > .TextboxStyle,
.form-stack > tr > td > .empTextboxstyle {
    display: block;
    width: 100%;
    max-width: 100%;
}
/* centre the field/title/button rows into a responsive narrow column;
   rows that contain a grid (:has) stay full width */
.form-stack > tbody > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)),
.form-stack > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)) {
    margin-left: auto;
    margin-right: auto;
}
@media (min-width: 768px) {
    .form-stack > tbody > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)),
    .form-stack > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)) { max-width: 50%; }
}
@media (min-width: 992px) {
    .form-stack > tbody > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)),
    .form-stack > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)) { max-width: 33.333%; }
}

/* Leave Application form: wider column than the default form-stack (it holds the
   from/to date pickers side by side, which need more room). Scoped to this form
   so other .form-stack pages keep their narrow layout. Higher specificity
   (two classes) overrides the breakpoint rules above at every width. */
@media (min-width: 768px) {
    .leave-app-form.form-stack > tbody > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)),
    .leave-app-form.form-stack > tr:not(:has(.gv-menu-head)):not(:has(.LabelTitle)) {
        max-width: 900px;
    }
}

/* Leave Application detail section (inside the initially-hidden panel, a nested
   table the .form-stack rules intentionally skip): spread the from/to date grid
   evenly across the widened column instead of clustering left with a big empty
   trailing column, and let the free-text areas fill their cell. */
.leave-app-form .date-grid-table {
    width: 100%;
    table-layout: fixed;
}
.leave-app-form .date-grid-table > tbody > tr > td {
    /* !important overrides the inline style="width:75px/125px" on the header cells,
       which would otherwise define the columns under table-layout: fixed. */
    width: 20% !important;
    padding: 4px 10px;
    vertical-align: top;
}
.leave-app-form .date-grid-table > tbody > tr > td:first-child {
    padding-left: 0;
}
.leave-app-form textarea {
    width: 100%;
    box-sizing: border-box;
}

/* Two dropdowns/fields shown side by side within one form-stack cell
   (e.g. the two Weekly Off day pickers). */
.dual-select {
    display: flex;
    gap: 8px;
    align-items: center;
}
.dual-select > .form-select,
.dual-select > select {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

/* Employee Record page: keep the side-by-side layout but let fields fill
   the available width of their cell. */
.emp-fullwidth .form-control,
.emp-fullwidth .form-select,
.emp-fullwidth .TextboxStyle,
.emp-fullwidth .empTextboxstyle,
.emp-fullwidth input[type="text"],
.emp-fullwidth input[type="password"],
.emp-fullwidth textarea,
.emp-fullwidth select {
    width: 100% !important;
    box-sizing: border-box;
}

/* Centred responsive form block (used where the form isn't a .form-stack
   table, e.g. Holiday Calendar with its date picker). */
.form-narrow {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    width: 100%;
}
@media (min-width: 768px) { .form-narrow { width: 50%; } }
@media (min-width: 992px) { .form-narrow { width: 33.333%; } }
.form-narrow .form-control,
.form-narrow .form-select,
.form-narrow .TextboxStyle,
.form-narrow .empTextboxstyle {
    display: block;
    width: 100% !important;
    max-width: 100%;
}

/* Modernise the legacy text inputs to a Bootstrap-like field
   (widths from the existing markup are preserved). */
.TextboxStyle,
.empTextboxstyle {
    border: 1px solid #ced4da !important;
    border-radius: .375rem !important;
    padding: .35rem .5rem !important;
    font-size: 1rem !important;
    box-sizing: border-box;
}
.TextboxStyle:focus,
.empTextboxstyle:focus {
    border-color: #00793A !important;
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(0, 121, 58, .2);
}

/* Remove the fixed 796px page-width restriction -> responsive full width.
   !important also overrides the inline width on the footer div. */
#pageHeader,
#pageContent,
#pageFooter {
    width: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}
/* main content wrapper uses Bootstrap .container: defeat the old fixed
   width (id rule) so the .container responsive max-width takes effect */
#colContainer {
    width: auto !important;
}
#pageContent {
    padding-left: 12px !important;
    padding-right: 12px !important;
    float: none !important;
}
/* keep the header logo centred (not tiled) when the bar is wider */
#pageHeader {
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* ============================================================
   Full-width container: span the viewport with comfortable
   space left and right (replaces the centred fixed .container).
   ============================================================ */
#colContainer.container-fluid {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: clamp(12px, 4vw, 56px) !important;
    padding-right: clamp(12px, 4vw, 56px) !important;
}

/* ============================================================
   Login screen: two-column hero — sign-in card (left) +
   compact feature cards (right). Brand green #00793A.
   ============================================================ */
.login-hero {
    margin-top: 8px;
    margin-bottom: 8px;
}
.login-progress {
    text-align: center;
    margin-bottom: 6px;
}

/* Sign-in / admin-verification card — modern, badge + icon inputs */
.login-card {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 .75rem 2rem rgba(0, 121, 58, .12) !important;
}
.login-card .card-body,
.login-body {
    padding: 1.9rem 1.7rem 1.7rem;
}
.login-badge {
    width: 62px;
    height: 62px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #00793A;
    color: #fff;
    font-size: 1.7rem;
    box-shadow: 0 .4rem .9rem rgba(0, 121, 58, .3);
}
.login-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #14352a;
    margin: 0 0 .15rem;
}
.login-subtitle {
    text-align: center;
    font-size: .9rem;
    color: #6b7b72;
    margin: 0 0 1.25rem;
}
/* icon-prefixed inputs */
.login-input {
    margin-bottom: 1rem;
}
.login-input .input-group-text {
    background: #f3f8f5;
    border: 1px solid #d7e3db;
    border-right: 0;
    color: #00793A;
    border-radius: .6rem 0 0 .6rem;
    padding-left: .85rem;
    padding-right: .55rem;
}
.login-input .form-control {
    border: 1px solid #d7e3db;
    border-left: 0;
    border-radius: 0 .6rem .6rem 0;
    padding: .6rem .75rem;
    font-size: .98rem;
    box-shadow: none !important;
}
.login-input:focus-within .input-group-text,
.login-input:focus-within .form-control {
    border-color: #00793A;
}
/* password field sits between the lock icon and the eye toggle */
.login-input .form-control:not(:last-child) {
    border-radius: 0;
    border-right: 0;
}
.login-input .login-eye {
    border-left: 0;
    border-right: 1px solid #d7e3db;
    border-radius: 0 .6rem .6rem 0;
    color: #6b7b72;
    cursor: pointer;
    padding-left: .55rem;
    padding-right: .85rem;
}
.login-input .login-eye:hover {
    color: #00793A;
}
.login-msg {
    color: #dc3545;
    font-size: .85rem;
    min-height: 1.1rem;
    margin-bottom: .5rem;
    text-align: center;
}
.login-btn {
    background-color: #00793A !important;
    color: #fff !important;
    font-weight: 600;
    border: 0;
    padding: .65rem;
    border-radius: .65rem;
    font-size: 1rem;
    margin: .2rem 0 0 !important;
}
.login-btn:hover,
.login-btn:focus {
    background-color: #006030 !important;
    color: #fff !important;
}

/* Compact (low-height) feature cards */
.feature-card {
    border: 1px solid #e3efe8 !important;
    border-radius: .6rem;
    transition: transform .15s ease, box-shadow .15s ease;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0, 121, 58, .15) !important;
}
.feature-card .card-body {
    padding: .8rem .9rem;
}
.feature-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(0, 121, 58, .1);
    color: #00793A;
    font-size: 1.2rem;
    margin-bottom: .45rem;
}
.feature-title {
    font-weight: 600;
    color: #00793A;
    font-size: .98rem;
    line-height: 1.2;
}
.feature-text {
    color: #5b6b62;
    font-size: .8rem;
    line-height: 1.25;
    margin-top: .15rem;
}

/* ============================================================
   Top banner: IMI Bhubaneswar logo + Campus ERP / Leave Module.
   Replaces the fixed 801x184 raster banner with a responsive
   HTML bar that works on every screen size.
   ============================================================ */
#pageHeader {
    background-image: none !important;
    height: auto !important;
    background-color: #ffffff;
    border-bottom: 3px solid #00793A;
}
.imi-banner {
    display: flex;
    align-items: center;
    gap: clamp(12px, 2.5vw, 22px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px clamp(12px, 4vw, 48px);
}
.imi-banner-logo {
    height: 64px;
    width: auto;
    flex: 0 0 auto;
}
.imi-banner-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: clamp(12px, 2.5vw, 22px);
    border-left: 3px solid #00793A;
    line-height: 1.15;
}
.imi-banner-title {
    font-size: clamp(1.35rem, 3.5vw, 2rem);
    font-weight: 700;
    color: #00793A;
    letter-spacing: .5px;
}
.imi-banner-sub {
    font-size: clamp(.8rem, 2.4vw, 1rem);
    font-weight: 600;
    color: #5b6b62;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}
@media (max-width: 575.98px) {
    .imi-banner-logo { height: 46px; }
    .imi-banner-title { letter-spacing: .3px; }
    .imi-banner-sub { letter-spacing: 1.5px; }
}

/* ============================================================
   Login security UI: CAPTCHA image + admin TOTP / enrolment.
   ============================================================ */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.captcha-img {
    border: 1px solid #cdd8d1;
    border-radius: .375rem;
}
.otp-help {
    font-size: .82rem;
    color: #5b6b62;
    margin: .25rem 0 .6rem;
    line-height: 1.35;
}
.otp-secret {
    font-family: Consolas, "Courier New", monospace;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #00793A;
    background: #eef5f0;
    border: 1px dashed #00793A;
    border-radius: .375rem;
    padding: .5rem .7rem;
    text-align: center;
    word-break: break-all;
    margin-bottom: .55rem;
}
.otp-uri {
    word-break: break-all;
    font-size: .72rem;
}
.otp-cancel {
    display: inline-block;
    margin-top: .6rem;
    font-size: .85rem;
    color: #5b6b62;
    text-decoration: none;
}
.otp-cancel:hover { color: #00793A; }
.otp-qr-wrap {
    text-align: center;
    margin-bottom: .55rem;
}
.otp-qr {
    width: 180px;
    height: 180px;
    border: 1px solid #e3efe8;
    border-radius: .375rem;
    padding: 4px;
    background: #fff;
}
