:root{
  --m-navy:#0A1729; --m-brand:#0EA5E9; --m-brand-600:#0284C7; --m-brand-100:#e0f2fe;
  --m-sky:#38BDF8;
}

/* ════════════ LOGIN PAGE (branded card) ════════════ */
body.login{
  background:radial-gradient(1200px 600px at 50% -10%, #123 0%, transparent 60%),
             linear-gradient(135deg, var(--m-navy) 0%, var(--m-brand-600) 140%);
  min-height:100vh;
}
body.login #container{
  background:#fff; border:none; border-radius:16px;
  box-shadow:0 24px 70px rgba(0,0,0,.45); overflow:hidden;
  width:430px; margin-top:7vh;
}
body.login #header{ height:auto; padding:30px 0 22px; background:var(--m-navy); text-align:center; line-height:1; }
body.login #header #branding{ float:none; display:inline-block; }
body.login .mng-brand{ flex-direction:column; gap:.5rem; display:inline-flex; align-items:center; }
body.login .mng-logo{ height:46px; }
body.login .mng-sub{ border-left:none; padding-left:0; color:var(--m-brand); }
body.login #content{ padding:26px 34px 32px; }
body.login .submit-row{ padding:14px 0 0; }
body.login .submit-row input{ width:100%; padding:11px; font-weight:600; border-radius:8px; background:var(--m-brand); }
body.login input[type=text], body.login input[type=password]{
  width:100%; box-sizing:border-box; padding:10px 12px; border-radius:8px; border:1px solid #cbd5e1;
}
body.login .form-row{ padding:8px 0; border:none; }

/* ════════════ BLUE LEFT SIDEBAR (monytr brand) ════════════ */
#toggle-nav-sidebar{ display:none !important; }

#nav-sidebar{
  width:240px !important;
  background:linear-gradient(180deg, #0A1729 0%, #0c2c52 55%, #0d3a68 100%) !important;
  color:#cdd9ec !important;
  border:none !important; box-shadow:inset -1px 0 0 rgba(56,189,248,.12) !important;
  display:flex !important; flex-direction:column !important;
  overflow:hidden !important; padding:0 !important; margin:0 !important;
}
@media (min-width:1024px){
  body:not(.login){ padding-left:240px; }
  #nav-sidebar{ position:fixed !important; top:0; left:0; height:100vh !important; z-index:1500; }
}
@media (max-width:1023px){
  #nav-sidebar{ position:static !important; width:100% !important; height:auto !important; }
}

/* brand */
#nav-sidebar .dash-brand{
  padding:16px 18px 14px; border-bottom:1px solid rgba(56,189,248,.14);
  display:flex; align-items:center; gap:12px; text-decoration:none; flex-shrink:0;
}
#nav-sidebar .sb-icon{
  width:46px; height:46px; background:rgba(14,165,233,.16); border:1px solid rgba(56,189,248,.35);
  border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
#nav-sidebar .brand-wordmark{ line-height:1.12; }
#nav-sidebar .brand-name{ font-size:1.28rem; font-weight:800; color:var(--m-sky); letter-spacing:-.02em; display:block; }
#nav-sidebar .brand-name .ai-part{ color:#fff; }
#nav-sidebar .brand-tagline{ font-size:.6rem; text-transform:uppercase; letter-spacing:.1em; color:#6f8db5; }

/* filter box */
#nav-sidebar #nav-filter{
  margin:12px 14px 4px; padding:7px 11px; border-radius:8px; border:1px solid rgba(56,189,248,.2);
  background:rgba(56,189,248,.07); color:#e8f2fc; font-size:.8rem; width:calc(100% - 28px); box-sizing:border-box;
}
#nav-sidebar #nav-filter::placeholder{ color:#6f8db5; }

/* scroll area */
#nav-sidebar .snav-scroll{ flex:1; overflow-y:auto; overflow-x:hidden; padding-bottom:18px; }

/* section headers */
#nav-sidebar .nav-section{
  padding:16px 18px 5px; font-size:.6rem; text-transform:uppercase; letter-spacing:.12em;
  color:#7da8d9; display:flex; align-items:center; gap:7px;
}
#nav-sidebar .nav-section i{ font-size:.8rem; opacity:.85; }

/* links */
#nav-sidebar a.nav-link{
  color:#aebfd6; padding:8px 18px 8px 26px; font-size:.845rem; text-decoration:none;
  display:flex; align-items:center; gap:10px; border-left:3px solid transparent;
  transition:background .15s, color .15s, border-color .15s;
}
#nav-sidebar a.nav-link i{ width:18px; text-align:center; font-size:.95rem; flex-shrink:0; color:#7da8d9; }
#nav-sidebar a.nav-link:hover{ background:rgba(56,189,248,.12); color:#fff; }
#nav-sidebar a.nav-link:hover i{ color:#bae6fd; }
#nav-sidebar a.nav-link.active{ background:rgba(56,189,248,.18); color:#fff; border-left-color:var(--m-sky); }
#nav-sidebar a.nav-link.active i{ color:#fff; }

/* ════════════ INNER-PAGE TOPBAR (slim, brand lives in sidebar) ════════════ */
body:not(.login) #header{
  background:#fff !important; color:#1e293b !important;
  box-shadow:0 1px 3px rgba(0,0,0,.06); border-bottom:1px solid #e9eef5;
}
body:not(.login) #header #site-name{ display:none; }
body:not(.login) #user-tools{ color:#64748b; }
body:not(.login) #user-tools a{ color:var(--m-brand-600); border-bottom-color:rgba(2,132,199,.3); }

/* breadcrumbs + links + buttons */
div.breadcrumbs{ background:var(--m-brand-600); color:#fff; }
div.breadcrumbs a{ color:#fff; }
a:link, a:visited{ color:var(--m-brand-600); }
.button, input[type=submit], input[type=button], .submit-row input, a.button{ background:var(--m-brand); color:#fff; }
.button:hover, input[type=submit]:hover, .submit-row input:hover, a.button:hover{ background:var(--m-brand-600); }
.module h2, .module caption, .inline-group h2{ background:var(--m-navy); }
.object-tools a:link, .object-tools a:visited{ background:var(--m-brand-600); }
.selector-chosen h2{ background:var(--m-brand); }

/* ════════════ LICENSE OVERVIEW (main page report) ════════════ */
.lic-dash{ max-width:none; width:100%; }
.lic-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:18px; }
.lic-title{ font-size:1.5rem; font-weight:800; color:var(--m-navy); margin:0; letter-spacing:-.02em; }
.lic-sub{ color:#64748b; font-size:.9rem; margin:.25rem 0 0; }
.lic-addbtn{
  background:var(--m-brand); color:#fff !important; text-decoration:none; font-weight:600; font-size:.85rem;
  padding:9px 16px; border-radius:9px; white-space:nowrap; display:inline-flex; align-items:center; gap:7px;
}
.lic-addbtn:hover{ background:var(--m-brand-600); }

/* stat cards */
.lic-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.lic-stat{ background:#fff; border:1px solid #e7edf5; border-radius:14px; padding:16px 18px; display:flex; align-items:center; gap:14px; box-shadow:0 1px 3px rgba(15,23,42,.04); }
.ls-ico{ width:46px; height:46px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.25rem; flex-shrink:0; }
.ls-ico.tot{ background:#e0f2fe; color:#0284C7; }
.ls-ico.ok{ background:#dcfce7; color:#16a34a; }
.ls-ico.warn{ background:#fef3c7; color:#d97706; }
.ls-ico.danger{ background:#fee2e2; color:#dc2626; }
.ls-num{ font-size:1.5rem; font-weight:800; color:var(--m-navy); line-height:1; }
.ls-lbl{ font-size:.74rem; color:#64748b; text-transform:uppercase; letter-spacing:.05em; margin-top:4px; }

/* table card */
.lic-card{ background:#fff; border:1px solid #e7edf5; border-radius:14px; box-shadow:0 1px 3px rgba(15,23,42,.04); overflow:hidden; }
.lic-card-head{ padding:14px 18px; font-weight:700; color:var(--m-navy); border-bottom:1px solid #eef2f7; display:flex; align-items:center; gap:8px; }
.lic-card-head i{ color:var(--m-brand-600); }
.lic-tablewrap{ overflow-x:auto; }
.lic-table{ width:100%; border-collapse:collapse; font-size:.86rem; }
.lic-table thead th{ text-align:left; padding:11px 16px; font-size:.68rem; text-transform:uppercase; letter-spacing:.06em; color:#94a3b8; background:#f8fafc; border-bottom:1px solid #eef2f7; font-weight:700; white-space:nowrap; }
.lic-table thead th.num, .lic-table td.num{ text-align:right; }
.lic-table tbody td{ padding:13px 16px; border-bottom:1px solid #f1f5f9; vertical-align:middle; }
.lic-table tbody tr:last-child td{ border-bottom:none; }
.lic-table tbody tr:hover{ background:#f8fbff; }
.lic-client{ font-weight:700; color:var(--m-navy) !important; text-decoration:none; }
.lic-client:hover{ color:var(--m-brand-600) !important; }
.lic-host{ font-size:.72rem; color:#94a3b8; margin-top:2px; }
.lic-dom{ font-family:ui-monospace,Menlo,monospace; font-size:.8rem; color:#475569; }
.lic-muted{ color:#94a3b8; }

/* tier badges */
.lic-tier{ display:inline-block; padding:3px 11px; border-radius:999px; font-size:.74rem; font-weight:700; border:1px solid transparent; }
.tier-platinum{ background:#eef2ff; color:#3730a3; border-color:#c7d2fe; }
.tier-gold{ background:#fef9c3; color:#a16207; border-color:#fde68a; }
.tier-silver{ background:#f1f5f9; color:#475569; border-color:#cbd5e1; }
.tier-bronze{ background:#fdf0e6; color:#9a3412; border-color:#fed7aa; }
.tier-none{ background:#f1f5f9; color:#94a3b8; }

/* status badges */
.lic-badge{ display:inline-block; padding:3px 10px; border-radius:999px; font-size:.74rem; font-weight:700; }
.b-ok{ background:#dcfce7; color:#15803d; }
.b-warn{ background:#fef3c7; color:#b45309; }
.b-danger{ background:#fee2e2; color:#b91c1c; }

/* renewal pill */
.lic-renew{ font-weight:600; font-size:.82rem; }
.rn-ok{ color:#16a34a; }
.rn-warn{ color:#d97706; }
.rn-danger{ color:#dc2626; }
.rn-muted{ color:#94a3b8; }

.lic-manage{ color:var(--m-brand-600) !important; text-decoration:none; font-weight:600; font-size:.8rem; white-space:nowrap; }
.lic-manage i{ font-size:.7rem; }
.lic-empty{ text-align:center; color:#94a3b8; padding:30px; }

@media (max-width:900px){ .lic-stats{ grid-template-columns:repeat(2,1fr); } }

/* the admin caps the dashboard page at 600px — let our report use the full width */
.dashboard #content{ width:auto !important; }
#content{ padding:24px 32px; }
#content-main.lic-dash{ width:100% !important; max-width:none !important; float:none !important; }

/* logout button — make it clearly visible on the white inner-page topbar */
body:not(.login) #user-tools #logout-form button,
body:not(.login) #user-tools button[type="submit"]{
  background:var(--m-brand-600) !important; color:#fff !important; border:none !important;
  padding:6px 14px !important; border-radius:7px !important; font-size:.8rem !important;
  font-weight:600 !important; cursor:pointer; line-height:1.2;
}
body:not(.login) #user-tools #logout-form button:hover,
body:not(.login) #user-tools button[type="submit"]:hover{ background:var(--m-brand) !important; }
body:not(.login) #user-tools{ display:flex; align-items:center; gap:12px; }

/* ════════════ INNER ADMIN PAGES — themed to match the report ════════════ */
/* page heading */
#content > h1, .colM #content h1{ font-size:1.45rem; font-weight:800; color:var(--m-navy); letter-spacing:-.02em; margin-bottom:16px; }
#content h2, #content h3{ color:var(--m-navy); }

/* object-tools (Add / History) → brand pills */
.object-tools a{ border-radius:8px !important; text-transform:none !important; letter-spacing:0 !important; font-weight:600 !important; padding:8px 15px !important; }
.object-tools a:link, .object-tools a:visited{ background:var(--m-brand-600) !important; color:#fff !important; }
.object-tools a:hover{ background:var(--m-brand) !important; }

/* modules → rounded white cards */
.module, fieldset.module, .inline-group, #changelist.module{
  background:#fff !important; border:1px solid #e7edf5 !important; border-radius:14px !important;
  box-shadow:0 1px 3px rgba(15,23,42,.04) !important; overflow:hidden; margin-bottom:18px;
}
.module > h2, .module caption, .inline-group h2, .inline-related h3{
  background:#f8fafc !important; color:var(--m-navy) !important; font-size:.85rem !important; font-weight:700 !important;
  padding:13px 18px !important; border-bottom:1px solid #eef2f7 !important; text-transform:none !important; letter-spacing:0 !important;
}

/* tables (changelist results + inlines) */
#result_list, .module table{ border-collapse:collapse; width:100%; }
#result_list thead th, .module table thead th, #changelist table thead th{
  background:#f8fafc !important; color:#94a3b8 !important; text-transform:uppercase !important;
  font-size:.68rem !important; letter-spacing:.06em !important; font-weight:700 !important;
  border-bottom:1px solid #eef2f7 !important; padding:11px 14px !important;
}
#result_list thead th a, #changelist table thead th a{ color:#64748b !important; }
#result_list tbody td, #result_list tbody th, .module table tbody td{ padding:11px 14px !important; border-bottom:1px solid #f1f5f9 !important; }
#result_list tbody tr:hover{ background:#f8fbff !important; }
#result_list tbody tr a:link, #result_list tbody tr a:visited{ color:var(--m-brand-600); font-weight:600; }

/* search toolbar */
#toolbar{ background:transparent; border:none; padding:0 0 14px; }
#toolbar form#changelist-search input[type="text"]{ border:1px solid #cbd5e1 !important; border-radius:8px !important; padding:8px 12px !important; min-width:280px; }
#toolbar input[type="submit"]{ border-radius:8px !important; background:var(--m-brand) !important; }

/* filter sidebar */
#changelist-filter{ background:#fff !important; border:1px solid #e7edf5 !important; border-radius:14px !important; box-shadow:0 1px 3px rgba(15,23,42,.04); }
#changelist-filter h2, #changelist-filter h3{ background:#f8fafc !important; color:var(--m-navy) !important; border-radius:14px 14px 0 0; }
#changelist-filter li.selected a{ color:var(--m-brand-600) !important; }

/* pagination */
.paginator{ border-top:1px solid #eef2f7; }
.paginator a:link, .paginator a:visited{ background:var(--m-brand-600) !important; color:#fff !important; border-radius:7px; padding:4px 10px; }
.paginator .this-page{ background:var(--m-navy) !important; color:#fff; border-radius:7px; padding:4px 10px; }

/* form fields */
input[type=text], input[type=password], input[type=email], input[type=url], input[type=number],
input[type=tel], textarea, select, .vTextField{
  border:1px solid #cbd5e1 !important; border-radius:8px !important; padding:7px 10px !important;
}
input:focus, textarea:focus, select:focus, .vTextField:focus{
  border-color:var(--m-brand) !important; outline:none !important; box-shadow:0 0 0 3px rgba(14,165,233,.15) !important;
}
.form-row{ border-bottom:1px solid #f1f5f9; }
.aligned label{ color:#334155; font-weight:600; }
.help, .helptext{ color:#94a3b8; }

/* submit row → brand buttons */
.submit-row{ background:transparent !important; border:none !important; padding:16px 0 !important; box-shadow:none !important; }
.submit-row input, .submit-row a{ border-radius:9px !important; font-weight:600 !important; padding:10px 20px !important; }
.submit-row input.default{ background:var(--m-brand) !important; }
.submit-row input.default:hover{ background:var(--m-brand-600) !important; }
.submit-row a.deletelink{ background:#fee2e2 !important; color:#b91c1c !important; }

/* generic buttons + links */
.button:not(.default), input[type=submit]:not(.default), a.button{ border-radius:8px !important; }
a:link, a:visited{ color:var(--m-brand-600); }

/* selector (m2m) boxes rounded */
.selector .selector-available, .selector .selector-chosen{ border-radius:10px; overflow:hidden; border:1px solid #e7edf5; }
.selector-available h2, .selector-chosen h2{ background:#f8fafc !important; color:var(--m-navy) !important; }
