:root{--bg:#07111f;--panel:#0d1b2f;--panel2:#12243d;--text:#eef6ff;--muted:#9fb4cc;--line:#24415f;--accent:#37b7ff;--good:#3ddc97;--warn:#ffbf47;--bad:#ff5d73;}
*{box-sizing:border-box} body{margin:0;font-family:Arial,Helvetica,sans-serif;background:radial-gradient(circle at top,#102a45,#06101d 58%);color:var(--text);min-height:100vh}.mdwa-topbar{display:flex;justify-content:space-between;align-items:center;padding:18px 28px;background:rgba(3,10,20,.92);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}.mdwa-topbar strong{display:block;font-size:20px}.mdwa-topbar span{display:block;color:var(--muted);font-size:13px;margin-top:3px}.mdwa-topbar nav{display:flex;gap:10px;flex-wrap:wrap}.mdwa-topbar a,.button{color:#03101f;background:linear-gradient(135deg,#5fd2ff,#1b8eea);text-decoration:none;border:0;border-radius:12px;padding:10px 14px;font-weight:700;cursor:pointer;display:inline-block}.button.ghost,.mdwa-topbar a:nth-last-child(1){background:transparent;color:var(--text);border:1px solid var(--line)}.button.danger{background:linear-gradient(135deg,#ff7b8a,#d7264d);color:#fff}.mdwa-shell{max-width:1180px;margin:0 auto;padding:28px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:18px}.card,.panel{background:rgba(13,27,47,.92);border:1px solid var(--line);border-radius:18px;padding:20px;box-shadow:0 14px 35px rgba(0,0,0,.22)}.card h2,.panel h2{margin-top:0}.muted{color:var(--muted)}.alert{padding:14px 16px;border-radius:14px;margin-bottom:18px;border:1px solid var(--line);background:#10243a}.alert.error{border-color:var(--bad);color:#ffd2d9}.alert.success{border-color:var(--good)}label{display:block;font-weight:700;margin:14px 0 6px}input,select,textarea{width:100%;padding:12px;border-radius:12px;border:1px solid var(--line);background:#071525;color:var(--text)}textarea{min-height:100px}table{width:100%;border-collapse:collapse;background:rgba(13,27,47,.8);border-radius:16px;overflow:hidden}th,td{padding:12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{color:#cdeaff;background:#10243a}.row-actions{display:flex;gap:8px;flex-wrap:wrap}.status{display:inline-block;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:700}.Completed{background:rgba(61,220,151,.18);color:#7dffc4}.InProgress{background:rgba(55,183,255,.18);color:#86dcff}.Planned{background:rgba(255,191,71,.18);color:#ffdc8a}.Hidden{background:rgba(255,93,115,.18);color:#ff9caa}.mdwa-footer{text-align:center;color:var(--muted);padding:25px}.login{max-width:460px;margin:8vh auto}.small{font-size:13px}.file-list{max-height:420px;overflow:auto;background:#071525;border:1px solid var(--line);border-radius:14px;padding:12px}.file-list code{display:block;color:#cdeaff;margin:4px 0}.split{display:grid;grid-template-columns:1fr 1fr;gap:20px}@media(max-width:760px){.mdwa-topbar{display:block}.mdwa-topbar nav{margin-top:12px}.split{grid-template-columns:1fr}}

/* Document Manager */
.doc-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px;margin-bottom:20px}
.doc-template{background:rgba(18,36,61,.92);border:1px solid var(--line);border-radius:18px;padding:18px}
.doc-template h3{margin-top:0}.doc-preview-actions{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0}.doc-paper{background:#fff;color:#07111f;border-radius:14px;padding:34px;box-shadow:0 20px 55px rgba(0,0,0,.35);max-width:900px;margin:0 auto}.doc-paper h1,.doc-paper h2,.doc-paper h3{color:#07111f}.doc-letterhead{border-bottom:3px solid #37b7ff;padding-bottom:18px;margin-bottom:24px;display:flex;align-items:center;gap:18px}.doc-logo-mark{width:64px;height:64px;border-radius:18px;background:linear-gradient(135deg,#072033,#24bfff);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;letter-spacing:1px}.doc-letterhead .brand{font-size:28px;font-weight:800}.doc-letterhead .sub{color:#39506a;margin-top:3px}.doc-table{width:100%;border-collapse:collapse;margin:18px 0}.doc-table th,.doc-table td{border:1px solid #cbd8e6;padding:10px;color:#07111f}.doc-table th{background:#eaf6ff}.doc-footer{border-top:1px solid #cbd8e6;margin-top:32px;padding-top:12px;color:#58708a;font-size:13px;text-align:center}.doc-note{background:#eef8ff;border-left:4px solid #37b7ff;padding:12px 14px;border-radius:10px;margin:16px 0}.inline-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px}@media print{body{background:#fff}.mdwa-topbar,.mdwa-footer,.doc-preview-actions,.alert{display:none}.mdwa-shell{max-width:none;padding:0}.doc-paper{box-shadow:none;border-radius:0;padding:0}.card,.panel{background:#fff;border:0;box-shadow:none;color:#000}}


/* MDW Admin Branding Polish */
.mdwa-brand{display:flex;align-items:center;gap:14px}
.mdwa-brand img{height:48px;width:auto;max-width:260px;object-fit:contain;display:block}
.mdwa-brand strong{font-size:21px}
@media(max-width:760px){.mdwa-brand img{height:40px}.mdwa-brand{align-items:flex-start}}

/* Shared document branding */
.doc-letterhead{justify-content:flex-start}
.doc-brand-logo{height:78px;width:auto;max-width:330px;object-fit:contain;display:block}
.doc-logo-mark{display:none}
.doc-table th{background:#eaf6ff;color:#07111f}
.doc-table tr:nth-child(even) td{background:#f7fbff}
.doc-table tr:nth-child(odd) td{background:#ffffff}

.update-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin:14px 0 18px}
.update-summary .metric{background:#071525;border:1px solid var(--line);border-radius:14px;padding:14px}
.update-summary .metric strong{display:block;font-size:28px;color:#fff}
.update-complete{border-color:var(--good);background:rgba(61,220,151,.09)}
.update-complete h2::before{content:"✓ ";color:var(--good)}


/* MDW Logo Cleanup v5 - use the same icon + text identity as the website */
.mdwa-brand{display:flex;align-items:center;gap:12px}
.mdwa-brand .mdwa-logo-icon{height:44px;width:44px;max-width:44px;border-radius:10px;object-fit:contain;display:block}
.mdwa-brand strong{font-size:21px;line-height:1.1}
.doc-letterhead{border-bottom:3px solid #37b7ff;padding-bottom:18px;margin-bottom:24px;display:flex;align-items:center;gap:16px}
.doc-brand-row{display:flex;align-items:center;gap:14px}
.doc-logo-icon{height:64px;width:64px;border-radius:14px;object-fit:contain;display:block}
.doc-brand-name{font-size:28px;line-height:1.1;font-weight:800;color:#07111f}
.doc-brand-sub{font-size:15px;color:#39506a;margin-top:4px}
.doc-brand-logo,.doc-logo-mark{display:none!important}
@media(max-width:760px){.mdwa-brand .mdwa-logo-icon{height:38px;width:38px}.doc-brand-name{font-size:22px}.doc-logo-icon{height:52px;width:52px}.doc-brand-sub{font-size:13px}}

/* MDW Admin v0.8.0 - Clients + document library polish */
.toolbar{display:grid;grid-template-columns:1fr 220px auto auto;gap:10px;align-items:end;margin:12px 0 18px}
.doc-template-grid.compact{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}.doc-category{display:inline-block;border:1px solid var(--line);background:rgba(55,183,255,.12);color:#bfeeff;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700;margin-bottom:8px}.doc-field-block{margin-bottom:14px}.doc-field-block h3{font-size:15px;margin-bottom:4px}.signature-grid{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:40px;border-top:1px solid #cbd8e6;padding-top:20px}.status.Lead{background:rgba(55,183,255,.18);color:#86dcff}.status.Quoted{background:rgba(255,191,71,.18);color:#ffdc8a}.status.Active{background:rgba(61,220,151,.18);color:#7dffc4}.status.Completed{background:rgba(61,220,151,.18);color:#7dffc4}.status.OnHold{background:rgba(255,93,115,.18);color:#ff9caa}.status.Draft{background:rgba(159,180,204,.18);color:#d7e6f7}.status.Ready{background:rgba(55,183,255,.18);color:#86dcff}.status.Sent{background:rgba(255,191,71,.18);color:#ffdc8a}.status.Signed{background:rgba(61,220,151,.18);color:#7dffc4}.status.Paid{background:rgba(61,220,151,.18);color:#7dffc4}.status.Archived{background:rgba(159,180,204,.18);color:#d7e6f7}@media(max-width:850px){.toolbar{grid-template-columns:1fr}.signature-grid{grid-template-columns:1fr}}

/* MDW Admin v0.9.0 - responsive sidebar + flyout navigation */
body{overflow-x:hidden}
.mdwa-topbar{display:none!important}
.mdwa-mobilebar{display:none}
.mdwa-layout{display:grid;grid-template-columns:270px minmax(0,1fr);min-height:100vh}
.mdwa-sidebar{position:sticky;top:0;align-self:start;height:100vh;overflow-y:auto;background:rgba(3,10,20,.94);border-right:1px solid var(--line);padding:18px 14px;z-index:20;box-shadow:12px 0 35px rgba(0,0,0,.18)}
.mdwa-sidebar .mdwa-brand{padding:6px 8px 20px;margin-bottom:10px;border-bottom:1px solid var(--line)}
.mdwa-nav{display:flex;flex-direction:column;gap:8px}
.mdwa-nav a,.mdwa-nav summary{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;color:var(--text);background:transparent;border:1px solid transparent;border-radius:13px;text-decoration:none;padding:11px 12px;font-weight:700;cursor:pointer;list-style:none}
.mdwa-nav summary::-webkit-details-marker{display:none}.mdwa-nav summary::after{content:'›';font-size:20px;line-height:1;opacity:.7;transition:transform .18s ease}.mdwa-nav-flyout[open] summary::after{transform:rotate(90deg)}
.mdwa-nav a:hover,.mdwa-nav summary:hover,.mdwa-nav a.active,.mdwa-nav summary.active{background:linear-gradient(135deg,rgba(95,210,255,.18),rgba(27,142,234,.12));border-color:rgba(95,210,255,.35);color:#fff}
.mdwa-nav a.logout{margin-top:12px;border-color:rgba(255,93,115,.35);color:#ffd2d9}.mdwa-nav a.logout:hover{background:rgba(255,93,115,.14)}
.mdwa-nav-flyout{position:relative}.mdwa-flyout-panel{display:flex;flex-direction:column;gap:6px;margin:6px 0 4px 10px;padding-left:10px;border-left:1px solid var(--line)}
.mdwa-flyout-panel a{font-size:14px;padding:9px 10px;color:#cdeaff}.mdwa-content{min-width:0}.mdwa-shell{max-width:1220px;margin:0 auto;padding:28px}.mdwa-footer{border-top:1px solid rgba(36,65,95,.5);margin-top:20px}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}table{min-width:680px}.card,.panel{min-width:0}.row-actions .button{white-space:nowrap}.button{line-height:1.15}.toolbar{align-items:stretch}.toolbar .button{display:flex;align-items:center;justify-content:center;text-align:center}

@media(min-width:901px){
  .mdwa-nav-flyout:not([open]):hover .mdwa-flyout-panel{display:flex;position:absolute;left:calc(100% + 8px);top:0;min-width:220px;margin:0;padding:10px;border:1px solid var(--line);border-radius:16px;background:rgba(7,17,31,.98);box-shadow:0 18px 45px rgba(0,0,0,.35)}
  .mdwa-nav-flyout:not([open]) .mdwa-flyout-panel{display:none}
}

@media(max-width:1100px){
  .mdwa-layout{grid-template-columns:238px minmax(0,1fr)}
  .mdwa-sidebar{padding:14px 10px}.mdwa-shell{padding:22px}.mdwa-brand strong{font-size:18px}
}

@media(max-width:900px){
  .mdwa-mobilebar{display:flex;align-items:center;gap:12px;justify-content:space-between;position:sticky;top:0;z-index:35;background:rgba(3,10,20,.96);border-bottom:1px solid var(--line);padding:12px 14px;box-shadow:0 10px 26px rgba(0,0,0,.18)}
  .mdwa-mobile-title{min-width:0;flex:1}.mdwa-mobile-title strong{display:block;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mdwa-mobile-title span{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .mdwa-menu-toggle{width:42px;height:42px;border-radius:12px;border:1px solid var(--line);background:linear-gradient(135deg,#12243d,#071525);color:#fff;font-size:22px;font-weight:800;cursor:pointer}
  .mdwa-view-site{color:#03101f;background:linear-gradient(135deg,#5fd2ff,#1b8eea);text-decoration:none;border-radius:11px;padding:10px 11px;font-weight:800;font-size:12px;white-space:nowrap}
  .mdwa-layout{display:block;min-height:0}.mdwa-sidebar{position:fixed;left:0;top:0;bottom:0;width:min(82vw,320px);height:100vh;transform:translateX(-105%);transition:transform .22s ease;z-index:50;padding-top:20px}.mdwa-menu-open .mdwa-sidebar{transform:translateX(0)}
  .mdwa-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.55);backdrop-filter:blur(2px);z-index:45}.mdwa-menu-open .mdwa-overlay{display:block}
  .mdwa-sidebar .mdwa-brand{padding-right:34px}.mdwa-shell{padding:18px 14px;max-width:none}.mdwa-footer{padding:18px 12px;font-size:12px}
  .grid,.doc-template-grid,.doc-template-grid.compact{grid-template-columns:1fr}.split{grid-template-columns:1fr}.toolbar{grid-template-columns:1fr!important;gap:8px}.inline-fields{grid-template-columns:1fr}.signature-grid{grid-template-columns:1fr;gap:18px}
  .card,.panel{padding:16px;border-radius:16px}th,td{padding:10px}.row-actions{gap:6px}.row-actions .button{flex:1 1 auto;text-align:center}.doc-paper{padding:20px;border-radius:12px}.doc-letterhead{align-items:flex-start}.doc-brand-name{font-size:21px}.doc-logo-icon{height:48px;width:48px}
}

@media(max-width:480px){
  .mdwa-mobilebar{padding:10px}.mdwa-view-site{display:none}.mdwa-shell{padding:14px 10px}.button,.mdwa-topbar a{width:100%;text-align:center}.doc-preview-actions .button{width:100%}input,select,textarea{font-size:16px}.doc-paper{padding:16px}.update-summary{grid-template-columns:1fr}
}


/* MDW Admin v0.9.2 - branding/header cleanup */
.mdwa-sidebar .mdwa-brand{align-items:center;gap:12px;padding:8px 8px 18px}
.mdwa-brand .mdwa-logo-icon{flex:0 0 42px;height:42px!important;width:42px!important;max-width:42px!important;border-radius:10px;object-fit:contain}
.mdwa-brand-text{min-width:0;display:flex;flex-direction:column;gap:2px}
.mdwa-brand-name{display:block;font-size:18px!important;line-height:1.05;color:#fff;white-space:normal;word-break:normal}
.mdwa-brand-admin{display:block;font-size:15px;line-height:1.05;color:#fff;font-weight:800}
.mdwa-brand-page{display:block;font-size:12px;line-height:1.15;color:var(--muted);margin-top:2px;white-space:normal}
.doc-letterhead{display:flex;align-items:center;gap:16px}
.doc-brand-row{display:flex;align-items:center;gap:14px}
.doc-logo-icon{display:block!important;flex:0 0 58px;height:58px!important;width:58px!important;max-width:58px!important;border-radius:12px;object-fit:contain}
.doc-brand-name{font-size:28px;line-height:1.1;font-weight:800;color:#07111f}
.doc-brand-sub{font-size:15px;color:#39506a;margin-top:4px}
.doc-logo-mark,.doc-brand-logo{display:none!important}
@media(max-width:900px){.mdwa-brand .mdwa-logo-icon{height:38px!important;width:38px!important;max-width:38px!important}.mdwa-brand-name{font-size:17px!important}.mdwa-brand-admin{font-size:14px}.mdwa-brand-page{font-size:12px}.doc-logo-icon{height:48px!important;width:48px!important;max-width:48px!important}.doc-brand-name{font-size:23px}}

/* MDW Admin v0.9.3 - separate brand name, Admin label, and current page title */
.mdwa-sidebar .mdwa-brand{
  align-items:flex-start!important;
}
.mdwa-brand-text{
  display:block!important;
  min-width:0;
}
.mdwa-brand-name,
.mdwa-brand-name span,
.mdwa-brand-admin,
.mdwa-brand-page{
  display:block!important;
}
.mdwa-brand-name{
  margin:0 0 1px 0!important;
  font-size:18px!important;
  line-height:1.04!important;
  color:#fff!important;
  font-weight:800!important;
}
.mdwa-brand-admin{
  margin-top:2px!important;
  font-size:17px!important;
  line-height:1.05!important;
  color:#fff!important;
  font-weight:800!important;
}
.mdwa-brand-page{
  margin-top:6px!important;
  padding-top:6px!important;
  border-top:1px solid rgba(95,210,255,.28)!important;
  font-size:12px!important;
  line-height:1.2!important;
  color:#c7d9ec!important;
  font-weight:500!important;
  max-width:155px;
}
@media(max-width:900px){
  .mdwa-brand-page{max-width:200px}
}


/* MDW Admin v1.0.6 - clean pop-out preview toolbar and print output */
.doc-preview-body{
  margin:0;
  min-height:100vh;
  background:#4b5563;
  color:#07111f;
}
.doc-popout-toolbar{
  position:sticky;
  top:0;
  z-index:1000;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:12px 18px;
  background:#07111f;
  border-bottom:1px solid rgba(95,210,255,.32);
  box-shadow:0 8px 28px rgba(0,0,0,.28);
  color:#eef6ff;
}
.doc-popout-title strong{display:block;font-size:17px;line-height:1.1}
.doc-popout-title span{display:block;font-size:12px;color:#9fb4cc;margin-top:2px}
.doc-popout-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.doc-popout-main{
  max-width:980px;
  margin:24px auto;
  padding:0 18px 34px;
}
.doc-preview-body .doc-paper{
  max-width:900px;
  margin:0 auto;
  border-radius:0;
  box-shadow:0 14px 45px rgba(0,0,0,.38);
}
@media(max-width:640px){
  .doc-popout-toolbar{position:relative;display:block}
  .doc-popout-actions{margin-top:10px}.doc-popout-actions .button{width:auto}
  .doc-popout-main{margin:14px auto;padding:0 10px 20px}
}
@media print{
  .no-print,.doc-popout-toolbar,.doc-preview-actions,.mdwa-mobilebar,.mdwa-sidebar,.mdwa-overlay,.mdwa-footer,.alert{display:none!important}
  html,body,.doc-preview-body{background:#fff!important;margin:0!important;padding:0!important;color:#000!important}
  .mdwa-layout{display:block!important;min-height:0!important}
  .mdwa-content,.doc-popout-main,.mdwa-shell{margin:0!important;padding:0!important;max-width:none!important;width:100%!important}
  .doc-paper{box-shadow:none!important;border-radius:0!important;margin:0!important;max-width:none!important;width:100%!important;padding:0.35in!important}
  .doc-letterhead{break-inside:avoid;page-break-inside:avoid}
}
