/* AMC admin: charcoal navigation and muted green accents.
 * Include after style.css and helper.css to enable; omit to use the original theme.
 * Additive screen-only overrides. Do not alter vendor CSS or JS state hooks.
 * Print and no-layout views deliberately retain their original presentation.
 */
@media screen {
  body {
    --amc-ink: #242c29;
    --amc-muted: #66716b;
    --amc-accent: #227565;
    --amc-accent-hover: #185b4e;
    --amc-border: #dde3de;
    --amc-canvas: #f5f5f1;
    background: var(--amc-canvas);
    color: var(--amc-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", sans-serif;
  }
  body .pcoded-content { background: var(--amc-canvas); }
  body .header-navbar {
    background: #fff !important;
    color: var(--amc-ink) !important;
    box-shadow: 0 1px 0 var(--amc-border);
  }
  body .header-navbar .navbar-logo {
    background: #252826 !important;
    color: #f4f6f4 !important;
  }
  body .header-navbar .navbar-logo a { color: #f4f6f4 !important; }
  body .header-navbar .navbar-container .nav-right > li,
  body .header-navbar .navbar-container .nav-right > li > a,
  body .header-navbar .navbar-container .user-profile { color: var(--amc-ink) !important; }
  body .header-navbar .nav-left .label {
    border-radius: 5px;
    font-weight: 600;
    border: 1px solid var(--amc-accent);
    box-shadow: none;
  }
  body .header-navbar .nav-left .label-primary {
    background: var(--amc-accent); color: #fff !important;
  }
  /* This header label is a sync link, not a destructive action. */
  body .header-navbar .nav-left .label-danger {
    background: #fff; color: var(--amc-ink) !important; border-color: #aebbb3;
  }
  body .header-navbar .nav-left .label:hover { filter: brightness(.95); }
  body #pcoded .pcoded-navbar,
  body #pcoded .pcoded-navbar .main-menu,
  body #pcoded .pcoded-navbar .pcoded-submenu {
    background: #252826 !important;
    box-shadow: none;
  }
  body #pcoded .pcoded-navbar .pcoded-item li > a {
    color: #e3e9e5 !important;
    background: transparent !important;
    border-color: transparent !important;
  }
  body #pcoded .pcoded-navbar .pcoded-item li > a .pcoded-micon,
  body #pcoded .pcoded-navbar .pcoded-item li > a .pcoded-micon i,
  body #pcoded .pcoded-navbar .pcoded-item li > a:after {
    color: #b9c7be !important;
    background: transparent !important;
  }
  body #pcoded .pcoded-navbar .pcoded-item li > a:hover,
  body #pcoded .pcoded-navbar .pcoded-item li > a:focus-visible {
    background: #343e37 !important; color: #fff !important;
  }
  body #pcoded .pcoded-navbar .pcoded-item li.active > a {
    background: #235e4b !important;
    color: #fff !important;
    box-shadow: inset 3px 0 #a8d6be;
  }
  body #pcoded .pcoded-navbar .pcoded-item li.active > a .pcoded-micon i { color: #fff !important; }
  /* Menu labels have explicit colors in the original light navigation theme.
     Set the child labels as well as anchors, including collapsed flyouts. */
  body #pcoded .pcoded-navbar .pcoded-item li > a .pcoded-mtext {
    color: inherit !important;
  }
  body #pcoded .pcoded-navbar .pcoded-item li.active > a:hover,
  body #pcoded .pcoded-navbar .pcoded-item li.active > a:focus-visible {
    background: #235e4b !important;
    color: #fff !important;
  }
  body #pcoded .pcoded-navbar .pcoded-item li > a .pcoded-mtext:before,
  body #pcoded .pcoded-navbar .pcoded-item li > a .pcoded-mtext:after {
    border-color: currentColor !important;
  }
  body #pcoded .header-navbar .navbar-container .nav-left a.label-primary,
  body #pcoded .header-navbar .navbar-container .nav-left a.label-primary i {
    color: #fff !important;
  }
  body #pcoded .header-navbar .navbar-container .nav-left a.label-danger,
  body #pcoded .header-navbar .navbar-container .nav-left a.label-danger i {
    color: #242c29 !important;
  }
  body .page-header h4 { color: var(--amc-ink); font-weight: 600; }
  body .card {
    border: 1px solid var(--amc-border);
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(29,43,34,.025);
  }
  body .card .card-header { border-bottom-color: var(--amc-border); }
  body .search-filter,
  body .search-filter:hover {
    margin-bottom: 20px !important;
    border: 1px solid var(--amc-border);
    transition: none;
  }
  body .search-filter .accordion-title,
  body .search-filter .accordion-title:hover {
    background: #edf2ee !important;
    box-shadow: none;
    border-radius: 5px 5px 0 0;
  }
  body .search-filter .accordion-msg {
    color: #34463d !important;
    font-weight: 600;
    padding: 14px 18px;
  }
  body .btn { border-radius: 5px; box-shadow: none; }
  body .btn-primary {
    background: var(--amc-accent) !important;
    border-color: var(--amc-accent) !important;
    color: #fff !important;
  }
  body .btn-primary:hover,
  body .btn-primary:active { background: var(--amc-accent-hover) !important; border-color: var(--amc-accent-hover) !important; }
  body .btn-outline-primary { color: var(--amc-accent); border-color: var(--amc-accent); }
  body .btn-outline-primary:hover { color: #fff; background: var(--amc-accent); }
  body .dt-buttons .dt-button {
    background: #fff !important;
    border: 1px solid #acbbb1 !important;
    color: #1e6657 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  body .dt-buttons .dt-button:hover { background: #edf2ee !important; }
  body .table-header-dark > thead > tr > th,
  body .table > thead.thead-dark > tr > th {
    background: #34463d;
    color: #fff;
    border-color: #43564b;
  }
  body .g-datatable > tbody > tr > td { border-color: #e4e9e5; }
  body table.dataTable.compact > thead > tr > th,
  body table.dataTable.compact > tbody > tr > td { padding: 10px 12px; }
  /* Only neutral stripes: leave explicit attendance/status row colors alone. */
  body .table-striped > tbody > tr:nth-of-type(odd):not([class*="bg-"]):not([class*="table-"]):not([style]) { background-color: #f5f6f3; }
  body .table-hover > tbody > tr:hover:not([class*="bg-"]):not([class*="table-"]):not([style]) { background-color: #edf3ef; }
  body .form-control:not(.is-invalid):not(.is-valid),
  body .select2-container--default .select2-selection { border-color: #b8c4bc; border-radius: 5px; }
  body .form-control:focus { border-color: var(--amc-accent); box-shadow: 0 0 0 2px rgba(34,117,101,.15); }
  body .col-form-label { color: #435249; }
  body .select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--amc-accent); }
  body .page-item.active .page-link { background: var(--amc-accent); border-color: var(--amc-accent); color: #fff; }
  body .page-link { color: var(--amc-accent); }
  body .modal-content { border-radius: 7px; border-color: var(--amc-border); }
  body a:focus-visible,
  body button:focus-visible { outline: 2px solid var(--amc-accent); outline-offset: 2px; }
  /* Dashboard only. Reorder the existing two columns without changing markup. */
  body .top-box .card-block { border-top: 0; padding: 24px 20px; }
  body .top-box .card-block > .row { flex-wrap: nowrap; margin: 0; gap: 16px; }
  body .top-box .card-block .col-4 { order: -1; flex: 0 0 56px; max-width: 56px; padding: 0; }
  body .top-box .card-block .col-4 i {
    display: flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: 50%; background: #e6efe5; color: #227565;
  }
  body .top-box .card-block .col-8 {
    display: flex; flex-direction: column; flex: 1 1 auto; max-width: none; min-width: 0; padding: 0;
  }
  body .top-box h2 { color: var(--amc-ink); font-size: 30px; line-height: 1.25; overflow-wrap: anywhere; }
  body .top-box h6 { order: -1; color: var(--amc-muted) !important; font-size: 12px; font-weight: 600; text-transform: uppercase; margin: 0 0 6px !important; }
  body .top-box .card-footer { background: #fff; border-top: 1px solid var(--amc-border); padding: 14px 20px; border-radius: 0 0 6px 6px; }
  body .top-box .card-footer .text-white { color: #226552 !important; font-weight: 600; }
  body .top-box .card-footer .badge { background: #edf2ee; color: #226552; }
  @media (max-width: 575px) {
    body .top-box .card-block { padding: 16px 10px; }
    body .top-box .card-block > .row { gap: 8px; }
    body .top-box .card-block .col-4 { flex-basis: 32px; max-width: 32px; }
    body .top-box .card-block .col-4 i { width: 32px; height: 32px; font-size: 20px; }
    body .top-box h2 { font-size: 24px; }
    body .top-box h6 { font-size: 10px; }
    body .top-box .card-footer { padding: 12px 10px; }
  }
}

/* Authentication pages share the same optional theme as the admin portal. */
@media screen {
  body.fix-menu .login-block {
    background: #252826 !important;
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    padding: 40px 16px;
    display: flex;
    align-items: center;
  }
  body.fix-menu .login-block > .container-fluid { width: 100%; padding: 0; }
  body.fix-menu .login-block .md-float-material {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }
  body.fix-menu .login-block .auth-box.card {
    width: 100%;
    max-width: none;
    margin: 0;
    background: #fff;
    border: 1px solid #dce4de;
    border-top: 4px solid #227565;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,.18);
  }
  body.fix-menu .login-block .auth-box .card-block { padding: 32px; }
  body.fix-menu .login-block .auth-box h3 {
    color: #242c29;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
  }
  body.fix-menu .login-block .text-muted { color: #66716b !important; }
  body.fix-menu .login-block .form-group { margin-bottom: 16px; }
  body.fix-menu .login-block .form-control {
    height: 46px;
    padding: 10px 13px;
    background: #fafbf9;
    color: #242c29;
    border: 1px solid #b8c4bc;
    border-radius: 5px;
  }
  body.fix-menu .login-block .form-control:focus {
    background: #fff;
    border-color: #227565;
    box-shadow: 0 0 0 3px rgba(34,117,101,.15);
  }
  body.fix-menu .login-block .form-primary .form-bar:before,
  body.fix-menu .login-block .form-primary .form-bar:after { background: #227565; }
  body.fix-menu .login-block .btn-primary {
    min-height: 46px;
    font-weight: 600;
    letter-spacing: .025em;
  }
  body.fix-menu .login-block a.text-underline {
    display: inline-block;
    color: #1e6657 !important;
    padding: 5px 8px;
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  body.fix-menu .login-block a.text-underline:hover { color: #164c40 !important; }
  body.fix-menu .login-block .auth-box { overflow-wrap: anywhere; }
  @media (max-width: 575px) {
    body.fix-menu .login-block { padding: 24px 12px; }
    body.fix-menu .login-block .auth-box .card-block { padding: 24px 20px; }
    body.fix-menu .login-block .auth-box h3 { font-size: 23px; }
  }
}