:root {
  --comac-primary: #0b7164;
  --comac-primary-dark: #12534d;
  --comac-primary-soft: #e7f4f1;
  --comac-accent: #e67e45;
  --comac-bg: #f3f6f5;
  --comac-surface: #ffffff;
  --comac-border: #dce6e3;
  --comac-text: #243330;
  --comac-muted: #6b7d79;
  --comac-danger: #c94747;
  --comac-radius: 14px;
  --comac-shadow: 0 10px 30px rgba(24, 72, 65, .08);
}

html { scroll-behavior: smooth; }

body.g-sidenav-show {
  background: var(--comac-bg) !important;
  color: var(--comac-text);
  font-size: .94rem;
}

a { transition: color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease; }

.sidenav {
  width: 272px;
  height: calc(100vh - 24px);
  margin: 12px 0 12px 12px !important;
  border: 1px solid var(--comac-border) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, .97) !important;
  box-shadow: var(--comac-shadow) !important;
  overflow: hidden;
}

.sidenav-header { height: auto; padding: 20px 19px 15px; }

.comac-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.comac-brand img { width: 155px; height: auto; max-height: 58px; object-fit: contain; object-position: left center; }
.comac-brand span { color: var(--comac-muted); font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.sidenav .navbar-collapse { height: calc(100vh - 192px) !important; padding: 0 10px 20px; overflow-y: auto; }
.sidenav .navbar-nav { width: 100%; }
.comac-menu-label { margin: 19px 12px 6px; color: #8a9996; font-size: .64rem; font-weight: 800; letter-spacing: .11em; list-style: none; text-transform: uppercase; }
.comac-menu-label:first-child { margin-top: 5px; }

.sidenav .navbar-nav .nav-link {
  min-height: 43px;
  margin: 2px 0;
  padding: 8px 10px;
  border-radius: 10px;
  color: #4c5f5b;
  font-weight: 600;
  white-space: normal;
}

.sidenav .navbar-nav .nav-link:hover { color: var(--comac-primary-dark); background: var(--comac-primary-soft); transform: translateX(2px); }
.sidenav .navbar-nav .nav-link.active {
  position: relative;
  color: #fff !important;
  background: #075b50 !important;
  box-shadow: 0 8px 18px rgba(7, 91, 80, .3) !important;
  transform: translateX(2px);
}
.sidenav .navbar-nav .nav-link.active::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: -7px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--comac-accent);
  box-shadow: 0 0 0 2px rgba(230, 126, 69, .16);
}
.comac-menu-icon { width: 30px; height: 30px; margin-right: 9px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px; border-radius: 9px; color: var(--comac-primary); background: var(--comac-primary-soft); font-size: .78rem; }
.sidenav .nav-link.active .comac-menu-icon { color: #fff !important; background: var(--comac-accent) !important; box-shadow: 0 4px 10px rgba(0, 0, 0, .16); }
.sidenav .nav-link.active .nav-link-text { color: #fff !important; font-weight: 800; }
.sidenav .nav-link-text { line-height: 1.2; }

.comac-sidebar-footer { padding: 13px 20px 16px; border-top: 1px solid var(--comac-border); display: flex; justify-content: space-between; align-items: center; color: var(--comac-primary-dark); }
.comac-sidebar-footer span { font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.comac-sidebar-footer small { color: var(--comac-muted); font-size: .67rem; }

.main-content { min-height: 100vh; }
.navbar-main { min-height: 72px; margin-top: 12px !important; border: 1px solid rgba(220, 230, 227, .88); background: rgba(255, 255, 255, .86) !important; box-shadow: 0 7px 22px rgba(24, 72, 65, .05) !important; backdrop-filter: blur(14px); }
.comac-page-context { display: flex; flex-direction: column; line-height: 1.15; }
.comac-page-eyebrow { color: var(--comac-primary); font-size: .65rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.comac-page-title { color: var(--comac-text); font-size: 1.02rem; }
.comac-user { align-items: center; gap: 10px; margin-right: 18px; padding-right: 18px; border-right: 1px solid var(--comac-border); }
.comac-user > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.comac-user strong { max-width: 170px; overflow: hidden; color: var(--comac-text); font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.comac-user small { color: var(--comac-muted); font-size: .67rem; }
.comac-user-avatar { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--comac-primary), var(--comac-primary-dark)); font-size: .77rem; font-weight: 800; }
.comac-logout { display: flex !important; align-items: center; gap: 7px; color: var(--comac-muted) !important; }
.comac-logout:hover { color: var(--comac-danger) !important; }

.container-fluid.py-4 { padding-top: 1.35rem !important; }
.card { border: 1px solid var(--comac-border) !important; border-radius: var(--comac-radius) !important; background: var(--comac-surface); box-shadow: var(--comac-shadow) !important; }
.card.mx-4 { margin-left: 0 !important; margin-right: 0 !important; }
.card-header { padding: 1.35rem 1.45rem; border-bottom: 1px solid var(--comac-border); background: transparent !important; }
.card-header h4, .card-header h5, .card-header h6 { color: var(--comac-text); font-weight: 750; letter-spacing: -.015em; }
.card-body { color: var(--comac-text); }

label, .form-label { margin-bottom: .42rem; color: #40534f; font-size: .76rem; font-weight: 700; }
.form-control, .form-select, select.form-control {
  min-height: 43px;
  padding: .65rem .8rem;
  border: 1px solid #cad8d4 !important;
  border-radius: 9px !important;
  color: var(--comac-text);
  background-color: #fff;
  box-shadow: none !important;
}
.form-control:focus, .form-select:focus, select.form-control:focus { border-color: var(--comac-primary) !important; box-shadow: 0 0 0 3px rgba(11, 113, 100, .12) !important; }
textarea.form-control { min-height: 110px; }

.btn { border-radius: 9px; font-weight: 700; letter-spacing: 0; box-shadow: none; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(36, 51, 48, .12); }
.btn.bg-gradient-dark, .btn.btn-dark { border-color: var(--comac-primary) !important; background: linear-gradient(135deg, var(--comac-primary), var(--comac-primary-dark)) !important; }
.btn.btn-info { border-color: #dceeea; color: var(--comac-primary-dark); background: #dceeea; }
.btn.btn-warning { border-color: #f7e4c8; color: #7e5319; background: #f7e4c8; }
.btn.btn-danger { border-color: #f8dddd; color: #a53737; background: #f8dddd; }
.btn.btn-success { border-color: var(--comac-primary); background: var(--comac-primary); }

.table-responsive { border: 1px solid var(--comac-border); border-radius: 12px; background: #fff; }
.table { color: var(--comac-text); }
.table thead tr, .table thead tr[style] { background: #edf4f2 !important; }
.table thead th { padding: .86rem .7rem !important; border-bottom: 1px solid var(--comac-border) !important; color: #58706a !important; font-size: .66rem !important; letter-spacing: .055em; white-space: nowrap; }
.table tbody tr, .table tbody tr[style] { background-color: #fff !important; }
.table tbody tr:nth-child(even), .table tbody tr:nth-child(even)[style] { background-color: #f8faf9 !important; }
.table tbody tr:hover, .table tbody tr[style]:hover { background-color: #eef7f4 !important; }
.table tbody td { padding: .78rem .7rem !important; border-bottom: 1px solid #edf1f0; vertical-align: middle; }
.table tbody td > img { width: 48px; height: 48px !important; border-radius: 10px; object-fit: cover; }
.table td .btn { margin: .18rem !important; padding: .47rem .68rem; font-size: .68rem; white-space: nowrap; }

.pagination { gap: 4px; }
.page-link { min-width: 35px; height: 35px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--comac-border); border-radius: 8px !important; color: var(--comac-primary); }
.page-item.active .page-link { border-color: var(--comac-primary); background: var(--comac-primary); }
.alert { border: 0; border-radius: 11px; }

body > .position-fixed.bg-success { z-index: 1100; top: 20px; right: 20px; max-width: 420px; color: #fff; box-shadow: var(--comac-shadow); }

.comac-login {
  position: relative;
  min-height: 100vh;
  padding: 34px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #edf3f1;
}
.comac-login-decoration { position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; }
.comac-login-decoration-one { width: 430px; height: 430px; top: -210px; right: -80px; background: rgba(11, 113, 100, .12); }
.comac-login-decoration-two { width: 330px; height: 330px; bottom: -180px; left: -110px; background: rgba(230, 126, 69, .12); }
.comac-login-container { position: relative; z-index: 1; max-width: 1180px; padding: 0; }
.comac-login-shell { min-height: 680px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .8); border-radius: 24px; background: #fff; box-shadow: 0 28px 70px rgba(24, 72, 65, .18); }
.comac-login-brand {
  position: relative;
  padding: 64px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #075b50 0%, #0c7668 58%, #164d48 100%);
}
.comac-login-brand::before { content: ""; position: absolute; width: 380px; height: 380px; top: -150px; right: -145px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255, 255, 255, .035), 0 0 0 110px rgba(255, 255, 255, .025); }
.comac-login-brand::after { content: ""; position: absolute; width: 190px; height: 190px; bottom: 55px; left: -95px; border-radius: 50%; background: rgba(230, 126, 69, .2); }
.comac-login-brand-content, .comac-login-brand-footer { position: relative; z-index: 1; }
.comac-login-logo { width: 190px; padding: 15px 18px; border-radius: 14px; background: rgba(255, 255, 255, .96); box-shadow: 0 10px 25px rgba(0, 0, 0, .12); }
.comac-login-tag { margin-top: 52px; display: block; color: #b8e1da; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.comac-login-brand h1 { max-width: 480px; margin: 14px 0 20px; color: #fff; font-size: clamp(2rem, 3vw, 3.1rem); font-weight: 750; line-height: 1.08; letter-spacing: -.035em; }
.comac-login-brand p { max-width: 470px; margin: 0; color: rgba(255, 255, 255, .78); font-size: 1rem; line-height: 1.7; }
.comac-login-features { margin-top: 35px; display: flex; flex-wrap: wrap; gap: 10px; }
.comac-login-features span { padding: 9px 12px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 9px; color: #fff; background: rgba(255, 255, 255, .08); font-size: .74rem; font-weight: 700; }
.comac-login-features i { color: #f2a377; }
.comac-login-brand-footer { display: flex; justify-content: space-between; align-items: center; color: rgba(255, 255, 255, .68); }
.comac-login-brand-footer small { font-size: .7rem; }
.comac-login-status { display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700; }
.comac-login-status i { width: 8px; height: 8px; border: 2px solid rgba(255, 255, 255, .45); border-radius: 50%; background: #83dfb5; box-shadow: 0 0 0 4px rgba(131, 223, 181, .12); }

.comac-login-access { padding: 60px 8%; display: flex; align-items: center; justify-content: center; background: #fff; }
.comac-login-form-wrap { width: 100%; max-width: 410px; }
.comac-login-mobile-logo { width: 150px; margin-bottom: 30px; display: none; }
.comac-login-eyebrow { color: var(--comac-primary); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.comac-login-form-wrap h2 { margin: 9px 0 8px; color: var(--comac-text); font-size: 2rem; font-weight: 750; letter-spacing: -.03em; }
.comac-login-subtitle { margin-bottom: 31px; color: var(--comac-muted); font-size: .88rem; }
.comac-login-form label { margin-bottom: 7px; color: #344944; }
.comac-login-field { position: relative; }
.comac-login-field > i { position: absolute; z-index: 2; top: 50%; left: 15px; color: #78908a; font-size: .82rem; transform: translateY(-50%); pointer-events: none; }
.comac-login-field .form-control { height: 48px; padding-left: 43px; border-color: #cddbd7 !important; background-color: #fbfcfc; }
.comac-login-field select.form-control { cursor: pointer; }
.comac-login-field .form-control:focus { background: #fff; }
.comac-password-toggle { position: absolute; z-index: 3; top: 50%; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 8px; color: #6f837e; background: transparent; transform: translateY(-50%); }
.comac-password-toggle:hover, .comac-password-toggle:focus { color: var(--comac-primary); background: var(--comac-primary-soft); outline: 0; }
.comac-login-field input[type="password"], .comac-login-field input[type="text"]#password { padding-right: 48px; }
.comac-forgot-link { margin-bottom: 7px; color: var(--comac-primary); font-size: .72rem; font-weight: 700; }
.comac-forgot-link:hover { color: var(--comac-primary-dark); text-decoration: underline; }
.comac-login-error { margin: 7px 0 0; display: flex; align-items: center; gap: 5px; color: var(--comac-danger); font-size: .7rem; font-weight: 650; }
.comac-login-submit { height: 49px; margin-top: 27px; display: flex; align-items: center; justify-content: center; gap: 12px; border: 0; color: #fff !important; background: linear-gradient(135deg, var(--comac-primary), var(--comac-primary-dark)); box-shadow: 0 10px 22px rgba(11, 113, 100, .22); }
.comac-login-submit:hover { background: linear-gradient(135deg, #09695d, #0d4943); box-shadow: 0 12px 25px rgba(11, 113, 100, .3); }
.comac-login-submit:disabled { opacity: .72; cursor: wait; transform: none; }
.comac-login-help { margin: 25px 0 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: #81918e; font-size: .69rem; }
.comac-login-help i { color: var(--comac-primary); }

@media (min-width: 1200px) {
  .g-sidenav-show .main-content { margin-left: 17.75rem; }
}

@media (max-width: 1199.98px) {
  .sidenav { margin: 0 !important; height: 100vh; border-radius: 0 !important; }
  .navbar-main { margin-left: 12px !important; margin-right: 12px !important; }
}

@media (max-width: 991.98px) {
  .comac-login { padding: 24px; }
  .comac-login-shell { max-width: 620px; min-height: 0; margin: 0 auto; }
  .comac-login-brand { display: none; }
  .comac-login-access { min-height: 680px; padding: 55px 12%; }
  .comac-login-mobile-logo { display: block; }
}

@media (max-width: 767.98px) {
  .navbar-main { min-height: 62px; }
  .comac-page-title { font-size: .88rem; }
  .container-fluid.py-4 { padding: 1rem !important; }
  .card-header, .card-body { padding-left: 1rem !important; padding-right: 1rem !important; }
  .card-header .d-flex { gap: 10px; align-items: flex-start; flex-wrap: wrap; }
  .table-responsive { border-radius: 9px; }
  .btn { white-space: normal; }
  .comac-login { padding: 0; align-items: stretch; background: #fff; }
  .comac-login-container { max-width: none; }
  .comac-login-shell { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .comac-login-access { min-height: 100vh; padding: 42px 25px; align-items: center; }
  .comac-login-mobile-logo { width: 140px; margin-bottom: 38px; }
  .comac-login-form-wrap h2 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
