:root {
  --sidebar-width: 256px;
  --sidebar-collapsed: 76px;
  --topbar-height: 68px;
  --accent: #0f6cbd;
  --accent-hover: #115ea3;
  --accent-light: #e8f3fc;
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-muted: #fafafa;
  --text: #242424;
  --text-muted: #616161;
  --border: #e0e0e0;
  --border-strong: #c7c7c7;
  --success: #107c10;
  --warning: #8a6d00;
  --danger: #c50f1f;
  --info: #0f6cbd;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12);
  --radius: 10px;
  --radius-lg: 16px;
  --font: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
html { font-family: var(--font); color: var(--text); background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.15; margin-bottom: .6rem; }
h2 { font-size: 1.25rem; margin-bottom: .75rem; }
h3 { font-size: 1rem; margin-bottom: .35rem; }
p { color: var(--text-muted); line-height: 1.55; }
small, .muted { color: var(--text-muted); }
code { background: #f0f0f0; padding: .15rem .35rem; border-radius: 4px; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.grow { flex: 1; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0,1fr); transition: grid-template-columns .18s ease; }
body.sidebar-collapsed .app-shell { grid-template-columns: var(--sidebar-collapsed) minmax(0,1fr); }

.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  background: #fff; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
}
.brand { min-height: var(--topbar-height); display: flex; align-items: center; gap: .8rem; padding: 0 18px; border-bottom: 1px solid var(--border); color: var(--text); }
.brand:hover { text-decoration: none; background: var(--surface-muted); }
.brand-mark { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; color: white; background: linear-gradient(135deg,#0f6cbd,#5b5fc7); border-radius: 10px; font-weight: 700; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(15,108,189,.25); }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.1; white-space: nowrap; }
.brand-copy small { font-size: .72rem; margin-top: 4px; }
.nav-groups { padding: 14px 10px; overflow-y: auto; flex: 1; }
.nav-group { margin-bottom: 18px; }
.nav-label { display: block; padding: 4px 10px 7px; color: #808080; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: .75rem; min-height: 42px; padding: 8px 10px; color: #424242; border-radius: 7px; margin: 2px 0; white-space: nowrap; }
.nav-item:hover { text-decoration: none; background: #f0f0f0; }
.nav-item.active { color: var(--accent); background: var(--accent-light); font-weight: 600; position: relative; }
.nav-item.active::before { content:""; position:absolute; left:-10px; top:9px; bottom:9px; width:3px; background:var(--accent); border-radius:2px; }
.nav-icon { flex: 0 0 28px; text-align:center; font-size: 1.12rem; }
.collapse-button { border: 0; border-top: 1px solid var(--border); background: #fff; min-height: 52px; display:flex; align-items:center; gap:.75rem; padding:0 20px; color:var(--text-muted); }
.collapse-button:hover { background:#f5f5f5; }
body.sidebar-collapsed .brand-copy,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-item > span:last-child,
body.sidebar-collapsed .collapse-label { display:none; }
body.sidebar-collapsed .nav-item { justify-content:center; }
body.sidebar-collapsed .collapse-button { justify-content:center; }
body.sidebar-collapsed .collapse-button > span:first-child { transform: rotate(180deg); }

.main-column { min-width: 0; display:flex; flex-direction:column; min-height:100vh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-height);
  display:flex; align-items:center; gap:18px; padding: 0 24px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border);
}
.page-heading { display:flex; flex-direction:column; min-width:145px; line-height:1.15; }
.eyebrow { color: var(--accent); font-size:.67rem; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
.global-search { max-width: 620px; flex:1; margin:0 auto; position:relative; }
.global-search input { width:100%; height:40px; padding:0 70px 0 40px; border:1px solid var(--border-strong); border-radius:7px; background:#f8f8f8; }
.global-search::before { content:"⌕"; position:absolute; left:14px; top:8px; color:var(--text-muted); }
.global-search kbd { position:absolute; right:10px; top:9px; border:1px solid var(--border); background:#fff; border-radius:4px; padding:2px 6px; font-size:.7rem; color:var(--text-muted); }
.topbar-actions { display:flex; align-items:center; gap:10px; margin-left:auto; }
.icon-button { width:36px; height:36px; display:inline-grid; place-items:center; padding:0; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--text); }
.icon-button:hover { background:#ededed; text-decoration:none; }
.mobile-menu-button { display:none; }
.avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:50%; color:white; background:#5b5fc7; font-weight:700; list-style:none; cursor:pointer; }
.avatar.small { width:32px; height:32px; font-size:.8rem; }
.profile-menu, .organization-switcher { position:relative; }
.profile-menu summary, .organization-switcher summary { list-style:none; cursor:pointer; }
.profile-menu summary::-webkit-details-marker, .organization-switcher summary::-webkit-details-marker { display:none; }
.profile-popover, .organization-menu { position:absolute; right:0; top:calc(100% + 10px); z-index:50; min-width:230px; background:white; border:1px solid var(--border); box-shadow:var(--shadow-lg); border-radius:10px; padding:10px; }
.profile-popover { display:flex; flex-direction:column; gap:4px; }
.profile-popover strong { padding:8px; overflow:hidden; text-overflow:ellipsis; }
.profile-popover a, .profile-popover .link-button { padding:9px; border-radius:6px; color:var(--text); text-align:left; }
.profile-popover a:hover, .profile-popover .link-button:hover { background:#f2f2f2; text-decoration:none; }
.organization-switcher summary { display:flex; align-items:center; gap:8px; padding:7px 10px; border:1px solid var(--border); border-radius:7px; background:white; max-width:220px; white-space:nowrap; }
.org-dot { width:8px; height:8px; border-radius:50%; background:var(--success); }
.organization-option { width:100%; display:flex; justify-content:space-between; gap:20px; border:0; background:white; padding:10px; border-radius:6px; text-align:left; }
.organization-option:hover, .organization-option.active { background:var(--accent-light); color:var(--accent); }

.content { width:100%; max-width:1560px; margin:0 auto; padding:28px clamp(16px,3vw,40px) 60px; flex:1; }
.footer { display:flex; justify-content:space-between; padding:18px 32px; border-top:1px solid var(--border); color:var(--text-muted); font-size:.8rem; background:white; }

.button { min-height:36px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:7px 14px; border-radius:6px; border:1px solid transparent; font-weight:600; font-size:.88rem; transition:.12s ease; white-space:nowrap; }
.button:hover { text-decoration:none; transform:translateY(-1px); }
.button.primary { background:var(--accent); color:white; border-color:var(--accent); }
.button.primary:hover { background:var(--accent-hover); }
.button.secondary { background:white; color:var(--text); border-color:var(--border-strong); }
.button.secondary:hover { background:#f4f4f4; }
.button.tertiary { background:transparent; color:var(--accent); padding-inline:9px; }
.button.danger, .button.tertiary.danger, .link-button.danger { color:var(--danger); }
.button.danger { background:#fdf3f4; border-color:#f1b9bf; }
.button.large { min-height:44px; padding:10px 20px; }
.button:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.link-button { border:0; background:transparent; color:var(--accent); padding:0; }
.page-actions, .hero-actions, .form-actions, .link-row { display:flex; flex-wrap:wrap; gap:10px; align-items:center; }

.surface { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:0 1px 2px rgba(0,0,0,.03); padding:22px; }
.page-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:24px; }
.page-header p { margin-bottom:0; }
.page-header.app-detail-header { align-items:center; background:white; padding:22px; border:1px solid var(--border); border-radius:var(--radius-lg); }
.section-block { margin:30px 0; }
.section-heading { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:14px; }
.section-heading h2 { margin:0; }
.welcome-strip { display:flex; align-items:center; justify-content:space-between; gap:30px; background:linear-gradient(110deg,#fff,#edf6fc); border:1px solid #d8eaf7; border-radius:var(--radius-lg); padding:26px 30px; }
.metric-row { display:flex; gap:10px; }
.metric-card { min-width:110px; background:white; border:1px solid var(--border); border-radius:9px; padding:14px; }
.metric-card strong { display:block; font-size:1.5rem; }
.metric-card span { color:var(--text-muted); font-size:.78rem; }

.landing-hero { min-height:540px; display:grid; grid-template-columns:minmax(0,1.05fr) minmax(360px,.95fr); gap:60px; align-items:center; background:linear-gradient(135deg,#f9fcff 0,#eef6fc 58%,#f5f2ff 100%); margin:-28px calc(-1 * clamp(16px,3vw,40px)) 36px; padding:60px clamp(24px,6vw,90px); border-bottom:1px solid #dbe8f1; }
.hero-copy h1 { font-size:clamp(2.5rem,5vw,4.3rem); max-width:800px; letter-spacing:-.04em; }
.hero-copy p { font-size:1.15rem; max-width:680px; }
.product-badge, .category-pill { display:inline-flex; align-items:center; border-radius:999px; background:var(--accent-light); color:var(--accent); font-size:.72rem; font-weight:700; padding:5px 9px; }
.hero-panel { display:grid; place-items:center; }
.suite-preview { width:min(100%,520px); aspect-ratio:4/3; background:#fff; border:1px solid rgba(0,0,0,.08); border-radius:18px; box-shadow:0 28px 70px rgba(40,90,130,.18); overflow:hidden; transform:perspective(900px) rotateY(-5deg) rotateX(2deg); }
.preview-top { height:46px; display:flex; align-items:center; gap:6px; padding:0 16px; border-bottom:1px solid var(--border); }
.preview-top span { width:9px; height:9px; border-radius:50%; background:#d0d0d0; }
.preview-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; padding:34px; }
.preview-card { aspect-ratio:1.5; border-radius:14px; display:grid; place-items:center; color:#fff; font-size:2.2rem; font-weight:700; box-shadow:var(--shadow); }
.preview-card.blue { background:#0f6cbd; }.preview-card.purple{background:#7f56d9}.preview-card.teal{background:#008272}.preview-card.gray{background:#616161}

.app-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(270px,1fr)); gap:16px; }
.compact-grid { grid-template-columns:repeat(auto-fill,minmax(245px,1fr)); }
.app-card { display:flex; flex-direction:column; min-height:270px; background:white; border:1px solid var(--border); border-radius:var(--radius); padding:18px; transition:.15s ease; }
.app-card:hover { border-color:#b5cde0; box-shadow:var(--shadow); transform:translateY(-2px); }
.app-card-header { display:flex; justify-content:space-between; align-items:flex-start; }
.app-icon, .mini-app-icon { display:grid; place-items:center; background:color-mix(in srgb,var(--accent) 12%,white); color:var(--accent); border:1px solid color-mix(in srgb,var(--accent) 24%,white); font-weight:700; }
.app-icon { width:48px; height:48px; border-radius:11px; font-size:1.2rem; }
.app-icon.large { width:70px; height:70px; border-radius:16px; font-size:1.8rem; }
.mini-app-icon { flex:0 0 34px; width:34px; height:34px; border-radius:8px; }
.favorite-button { font-size:1.25rem; color:#797979; }
.favorite-button.selected { color:#d99500; }
.app-card-body { flex:1; padding:16px 0; }
.app-card-body h3 { font-size:1.08rem; margin-top:12px; }
.app-card-body h3 a { color:var(--text); }
.app-card-body p { font-size:.88rem; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.app-card-footer { display:flex; gap:8px; border-top:1px solid #eee; padding-top:14px; }
.meta-row { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.health-badge { display:inline-flex; align-items:center; gap:5px; color:var(--text-muted); font-size:.72rem; white-space:nowrap; }
.health-badge i, .health-dot { width:8px; height:8px; display:inline-block; border-radius:50%; background:#929292; }
.health-badge.healthy i, .health-dot.healthy { background:var(--success); }
.health-badge.degraded i, .health-dot.degraded { background:#dca000; }
.health-badge.maintenance i, .health-dot.maintenance { background:#d97706; }
.health-badge.unhealthy i, .health-dot.unhealthy { background:var(--danger); }

.filter-bar { display:flex; flex-wrap:wrap; gap:6px; }
.filter-chip { border:1px solid var(--border); background:white; border-radius:999px; padding:7px 11px; color:var(--text-muted); }
.filter-chip.active, .filter-chip:hover { color:var(--accent); border-color:#9dc4e1; background:var(--accent-light); }
.recent-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:10px; }
.recent-item { display:flex; align-items:center; gap:12px; background:white; border:1px solid var(--border); border-radius:8px; padding:12px; color:var(--text); }
.recent-item:hover { text-decoration:none; border-color:#b5cde0; }
.recent-item span:nth-child(2) { flex:1; display:flex; flex-direction:column; }

.announcement-stack { display:grid; gap:8px; margin:18px 0; }
.announcement { display:flex; justify-content:space-between; gap:20px; padding:14px 16px; border-radius:8px; border-left:4px solid var(--info); background:#eef6fc; }
.announcement p { margin:3px 0 0; font-size:.86rem; }
.announcement.warning, .announcement.maintenance { background:#fff8e6; border-color:#dca000; }
.announcement.critical { background:#fdf3f4; border-color:var(--danger); }
.announcement.newfeature { background:#f5f1ff; border-color:#7f56d9; }

.form-page, .narrow-form { max-width:920px; margin:0 auto; }
.narrow-form { max-width:590px; }
.form-page-heading { margin-bottom:20px; }
.form-page-layout { display:grid; gap:16px; max-width:980px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:17px; }
.form-grid > div, .form-stack { min-width:0; }
.form-grid .full { grid-column:1/-1; }
.form-stack { display:flex; flex-direction:column; gap:9px; }
label { color:#3b3b3b; font-size:.83rem; font-weight:600; }
input, select, textarea { width:100%; min-height:40px; border:1px solid var(--border-strong); border-radius:6px; background:white; padding:8px 10px; color:var(--text); }
textarea { resize:vertical; }
input:focus, select:focus, textarea:focus { outline:2px solid rgba(15,108,189,.28); border-color:var(--accent); }
input[type=color] { padding:4px; }
input[type=checkbox] { width:17px; min-height:17px; accent-color:var(--accent); }
.checkbox-row { display:flex; align-items:center; gap:8px; font-weight:400; }
.checkbox-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:8px; padding:12px; background:#f8f8f8; border-radius:7px; }
.field-validation-error, .validation-summary { color:var(--danger); font-size:.8rem; }
.validation-summary ul { margin:0; padding-left:18px; }
.auth-layout { min-height:calc(100vh - 180px); display:grid; grid-template-columns:minmax(0,560px) 1fr; overflow:hidden; background:white; border:1px solid var(--border); border-radius:var(--radius-lg); box-shadow:var(--shadow); }
.auth-panel { padding:clamp(28px,5vw,58px); display:flex; flex-direction:column; justify-content:center; }
.auth-brand { display:flex; align-items:center; gap:10px; margin-bottom:38px; }
.auth-panel h1 { font-size:2.3rem; }
.auth-links { display:flex; justify-content:space-between; margin:12px 0 22px; font-size:.86rem; }
.auth-aside { min-height:560px; background:linear-gradient(140deg,#0f6cbd,#5b5fc7); color:white; display:grid; place-items:center; padding:40px; }
.auth-aside p, .auth-aside li { color:rgba(255,255,255,.87); }
.auth-visual { max-width:420px; }
.visual-icon { font-size:5rem; opacity:.8; }
.centered-panel { max-width:650px; margin:70px auto; text-align:center; background:white; border:1px solid var(--border); border-radius:var(--radius-lg); padding:50px 30px; }
.centered-panel .button { margin-top:16px; }
.empty-state { text-align:center; padding:60px 20px; border:1px dashed var(--border-strong); background:white; border-radius:var(--radius); }
.empty-icon { width:64px; height:64px; margin:0 auto 18px; display:grid; place-items:center; border-radius:50%; background:var(--accent-light); color:var(--accent); font-size:1.7rem; }
.success-icon { color:var(--success); background:#eaf6ea; }
.error-icon { color:var(--danger); background:#fdf3f4; }
.warning-icon { color:var(--warning); background:#fff8e6; }

.toast { position:fixed; right:22px; top:80px; z-index:100; max-width:430px; padding:13px 16px; border-radius:8px; box-shadow:var(--shadow-lg); background:white; border-left:4px solid var(--info); animation:toast-in .2s ease; }
.toast.success { border-color:var(--success); }.toast.error{border-color:var(--danger);}
@keyframes toast-in { from{transform:translateY(-10px);opacity:0}to{transform:none;opacity:1} }

.status-pill { display:inline-flex; align-items:center; padding:4px 8px; border-radius:999px; background:#f0f0f0; font-size:.75rem; white-space:nowrap; }
.card-list { display:grid; gap:10px; }
.organization-card, .announcement-admin-card { display:flex; align-items:center; gap:14px; }
.organization-avatar { width:48px; height:48px; display:grid; place-items:center; border-radius:10px; background:var(--accent-light); color:var(--accent); font-weight:700; }
.two-column-layout, .detail-layout { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(300px,.7fr); gap:18px; }
.detail-main { min-height:420px; }
.detail-list { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:20px 0; }
.detail-list div, .health-card dl div { display:flex; flex-direction:column; padding:10px; background:#f8f8f8; border-radius:7px; }
.detail-list dt, .health-card dt { color:var(--text-muted); font-size:.72rem; }
.detail-list dd, .health-card dd { margin:4px 0 0; font-weight:600; }
.timeline { display:grid; gap:13px; }
.timeline-item { display:flex; gap:10px; align-items:flex-start; }
.timeline-item > div { display:flex; flex-direction:column; }
.timeline-item small { margin-top:2px; }
.inline-alert { margin:16px 0; padding:12px; border-radius:7px; background:#f4f4f4; }
.inline-alert.warning { background:#fff8e6; color:#6d5200; }
.key-code { display:block; padding:12px; font-size:1rem; letter-spacing:.08em; }
.access-list { display:grid; gap:8px; }
.access-row { display:flex; align-items:center; gap:10px; border-bottom:1px solid #eee; padding:9px 0; }
.access-row > span:nth-child(2) { display:flex; flex-direction:column; }

.table-surface { padding:0; overflow:hidden; }
.table-toolbar { display:flex; justify-content:space-between; align-items:center; padding:14px; border-bottom:1px solid var(--border); }
.table-toolbar input { max-width:340px; }
.table-responsive { overflow:auto; }
.data-table { width:100%; border-collapse:collapse; font-size:.83rem; }
.data-table th { text-align:left; font-size:.72rem; text-transform:uppercase; letter-spacing:.04em; color:var(--text-muted); background:#fafafa; }
.data-table th, .data-table td { padding:11px 13px; border-bottom:1px solid #ececec; vertical-align:middle; }
.data-table tbody tr:hover { background:#fbfbfb; }
.table-primary { display:flex; align-items:center; gap:10px; min-width:180px; }
.table-primary > span:last-child { display:flex; flex-direction:column; }
.row-actions, .inline-form { display:flex; align-items:center; gap:5px; }
.row-actions form { margin:0; }
.actions-column { min-width:240px; }
.truncate-cell { max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filter-form { display:flex; gap:8px; margin-bottom:14px; }
.filter-form input { flex:1; }
.pagination { display:flex; justify-content:center; align-items:center; gap:14px; padding:14px; }
.health-overview { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin-bottom:18px; }
.health-card-top { display:flex; justify-content:space-between; align-items:flex-start; }
.health-card h3 { margin-top:14px; }
.health-card dl { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.announcement-type { align-self:flex-start; padding:4px 8px; border-radius:999px; background:#eef6fc; color:var(--accent); font-size:.72rem; }
.announcement-type.critical { color:var(--danger); background:#fdf3f4; }
.announcement-type.warning,.announcement-type.maintenance{color:#7a5900;background:#fff8e6}


html[data-theme="dark"] {
  --bg:#1f1f1f; --surface:#292929; --surface-muted:#242424; --text:#f5f5f5; --text-muted:#c7c7c7;
  --border:#414141; --border-strong:#555; --accent-light:#163a57;
}
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .app-card,
html[data-theme="dark"] .surface,
html[data-theme="dark"] .organization-switcher summary,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .profile-popover,
html[data-theme="dark"] .organization-menu,
html[data-theme="dark"] .organization-option { background:#292929; color:var(--text); }
html[data-theme="dark"] .nav-item:hover,
html[data-theme="dark"] .collapse-button:hover,
html[data-theme="dark"] .profile-popover a:hover,
html[data-theme="dark"] .profile-popover .link-button:hover { background:#353535; }

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg:#1f1f1f; --surface:#292929; --surface-muted:#242424; --text:#f5f5f5; --text-muted:#c7c7c7;
    --border:#414141; --border-strong:#555; --accent-light:#163a57;
  }
  html[data-theme="system"] .sidebar,
  html[data-theme="system"] .topbar,
  html[data-theme="system"] .footer,
  html[data-theme="system"] .app-card,
  html[data-theme="system"] .surface,
  html[data-theme="system"] .organization-switcher summary,
  html[data-theme="system"] input,
  html[data-theme="system"] select,
  html[data-theme="system"] textarea { background:#292929; color:var(--text); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns:1fr; }
  .sidebar { position:fixed; left:-280px; width:256px; box-shadow:var(--shadow-lg); transition:left .2s ease; }
  body.sidebar-open .sidebar { left:0; }
  body.sidebar-collapsed .app-shell { grid-template-columns:1fr; }
  body.sidebar-collapsed .brand-copy,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-item > span:last-child,
  body.sidebar-collapsed .collapse-label { display:initial; }
  body.sidebar-collapsed .nav-item { justify-content:flex-start; }
  .mobile-menu-button { display:grid; }
  .global-search { display:none; }
  .landing-hero { grid-template-columns:1fr; }
  .hero-panel { display:none; }
  .two-column-layout,.detail-layout { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  .topbar { padding:0 12px; gap:8px; }
  .page-heading .eyebrow { display:none; }
  .organization-switcher summary span:nth-child(2) { max-width:110px; overflow:hidden; text-overflow:ellipsis; }
  .topbar-actions .button { display:none; }
  .content { padding:18px 12px 45px; }
  .page-header,.section-heading,.welcome-strip { flex-direction:column; align-items:stretch; }
  .metric-row { display:grid; grid-template-columns:repeat(3,1fr); }
  .metric-card { min-width:0; }
  .landing-hero { padding:44px 22px; }
  .hero-copy h1 { font-size:2.45rem; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:auto; }
  .auth-layout { grid-template-columns:1fr; }
  .auth-aside { display:none; }
  .app-grid { grid-template-columns:1fr; }
  .recent-list { grid-template-columns:1fr; }
  .footer { flex-direction:column; gap:5px; }
  .organization-card,.announcement-admin-card { align-items:flex-start; flex-wrap:wrap; }
  .detail-list { grid-template-columns:1fr; }
}

/* Déploiements production */
.deployment-app-card { display:flex; flex-direction:column; gap:12px; }
.deployment-app-card h3 { margin:4px 0 0; }
.mini-details { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:0; }
.mini-details div { background:#f8f8f8; border-radius:7px; padding:9px; min-width:0; }
.mini-details dt { color:var(--text-muted); font-size:.7rem; }
.mini-details dd { margin:3px 0 0; font-weight:600; overflow-wrap:anywhere; }
.status-success { background:#eaf6ea; color:#0b6a0b; }
.status-muted { background:#f1f1f1; color:#666; }
.progress-track { width:100%; min-width:120px; height:7px; overflow:hidden; background:#e8e8e8; border-radius:999px; }
.progress-track > span { display:block; height:100%; background:var(--accent); border-radius:inherit; transition:width .25s ease; }
.progress-track.large { height:11px; margin:18px 0 8px; }
.deployment-status.queued { background:#edf6ff; color:#0f6cbd; }
.deployment-status.validating, .deployment-status.verifying { background:#fff8e6; color:#805b00; }
.deployment-status.deploying { background:#f3efff; color:#5b38a8; }
.deployment-status.completed, .deployment-status.rolledback { background:#eaf6ea; color:#0b6a0b; }
.deployment-status.failed, .deployment-status.cancelled { background:#fdf3f4; color:#a4262c; }
.upload-dropzone { border:1px dashed #9bb9d0; background:#f8fbfd; border-radius:10px; padding:20px; }
.upload-dropzone input[type=file] { background:white; }
.selected-file { margin-top:10px; padding:9px 11px; background:white; border:1px solid var(--border); border-radius:6px; color:var(--text-muted); }
.deployment-warning { border-left:4px solid var(--warning); background:#fff8e6; padding:14px 16px; border-radius:7px; }
.deployment-warning p { margin:5px 0 0; }
.checkbox-panel { display:flex; align-items:center; background:#f8f8f8; border:1px solid var(--border); border-radius:8px; padding:13px; }
.checkbox-panel .checkbox-row { align-items:flex-start; }
.checkbox-panel small { display:block; margin-top:3px; font-weight:400; }
.critical-confirmation { background:#fff8e6; border-color:#e4c66f; }
.deployment-enable { padding:14px; border:1px solid #b9d7ee; background:#eef6fc; border-radius:8px; }
.deployment-enable small { display:block; margin-top:3px; font-weight:400; }
.deployment-detail-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr); gap:18px; }
.deployment-state-header { display:flex; align-items:center; gap:12px; }
.deployment-percentage { text-align:right; color:var(--text-muted); font-size:.82rem; }
.deployment-guidance ol { padding-left:20px; display:grid; gap:10px; }
.deployment-log { min-height:260px; max-height:620px; overflow:auto; margin:0; padding:16px; background:#111827; color:#d1fae5; border-radius:8px; font:12px/1.55 Consolas,Monaco,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
.hash-value { font-family:Consolas,Monaco,monospace; font-size:.78rem; overflow-wrap:anywhere; }

@media (max-width: 900px) {
  .deployment-detail-grid { grid-template-columns:1fr; }
}


/* Gouvernance, tenants et facturation V2 */
.block { display:block; }
.text-danger { color:var(--danger); }
.empty-state { text-align:center; color:var(--text-muted); padding:32px; }
.governance-matrix th, .governance-matrix td { min-width:170px; vertical-align:top; }
.governance-matrix th:first-child, .governance-matrix td:first-child { min-width:260px; position:sticky; left:0; background:var(--surface); z-index:2; }
.assignment-chip {
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  background:var(--accent-light); color:var(--accent); border:1px solid #c8e1f4;
  border-radius:999px; padding:4px 8px; margin:3px 0; font-size:.75rem; font-weight:600;
}
.assignment-chip form { margin:0; }
.inline-editor { margin-top:8px; }
.inline-editor summary { color:var(--accent); cursor:pointer; font-size:.8rem; }
.compact-form { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin-top:8px; }
.compact-form input, .compact-form select { min-height:34px; max-width:190px; }
.detail-layout { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:20px 0; }
.detail-list { margin:0; }
.detail-list > div { display:grid; grid-template-columns:minmax(130px,.4fr) minmax(0,1fr); gap:18px; padding:11px 0; border-bottom:1px solid var(--border); }
.detail-list > div:last-child { border-bottom:0; }
.detail-list dt { color:var(--text-muted); }
.detail-list dd { margin:0; overflow-wrap:anywhere; }
.log-row td { background:var(--surface-muted); }
.log-row pre { white-space:pre-wrap; max-height:300px; overflow:auto; font-size:.78rem; }
.operator-card { display:flex; flex-direction:column; gap:14px; }
.operator-card-header { display:flex; align-items:flex-start; gap:12px; }
.operator-logo { width:48px; height:48px; object-fit:contain; border-radius:10px; border:1px solid var(--border); }
.qr-preview { width:min(100%,260px); aspect-ratio:1; object-fit:contain; margin:auto; border:1px solid var(--border); border-radius:12px; background:#fff; padding:10px; }
.billing-flow { display:grid; gap:18px; }
.choice-grid, .operator-payment-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.choice-card { display:block; position:relative; cursor:pointer; }
.choice-card > input { position:absolute; top:16px; right:16px; width:18px; height:18px; }
.choice-card > span {
  display:flex; flex-direction:column; gap:7px; min-height:150px; padding:20px 48px 20px 20px;
  border:1px solid var(--border); border-radius:12px; background:var(--surface);
}
.choice-card > input:checked + span { border-color:var(--accent); box-shadow:0 0 0 2px rgba(15,108,189,.14); background:var(--accent-light); }
.choice-card b { font-size:1.35rem; color:var(--text); }
.operator-payment-card > span { min-height:420px; }
.qr-payment { width:220px; max-width:100%; aspect-ratio:1; object-fit:contain; align-self:center; background:#fff; border:1px solid var(--border); border-radius:10px; padding:8px; }
.notice { padding:14px 16px; border-radius:8px; margin:14px 0; border:1px solid var(--border); }
.notice.warning { background:#fff8e1; border-color:#efd58a; color:#684f00; }
.decision-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.decision-card { display:flex; flex-direction:column; gap:12px; padding:18px; border:1px solid var(--border); border-radius:10px; }
.success-card { background:#f3fbf3; border-color:#b8dfb8; }
.danger-card { background:#fff5f6; border-color:#efc1c6; }
@media (max-width:900px) {
  .detail-layout, .decision-grid { grid-template-columns:1fr; }
  .governance-matrix th:first-child, .governance-matrix td:first-child { position:static; }
}


/* Console LP2M Apps V2 */
.governance-metrics { align-items: stretch; flex-wrap: wrap; }
.metric-link { color: inherit; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease; }
.metric-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.metric-link.warning { border-color: var(--warning, #f59e0b); }
