
:root{--app-primary:#102447;--app-accent:#caa35a;--app-bg:#f5f7fb;--app-card:#ffffff;--app-text:#102447;}
*{box-sizing:border-box}body{font-family:Inter,sans-serif;background:linear-gradient(180deg,#edf2fa,#f8fafc);color:#13223b;margin:0}
a{text-decoration:none}.app-shell{display:flex;min-height:100vh}
.sidebar{width:292px;background:linear-gradient(180deg,var(--app-primary),#0b1731);color:#fff;padding:22px 18px;display:flex;flex-direction:column;gap:18px;position:sticky;top:0;height:100vh;box-shadow:0 0 30px rgba(16,36,71,.22)}
.brand{display:flex;gap:14px;align-items:center;padding:6px 8px 18px;border-bottom:1px solid rgba(255,255,255,.12)}
.brand-logo{width:54px;height:54px;border-radius:16px;background:linear-gradient(135deg,var(--app-accent),#f2ddb0);display:flex;align-items:center;justify-content:center;color:#1f2e48;font-size:26px;overflow:hidden}
.brand-logo img{width:100%;height:100%;object-fit:cover}
.brand-title{font-weight:800;font-size:1.05rem}.brand-subtitle{font-size:.83rem;opacity:.8}
.sidebar .nav-link{color:#e9eef9;border-radius:14px;padding:11px 14px;display:flex;align-items:center;gap:10px;font-weight:600}
.sidebar .nav-link:hover,.sidebar .nav-link.active{background:rgba(255,255,255,.10);color:#fff}
.sidebar-footer{margin-top:auto;background:rgba(255,255,255,.08);border-radius:18px;padding:14px}
.main-content{flex:1;padding:20px 24px}.topbar{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px;gap:16px}.topbar-subtext{font-size:.9rem;color:#68799b;margin-top:8px}
.hero-badge{background:linear-gradient(90deg,var(--app-primary),#233b66);color:#fff;padding:14px 18px;border-radius:18px;font-weight:700;box-shadow:0 16px 30px rgba(16,36,71,.16)}
.topbar-user{background:#fff;border:1px solid #e8edf7;border-radius:16px;padding:12px 16px;font-weight:600}
.page-wrap{max-width:1540px}
.card-premium,.auth-card,.kpi-card{border:none;border-radius:24px;background:var(--app-card);box-shadow:0 16px 36px rgba(16,36,71,.08)}
.card-premium .card-header{border:none;border-bottom:1px solid #eef2f8;background:transparent;padding:18px 22px;font-weight:800}
.card-premium .card-body{padding:22px}.kpi-card{padding:18px}.kpi-icon{width:56px;height:56px;border-radius:18px;background:linear-gradient(135deg,var(--app-primary),#36548b);display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.4rem}
.small-muted{font-size:.84rem;color:#7082a2}.tiny-muted{font-size:.76rem;color:#7d8dab}
.table-modern{margin-bottom:0}.table-modern thead th{background:#f7f9fd;border-bottom:1px solid #e8edf7;color:#33435f;font-size:.83rem;text-transform:uppercase;letter-spacing:.03em}
.table-modern td,.table-modern th{vertical-align:middle;padding:14px 12px}.table-modern tbody tr:hover{background:#fbfcfe}
.badge-soft{background:#eef3fb;color:#2a467a;border:1px solid #dbe6f6;border-radius:999px;padding:6px 10px;font-size:.76rem}
.btn-premium{background:linear-gradient(90deg,var(--app-primary),#284775);color:#fff;border:none;border-radius:16px;padding:11px 18px;font-weight:700}.btn-premium:hover{filter:brightness(1.05);color:#fff}
.btn-accent{background:linear-gradient(90deg,var(--app-accent),#f0dab0);color:#1f2e48;border:none;border-radius:14px;font-weight:700}.btn-accent:hover{color:#1f2e48;filter:brightness(1.02)}
.form-control,.form-select,.form-control:focus,.form-select:focus{border-radius:16px;min-height:46px;border-color:#dbe2ee;box-shadow:none}
.auth-card{max-width:500px;margin:70px auto;overflow:hidden}.auth-head{padding:22px;background:linear-gradient(135deg,var(--app-primary),#284775);color:#fff}.auth-body{padding:24px}
.brand-mark{width:60px;height:60px;border-radius:18px;background:linear-gradient(135deg,var(--app-accent),#f1ddb2);display:flex;align-items:center;justify-content:center;color:#20314e;font-size:28px}
.progress-thin{height:8px}.chip-link{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;background:#eef4fc;border:1px solid #d8e4f6;color:#29497a;font-weight:700;font-size:.8rem}
.doc-file-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;background:linear-gradient(135deg,#fff7e8,#fff2d5);border:1px solid #ead29b;color:#5a3d05;font-weight:700}
.doc-action-pill{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:16px;background:linear-gradient(135deg,#eef4ff,#f8fbff);border:1px solid #d6e5ff;color:#153a70;font-weight:700;font-size:.82rem;margin-bottom:8px}
.doc-link-stack{display:flex;flex-wrap:wrap;gap:8px}.filter-wrap{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}
.filter-wrap-7{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px}.stat-tile{padding:18px;border-radius:20px;background:linear-gradient(180deg,#fff,#f8fbff);border:1px solid #e9eef7}
.report-header{display:flex;gap:18px;align-items:center;border-bottom:4px solid #1b325e;padding-bottom:14px;margin-bottom:16px}.report-header .kop-image{max-height:95px;max-width:100%}
.report-sign{margin-top:36px;display:flex;justify-content:flex-end}.report-sign-box{text-align:center;width:320px}.qr-frame{display:inline-block;border:1px solid #ddd;padding:6px;border-radius:10px;background:#fff}
.page-title{font-size:1.15rem;font-weight:800}.section-note{padding:14px 18px;border-radius:18px;background:#f6f9ff;border:1px solid #e5eefc;color:#34517f}.data-chip{display:inline-block;padding:6px 10px;border-radius:999px;background:#f4f6fb;border:1px solid #e1e8f4;font-weight:600;font-size:.78rem;margin:2px}
.link-grid{display:flex;flex-wrap:wrap;gap:8px}.summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.mini-card{padding:16px;border-radius:18px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
.sticky-card{position:sticky;top:22px}.preview-box{padding:14px;border-radius:18px;background:#f9fbff;border:1px dashed #d8e5f8}
@media (max-width:1280px){.summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-wrap-7{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1100px){.sidebar{width:88px}.brand-title,.brand-subtitle,.sidebar-footer,.sidebar .nav-link span{display:none}.sidebar .nav-link{justify-content:center}.filter-wrap,.filter-wrap-7{grid-template-columns:repeat(2,minmax(0,1fr))}.summary-grid{grid-template-columns:1fr}}

.nav-menu-fixed .nav-link{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:48px}
.sidebar{flex:0 0 292px}
.user-chip{display:flex;align-items:center;gap:10px}
.avatar-48,.avatar-40,.avatar-72{border-radius:50%;object-fit:cover;background:#eef3fb;border:2px solid #fff;box-shadow:0 8px 20px rgba(16,36,71,.12)}
.avatar-48{width:48px;height:48px}.avatar-40{width:40px;height:40px}.avatar-72{width:72px;height:72px}
.file-button{display:inline-flex;align-items:center;gap:10px;padding:12px 16px;border-radius:18px;background:linear-gradient(135deg,#0f2547,#295287);color:#fff;font-weight:800;box-shadow:0 12px 24px rgba(16,36,71,.18);border:1px solid rgba(255,255,255,.08)}
.file-button:hover{color:#fff;transform:translateY(-1px)}
.file-button.secondary{background:linear-gradient(135deg,#eef4ff,#ffffff);color:#11366a;border:1px solid #d7e4fb;box-shadow:none}
.file-button.linkish{background:linear-gradient(135deg,#fff8e9,#fff1c7);color:#5b4407;border:1px solid #efd48c;box-shadow:none}
.action-cluster{display:flex;flex-wrap:wrap;gap:10px}
.report-web-hero{padding:24px;border-radius:26px;background:linear-gradient(135deg,var(--app-primary),#284775);color:#fff;box-shadow:0 24px 40px rgba(16,36,71,.18)}
.report-web-hero .meta{opacity:.85;font-size:.92rem}
.report-kpi{padding:18px;border-radius:22px;background:#fff;border:1px solid #e7eef8;box-shadow:0 14px 28px rgba(16,36,71,.06)}
.report-row{padding:16px;border-radius:20px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e6edf8}
.audit-grid{display:grid;grid-template-columns:190px 1fr;gap:4px 14px}
.profile-box{padding:18px;border-radius:22px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
@media (max-width:1100px){.sidebar{flex-basis:88px;width:88px}.audit-grid{grid-template-columns:1fr}}


.sidebar,.nav-menu-fixed{min-width:292px}
.nav-menu-fixed{overflow-y:auto;max-height:calc(100vh - 170px);padding-right:4px}
.sidebar .nav-link{min-width:100%}
.file-stack{display:flex;flex-direction:column;gap:10px}
.file-button.enhanced{padding:14px 18px;border-radius:20px;position:relative;overflow:hidden}
.file-button.enhanced:before{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.18),transparent 45%,rgba(255,255,255,.06));pointer-events:none}
.file-button.enhanced .meta{display:block;font-size:.75rem;font-weight:600;opacity:.85}
.file-button.secondary.enhanced{background:linear-gradient(135deg,#ffffff,#eef5ff)}
.file-button.linkish.enhanced{background:linear-gradient(135deg,#fff9e8,#ffefbc)}
.file-button.report-open{background:linear-gradient(135deg,#102447,#355f9a);padding:14px 18px;border-radius:18px}
.file-button.report-doc{background:linear-gradient(135deg,#ffffff,#eef6ff);color:#13386e;border:1px solid #dce8fb;box-shadow:0 10px 24px rgba(16,36,71,.06)}
.file-button.report-link{background:linear-gradient(135deg,#fff9ea,#fff1c8);color:#5a4306;border:1px solid #edd490;box-shadow:0 10px 24px rgba(202,163,90,.10)}
.file-label{display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border-radius:999px;background:#f3f7ff;border:1px solid #dbe7fb;color:#23477b;font-weight:700;font-size:.76rem}
.report-section{padding:20px;border-radius:24px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e8eef9;box-shadow:0 14px 28px rgba(16,36,71,.05)}
.profile-banner{padding:24px;border-radius:24px;background:linear-gradient(135deg,var(--app-primary),#33588d);color:#fff;position:relative;overflow:hidden}
.profile-banner:after{content:"";position:absolute;right:-20px;top:-30px;width:180px;height:180px;background:radial-gradient(circle,rgba(255,255,255,.16),transparent 65%)}
.web-report-grid{display:grid;grid-template-columns:1.3fr .7fr;gap:18px}
.web-panel{padding:18px;border-radius:22px;background:#fff;border:1px solid #e7eef8;box-shadow:0 12px 24px rgba(16,36,71,.05)}
.timeline-list{display:grid;gap:14px}
.timeline-item{display:flex;gap:14px;align-items:flex-start;padding:14px;border-radius:18px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
.timeline-bullet{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#102447,#315689);display:flex;align-items:center;justify-content:center;color:#fff;flex:0 0 44px}
@media (max-width:1100px){.web-report-grid{grid-template-columns:1fr}.sidebar,.nav-menu-fixed{min-width:88px}}


/* v8 proportional report web */
.page-wrap{max-width:1380px;width:100%}
.report-web-shell{display:grid;grid-template-columns:minmax(0,1.2fr) 360px;gap:20px;align-items:start}
.report-web-stack{display:grid;gap:20px}
.report-stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.report-kpi{min-height:138px;display:flex;flex-direction:column;justify-content:space-between}
.report-kpi .kpi-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.report-kpi .kpi-icon-soft{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#eef4ff,#f7fbff);border:1px solid #dae6fb;color:#16386d;display:flex;align-items:center;justify-content:center;font-size:1.25rem}
.report-kpi .kpi-number{font-size:2.2rem;line-height:1;font-weight:800;color:#102447;margin-top:10px}
.report-panel-title{font-size:1rem;font-weight:800;color:#102447;margin-bottom:14px}
.report-progress-list{display:grid;gap:14px}
.report-progress-item{padding:16px 18px;border-radius:20px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
.report-progress-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:10px}
.report-side-stack{display:grid;gap:18px;position:sticky;top:20px}
.report-side-card{padding:18px;border-radius:22px;background:#fff;border:1px solid #e7eef8;box-shadow:0 12px 24px rgba(16,36,71,.05)}
.monitor-card{display:flex;gap:14px;align-items:flex-start;padding:14px;border-radius:18px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
.monitor-avatar{width:44px;height:44px;border-radius:14px;background:linear-gradient(135deg,#102447,#315689);display:flex;align-items:center;justify-content:center;color:#fff;font-weight:800;flex:0 0 44px}
.monitor-meta{font-size:.78rem;color:#7283a2}
.latest-upload-list{display:grid;gap:14px}
.latest-upload-card{padding:18px;border-radius:22px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8;box-shadow:0 12px 24px rgba(16,36,71,.05)}
.latest-upload-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.latest-upload-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}
.empty-illustration{padding:34px 18px;border-radius:22px;text-align:center;background:linear-gradient(180deg,#f9fbff,#ffffff);border:1px dashed #d8e6fb;color:#7385a3}
@media (max-width:1280px){.report-web-shell{grid-template-columns:1fr}.report-side-stack{position:static}.report-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:768px){.report-stats-grid{grid-template-columns:1fr}.latest-upload-head{flex-direction:column}.report-web-hero{padding:20px;border-radius:22px}}


/* v9 sidebar and profile refinement */
.sidebar{flex:0 0 268px !important;width:268px !important;min-width:268px !important;padding:18px 14px 16px !important}
.nav-menu-fixed{min-width:0 !important;max-height:calc(100vh - 186px) !important;padding-right:2px !important}
.sidebar .brand{align-items:flex-start;gap:12px;margin-bottom:18px}
.sidebar .brand-logo{width:44px;height:44px;flex:0 0 44px;border-radius:14px;overflow:hidden}
.sidebar .brand-logo img{width:100%;height:100%;object-fit:cover;display:block}
.sidebar .brand-title{font-size:1rem;line-height:1.35;font-weight:800}
.sidebar .brand-subtitle{font-size:.78rem;opacity:.9;margin-top:2px}
.sidebar .nav-link{display:flex;align-items:center;gap:10px;min-height:42px;padding:10px 12px;border-radius:14px;font-size:.93rem;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar .nav-link i{font-size:1rem;flex:0 0 16px;width:16px;text-align:center}
.sidebar .nav-link span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.2}
.sidebar-footer.user-card-mini{margin-top:14px;padding:14px 12px;border-radius:18px}
.sidebar-footer .badge{font-size:.7rem}
.topbar-user{padding:8px 12px;border-radius:18px;background:rgba(255,255,255,.88);box-shadow:0 10px 24px rgba(16,36,71,.08)}
.avatar-48,.avatar-40,.avatar-72{display:inline-block !important;max-width:none !important}
.avatar-48{width:48px !important;height:48px !important;max-width:48px !important;max-height:48px !important}
.avatar-40{width:40px !important;height:40px !important;max-width:40px !important;max-height:40px !important}
.avatar-72{width:72px !important;height:72px !important;max-width:72px !important;max-height:72px !important}
.profile-banner{padding:22px 24px;border-radius:24px;background:linear-gradient(135deg,var(--app-primary),#274978);color:#fff;box-shadow:0 20px 34px rgba(16,36,71,.16)}
.profile-box{padding:18px 18px 16px;border-radius:20px;background:linear-gradient(180deg,#fff,#f8fbff);border:1px solid #e8eef9}
@media (max-width:1100px){
  .sidebar,.nav-menu-fixed{min-width:88px !important;width:88px !important;flex-basis:88px !important}
  .sidebar .brand-title,.sidebar .brand-subtitle,.sidebar-footer,.sidebar .nav-link span{display:none !important}
  .sidebar .nav-link{justify-content:center;padding:11px 8px}
}


/* v10 layout refinement */
.sidebar{flex:0 0 292px !important;width:292px !important;min-width:292px !important;padding:18px 16px 16px !important;overflow:hidden}
.nav-menu-fixed{max-height:calc(100vh - 188px) !important;padding-right:4px !important}
.sidebar .nav-link{gap:14px !important;padding:11px 14px !important;border-radius:16px !important;font-size:.95rem !important;min-height:46px !important}
.sidebar .nav-link i{width:18px !important;flex:0 0 18px !important;margin-right:2px;font-size:1rem !important}
.sidebar .brand{padding:8px 10px 18px !important;border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.03))}
.sidebar .brand-title{font-size:1rem !important;line-height:1.35 !important;white-space:normal !important;word-break:break-word}
.topbar{align-items:center !important;overflow:visible !important}
.topbar-user{display:flex;align-items:center;gap:12px;max-width:360px;background:rgba(255,255,255,.92) !important;overflow:visible !important}
.topbar-user img{display:block;flex:0 0 40px}
.topbar-user .fw-semibold,.topbar-user .small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hero-badge{max-width:min(620px,100%);line-height:1.25}
.page-wrap{max-width:1440px !important}
.filter-wrap-masters{grid-template-columns:2fr 1fr 1fr 1fr auto auto !important}
.table-doc-master thead th{white-space:normal;color:#203455;text-transform:none;font-size:.98rem}
.table-doc-master td{padding-top:18px;padding-bottom:18px}
.upload-rules-table thead th{white-space:normal;color:#203455;text-transform:none;font-size:.98rem}
.upload-rule-form .rule-inputs{display:grid;grid-template-columns:minmax(0,1.2fr) 110px 150px;gap:12px;align-items:end}
.rule-save-side{display:flex;justify-content:flex-end;align-items:end;height:100%}
.btn-save-edge{width:132px;border-radius:18px;padding:12px 16px;justify-content:center;box-shadow:0 12px 24px rgba(16,36,71,.16)}
.report-web-shell-enhanced{grid-template-columns:minmax(0,1.35fr) 380px !important}
.report-stats-grid-rich{grid-template-columns:repeat(4,minmax(0,1fr)) !important}
.chart-box-lg{height:320px;padding:10px 0}.chart-box-sm{height:250px;padding:10px 0}
.mini-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mini-summary-card{padding:14px 16px;border-radius:18px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8}
.report-web-hero-rich{position:relative;overflow:hidden}.report-web-hero-rich:after{content:"";position:absolute;right:-20px;top:-20px;width:180px;height:180px;background:radial-gradient(circle,rgba(255,255,255,.18),transparent 68%)}
.audit-filter-grid{grid-template-columns:2fr 1fr 1fr 1fr auto auto !important}
.audit-card-wide{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;padding:18px;border-radius:22px;background:linear-gradient(180deg,#fff,#f9fbff);border:1px solid #e7eef8;box-shadow:0 12px 24px rgba(16,36,71,.05)}
.audit-side-block{display:grid;gap:12px;align-content:start}
.audit-side-item{padding:12px 14px;border-radius:16px;background:#fff;border:1px solid #e7eef8}
.audit-code{display:block;white-space:pre-wrap;background:#0d1f3e;color:#f3f7ff;padding:12px;border-radius:14px;font-size:.78rem;max-height:170px;overflow:auto}
.compact-row{padding:16px 18px !important}
.import-card-main .card-body{padding-top:18px}
@media (max-width:1280px){.report-web-shell-enhanced{grid-template-columns:1fr !important}.upload-rule-form .rule-inputs{grid-template-columns:1fr 120px}.rule-save-side{grid-column:1/-1;justify-content:flex-end}.audit-card-wide{grid-template-columns:1fr}.filter-wrap-masters,.audit-filter-grid{grid-template-columns:1fr 1fr 1fr 1fr auto auto !important}}
@media (max-width:1100px){.sidebar,.nav-menu-fixed{min-width:88px !important;width:88px !important;flex-basis:88px !important}.sidebar .brand-title,.sidebar .brand-subtitle,.sidebar-footer,.sidebar .nav-link span{display:none !important}.sidebar .nav-link{justify-content:center !important;padding:11px 8px !important}.sidebar .brand{padding:0 !important;background:transparent !important}}
@media (max-width:768px){.report-stats-grid-rich,.mini-summary-grid{grid-template-columns:1fr !important}.filter-wrap-masters,.audit-filter-grid{grid-template-columns:1fr !important}.upload-rule-form .rule-inputs{grid-template-columns:1fr !important}.btn-save-edge{width:100%}.topbar{align-items:flex-start !important}.topbar-user{max-width:100%}}


/* v11 branding image safety fix */
img{max-width:100%;height:auto}
.sidebar{isolation:isolate}
.brand{position:relative;overflow:hidden}
.brand-logo{background:rgba(255,255,255,.08) !important;border:1px solid rgba(255,255,255,.12);display:flex !important;align-items:center;justify-content:center;overflow:hidden !important}
.brand-logo .brand-logo-img,
.brand-logo img{display:block !important;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important;object-fit:contain !important;object-position:center !important;background:transparent !important}
.brand-copy{min-width:0;flex:1 1 auto}
.brand-title,.brand-subtitle{display:block;max-width:100%;word-break:normal;overflow-wrap:anywhere}
.topbar{position:relative;z-index:2}
.topbar-user{min-width:0}
.topbar-user img{width:40px !important;height:40px !important;max-width:40px !important;max-height:40px !important;object-fit:cover !important;border-radius:50% !important;display:block !important}
.page-wrap,.card,.card-premium,.kpi-card,.report-section,.report-web-hero,.report-web-shell,.report-web-stack{position:relative;z-index:1}
.branding-preview-box{padding:14px;border-radius:20px;background:linear-gradient(180deg,#fff,#f8fbff);border:1px solid #e7eef8}
.branding-preview-box + .branding-preview-box{margin-top:14px}
.preview-logo-frame{width:120px;height:120px;border-radius:20px;border:1px solid #e7eef8;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden}
.preview-logo-frame img{width:100%;height:100%;object-fit:contain;display:block}
.preview-header-frame{width:100%;min-height:90px;max-height:180px;border-radius:18px;border:1px solid #e7eef8;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px}
.preview-header-frame img{width:100%;height:100%;object-fit:contain;display:block}
.preview-sign-frame{width:220px;height:110px;border-radius:18px;border:1px solid #e7eef8;background:#fff;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:8px}
.preview-sign-frame img{width:100%;height:100%;object-fit:contain;display:block}
.report-header{align-items:center !important;gap:18px !important;overflow:hidden}
.report-header .kop-image{display:block;flex:0 0 auto;width:auto !important;max-width:min(100%,380px) !important;max-height:110px !important;height:auto !important;object-fit:contain !important;object-position:left center !important}
.report-header .report-head-copy{min-width:0;flex:1 1 auto}
.report-header .report-head-copy h3{word-break:break-word}
.settings-help-note{font-size:.82rem;color:#6c7ea1;margin-top:6px}
@media (max-width:1100px){
  .brand-copy{display:none !important}
  .brand{justify-content:center !important;padding:0 !important;background:transparent !important;border-radius:0 !important}
  .brand-logo{width:44px !important;height:44px !important}
}


/* v12 final refinements */
.topbar{padding:6px 4px 2px 0; margin-bottom:18px}
.topbar-user{padding:10px 14px !important}
.sidebar{flex:0 0 308px !important;width:308px !important;min-width:308px !important;padding:18px 18px 16px !important}
.sidebar .nav-link{gap:16px !important;padding:12px 16px !important;min-height:48px !important}
.sidebar .nav-link i{width:20px !important;flex:0 0 20px !important;margin-right:4px;font-size:1.02rem !important}
.page-wrap{padding-top:4px}
.row-number-badge{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:38px;border-radius:12px;background:linear-gradient(135deg,var(--app-primary),#2d4d7d);color:#fff;font-weight:800;box-shadow:0 10px 20px rgba(16,36,71,.14)}
.table-doc-master td:first-child,.upload-rules-table td:first-child,.table-doc-master th:first-child,.upload-rules-table th:first-child{text-align:center;vertical-align:top}
.sticky-card{position:sticky;top:18px}
.kop-mode-wrap{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.kop-mode-option{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid #dbe5f2;border-radius:18px;background:linear-gradient(180deg,#fff,#f8fbff);cursor:pointer}
.kop-mode-option input{margin-top:4px}
.kop-mode-option span{display:grid;gap:4px;font-size:.92rem}
.kop-mode-option small{color:#6c7ea1}
.upload-rule-form .edge-save-layout{grid-template-columns:minmax(0,1.4fr) 110px 122px !important;align-items:end}
.rule-save-edge-wrap{display:flex;justify-content:flex-end;align-items:stretch}
.btn-save-vertical{height:100%;min-height:92px;border-radius:18px;padding:10px 14px;writing-mode:vertical-rl;text-orientation:upright;letter-spacing:1px}
.btn-save-vertical i{display:none}
.report-web-shell-enhanced .card-header,.report-web-shell .card-header{font-size:1rem}
.report-web-kpi-card{position:relative;overflow:hidden}
.report-web-kpi-card:after{content:"";position:absolute;right:-10px;bottom:-18px;width:92px;height:92px;background:radial-gradient(circle,rgba(202,163,90,.12),transparent 70%)}
.audit-card-wide{grid-template-columns:minmax(0,1.15fr) 320px !important}
@media (max-width:1280px){.audit-card-wide{grid-template-columns:1fr !important}}
@media (max-width:1100px){.sidebar,.nav-menu-fixed{min-width:92px !important;width:92px !important;flex-basis:92px !important}.sidebar .brand-copy,.sidebar-footer,.sidebar .nav-link span{display:none !important}.sidebar .nav-link{justify-content:center !important;padding:12px 8px !important}.sidebar .brand{padding:0 !important;background:transparent !important}}
@media (max-width:768px){.kop-mode-wrap{grid-template-columns:1fr}.btn-save-vertical{writing-mode:horizontal-tb;text-orientation:mixed;min-height:auto;height:auto;width:100%}.upload-rule-form .edge-save-layout{grid-template-columns:1fr !important}}


/* v13 enterprise branding hardening */
.sidebar{overflow:hidden !important; position:sticky !important; left:0; contain:layout paint; isolation:isolate;}
.brand{align-items:center !important; min-height:78px; overflow:hidden !important; position:relative; z-index:2;}
.brand-logo{flex:0 0 52px !important; width:52px !important; max-width:52px !important; min-width:52px !important; height:52px !important; max-height:52px !important; min-height:52px !important; padding:0 !important; background:transparent !important; border:none !important; overflow:hidden !important;}
.brand-logo-frame{position:relative; width:52px; height:52px; border-radius:16px; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); overflow:hidden; display:flex; align-items:center; justify-content:center; box-shadow:inset 0 0 0 1px rgba(255,255,255,.02);}
.brand-logo-img{display:block !important; width:100% !important; height:100% !important; max-width:100% !important; max-height:100% !important; object-fit:contain !important; object-position:center center !important; transform:none !important; position:static !important; float:none !important; margin:0 !important;}
.brand-copy{overflow:hidden !important;}
.main-content,.page-wrap,.topbar,.card-premium,.kpi-card{overflow:visible !important;}
/* Prevent branding images from leaking into layout */
img[src*="uploads/branding/"]{position:static !important; transform:none !important;}
img.brand-logo-img, .preview-logo-frame img, .preview-header-frame img, .preview-sign-frame img, .report-header .kop-image{filter:none !important; mix-blend-mode:normal !important;}
.preview-logo-frame{width:140px !important; height:140px !important; padding:10px;}
.preview-header-frame{min-height:110px !important; max-height:170px !important; padding:10px 12px !important;}
.preview-sign-frame{width:240px !important; height:120px !important; padding:10px !important;}
.report-header{display:grid !important; grid-template-columns:auto 1fr; gap:18px !important; align-items:center !important; overflow:hidden !important;}
.report-header .kop-image{display:block !important; width:auto !important; max-width:min(100%,420px) !important; height:auto !important; max-height:108px !important; object-fit:contain !important; object-position:left center !important; flex:0 0 auto !important;}
.report-head-copy{min-width:0 !important; overflow:hidden !important;}
.report-head-copy h3,.report-head-copy div{word-break:break-word; overflow-wrap:anywhere;}
.settings-brand-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
@media (max-width:1100px){
  .brand-logo,.brand-logo-frame{width:44px !important; height:44px !important; min-width:44px !important; max-width:44px !important; min-height:44px !important; max-height:44px !important;}
}
@media (max-width:768px){
  .report-header{grid-template-columns:1fr !important;}
  .settings-brand-grid{grid-template-columns:1fr;}
}
