body{font-family:Arial,sans-serif;margin:0;background:#f5f6fa;color:#222}aside{position:fixed;inset:0 auto 0 0;width:240px;background:#9d1010;color:white;padding:24px}aside a{display:block;color:white;text-decoration:none;margin:14px 0;padding:10px;border-radius:8px}aside a:hover{background:#b82222}main{margin-left:270px;padding:28px}.card{background:white;border-radius:14px;padding:20px;margin-bottom:18px;box-shadow:0 6px 18px #0001}.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}table{width:100%;border-collapse:collapse;background:white;border-radius:14px;overflow:hidden}td,th{padding:12px;border-bottom:1px solid #eee;text-align:left}.btn,button{background:#9d1010;color:white;border:0;border-radius:8px;padding:9px 12px;text-decoration:none;cursor:pointer}input,select,textarea{width:100%;box-sizing:border-box;padding:10px;border:1px solid #ddd;border-radius:8px;margin:6px 0 14px}.status-ok{color:green}.status-error,.status-low_battery,.status-low_signal{color:#b00020;font-weight:bold}.login{max-width:380px;margin:80px auto}.login main{margin:0}

.inline{display:inline-block;margin:2px}.primary{font-weight:bold}.muted{opacity:.75} details{margin-top:6px} details form{margin:4px 0} code{background:#f3f4f6;padding:2px 4px;border-radius:4px}
.secondary{background:#555}.danger{background:#b00020}.inline button{margin:2px}.card table form{display:inline-block}summary{cursor:pointer;font-weight:bold;margin:8px 0}details input{max-width:210px;display:inline-block;margin-right:5px}th:last-child,td:last-child{white-space:nowrap}

.warning{background:#fff7ed;border-left:4px solid #f97316;padding:12px;border-radius:8px}.badge{display:inline-block;padding:3px 7px;border-radius:999px;background:#eee}
.notice{background:#eef7ee;border:1px solid #b8ddb8;padding:10px;border-radius:8px;margin:10px 0}.grid.small{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}.grid.small>div{background:#f7f7f7;border-radius:8px;padding:10px}
#units-map{height:430px;border-radius:14px;overflow:hidden;border:1px solid #e5e7eb}.grid.two{grid-template-columns:repeat(2,1fr)}.map-legend{display:flex;gap:12px;flex-wrap:wrap;margin:8px 0 12px}.dot{display:inline-block;width:12px;height:12px;border-radius:50%;vertical-align:-1px;margin-right:5px}.dot.ok{background:#16a34a}.dot.warn{background:#f97316}.dot.bad{background:#dc2626}.dot.unknown{background:#6b7280}.leaflet-popup-content a{color:#9d1010;font-weight:bold}

#dashboard-map{height:480px;border-radius:14px;overflow:hidden;border:1px solid #e5e7eb;position:relative;background:#eef2f7;user-select:none}.tile-layer img{position:absolute;width:256px;height:256px;max-width:none}.marker-layer,.popup-layer{position:absolute;inset:0;pointer-events:none}.map-marker{position:absolute;transform:translate(-50%,-50%);width:16px;height:16px;border-radius:50%;border:2px solid #fff;box-shadow:0 1px 6px #0007;pointer-events:auto;padding:0}.map-marker.antenna{border-radius:3px;width:13px;height:13px;transform:translate(-50%,-50%) rotate(45deg);background:#111827}.map-popup{position:absolute;min-width:230px;max-width:320px;background:white;border-radius:10px;box-shadow:0 8px 30px #0003;padding:12px;pointer-events:auto;z-index:20;font-size:13px}.map-close{float:right;background:#eee;color:#222;padding:2px 7px;border-radius:999px}.zoom-control{position:absolute;right:12px;top:12px;z-index:10;display:grid;gap:4px}.zoom-control button{width:34px;height:34px;padding:0;font-size:20px}.map-toolbar{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:8px 0 12px}.map-toolbar label{display:flex;gap:6px;align-items:center}.map-toolbar input[type=checkbox]{width:auto;margin:0}.map-help{font-size:12px;opacity:.7;margin-top:8px}.dot.antenna{background:#111827;border-radius:3px;transform:rotate(45deg)}
.operator-filters{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.op-dot{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:-1px;margin-right:5px}.op-free{background:#8b5cf6}.op-orange{background:#ea580c}.op-sfr{background:#2563eb}.op-bouygues{background:#db2777}.map-marker.antenna.free{background:#8b5cf6}.map-marker.antenna.orange{background:#ea580c}.map-marker.antenna.sfr{background:#2563eb}.map-marker.antenna.bouygues{background:#db2777}
.sms-template-form{display:inline-block;margin:2px 3px 4px 0;padding:4px;border:1px solid #e5e7eb;border-radius:8px;background:#fff}
.sms-template-form input{width:92px;margin-right:3px;padding:5px;font-size:12px}
textarea{width:100%;box-sizing:border-box;font-family:ui-monospace,Consolas,monospace}
.goip-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:14px}.goip-tile{border:1px solid #e5e7eb;border-radius:14px;padding:14px;background:#fafafa}.goip-title{display:flex;justify-content:space-between;gap:8px;border-bottom:1px solid #e5e7eb;padding-bottom:8px;margin-bottom:8px}.goip-row{display:flex;justify-content:space-between;gap:12px;padding:5px 0}.goip-row span{color:#6b7280}.goip-row strong{text-align:right}.status-dot{display:inline-block;width:11px;height:11px;border-radius:999px;margin-right:6px;vertical-align:-1px;background:#9ca3af}.status-dot.ok{background:#16a34a}.status-dot.warn{background:#f97316}.status-dot.bad{background:#dc2626}.status-dot.unknown{background:#6b7280}.op-other{background:#334155}
.unit-offline{color:#dc2626;font-weight:bold}.status-unreachable{color:#dc2626;font-weight:bold}
.row-error td{background:#fff1f2}.row-error td:last-child{color:#b91c1c;font-weight:bold}

/* v47 - Dashboard GoIP compact */
.goip-compact{padding:26px}
.goip-compact-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:16px}
.goip-compact-head h3{margin:0 0 6px;font-size:24px}
.goip-table-wrap{overflow-x:auto;border:1px solid #e5e7eb;border-radius:16px;background:#fff}
.goip-simple-table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
.goip-simple-table th{background:#f8fafc;color:#475569;text-align:left;font-weight:800;padding:13px 16px;border-bottom:1px solid #e5e7eb;white-space:nowrap}
.goip-simple-table td{padding:14px 16px;border-bottom:1px solid #f1f5f9;vertical-align:middle;white-space:nowrap}
.goip-simple-table tr:last-child td{border-bottom:0}
.status-chip,.signal-cell{display:inline-flex;align-items:center;gap:8px;font-weight:700}
.status-chip.ok{color:#166534}.status-chip.bad{color:#991b1b}
.status-dot{display:inline-block;width:12px;height:12px;border-radius:999px;background:#94a3b8;flex:0 0 auto}
.status-dot.ok{background:#16a34a}.status-dot.warn{background:#f97316}.status-dot.bad{background:#dc2626}.status-dot.unknown{background:#94a3b8}
@media(max-width:700px){.goip-compact-head{display:block}.goip-compact-head .btn{display:inline-block;margin-top:10px}.goip-simple-table th,.goip-simple-table td{padding:11px 12px}}


/* v48 - branding centré et homogène */
.brand-block{text-align:center;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid rgba(255,255,255,.22)}
.brand-logo{display:block;max-width:170px;max-height:90px;width:auto;height:auto;margin:0 auto 10px;object-fit:contain}
.brand-logo-fallback{font-size:38px;line-height:1;margin-bottom:8px}
.brand-title{font-weight:800;font-size:18px;line-height:1.25;word-break:break-word}
.btn.danger,button.danger{background:#b00020}.btn.small,button.small{padding:6px 9px;font-size:12px}.text-danger{color:#b00020;font-weight:700}

/* v51 - responsive mobile et nettoyage utilisateur */
body.is-guest main{margin-left:0;min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px}
body.is-guest .login{width:min(420px,100%);max-width:none;margin:0;text-align:left}
body.is-guest .login h2{text-align:center;margin-top:0;font-size:28px}
body.is-guest .login input{font-size:16px;padding:14px}
body.is-guest .login button{width:100%;padding:14px;font-size:16px}
@media(max-width:800px){
  aside{position:static;width:auto;padding:16px;border-radius:0}aside a{display:inline-block;margin:4px 4px 4px 0;padding:8px 10px}.brand-logo{max-height:62px}.brand-title{font-size:16px}main{margin-left:0;padding:14px}.grid,.grid.two{grid-template-columns:1fr}.card{border-radius:12px;padding:16px}table{display:block;overflow-x:auto;white-space:nowrap}#dashboard-map{height:340px}.map-toolbar{display:block}.map-toolbar label{margin:6px 0}.operator-filters{display:flex;margin-top:8px}.sms-template-form{display:block;width:auto}.sms-template-form button,.btn,button{width:100%;box-sizing:border-box;margin-top:4px}form.inline button, .inline .btn{width:auto}.goip-compact-head{display:block}.goip-table-wrap{border-radius:12px}.goip-simple-table{font-size:13px}.login{width:100%}
}
@media(max-width:480px){body.is-guest main{padding:14px;align-items:flex-start;padding-top:70px}.card.login{box-shadow:0 6px 18px #00000012}.goip-simple-table th,.goip-simple-table td{padding:9px 10px}.status-chip,.signal-cell{gap:5px}.map-legend{font-size:12px}.brand-block{margin-bottom:10px}}

/* v52 - design unité + login/MFA propre */
.login-card{width:min(440px,100%);background:#fff;border-radius:22px;padding:32px;box-shadow:0 20px 60px #0f172a16;box-sizing:border-box}.login-card h2{text-align:center;margin:0 0 22px;font-size:32px}.login-card p{margin:0 0 14px}.login-card input{font-size:16px;padding:14px}.login-card button{width:100%;padding:14px;font-size:16px}.error{color:#b00020;font-weight:700}.page-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.page-head h2{margin:0}.head-actions{display:flex;gap:8px;flex-wrap:wrap}.unit-overview{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin:16px 0 20px}.unit-card{background:#fff;border-radius:16px;padding:18px;box-shadow:0 6px 18px #0001;border:1px solid #eef2f7}.unit-card-label{display:block;color:#64748b;font-size:13px;font-weight:700;margin-bottom:8px}.unit-card strong{font-size:20px}.unit-card small{display:block;color:#64748b;margin-top:4px}.info-list{display:grid;gap:12px;margin:0}.info-list div{display:grid;grid-template-columns:145px 1fr;gap:12px;align-items:start}.info-list dt{font-weight:800;color:#475569}.info-list dd{margin:0;word-break:break-word}.unit-actions-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:14px}.action-card{display:block;padding:16px;margin:0;border:1px solid #e5e7eb;border-radius:16px;background:#fff}.action-card h4{margin:0 0 10px}.action-card input{width:100%;font-size:14px}.action-card button{width:100%;margin-top:8px}.compact-notice{margin-bottom:14px}.responsive-table{overflow-x:auto}.card-table{padding:0}.stacked-meta{display:grid;gap:3px}.actions-cell{white-space:nowrap}.actions-cell .btn,.actions-cell button{margin:2px}
@media(max-width:800px){.page-head{display:block}.head-actions{display:grid;grid-template-columns:1fr;gap:8px;margin-top:12px}.head-actions .btn{width:100%;box-sizing:border-box;text-align:center}.info-list div{grid-template-columns:1fr;gap:3px}.unit-actions-grid{grid-template-columns:1fr}.unit-card strong{font-size:18px}.actions-cell{white-space:normal}.actions-cell .btn,.actions-cell button{width:100%;display:block;box-sizing:border-box}.login-card{padding:24px;border-radius:18px}.login-card h2{font-size:28px}}
.compact-form{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.compact-form select,.compact-form input{width:auto;min-width:130px;margin:0}.compact-form button{margin:0}.admin-only table code{white-space:normal}

/* v61 - SMS non attribués : action admin visible et lisible */
.unassigned-sms-card .table-wrap{overflow-x:auto;}
.unassigned-sms-table{min-width:860px;}
.unassigned-sms-table .message-cell code{white-space:normal;display:block;max-width:520px;line-height:1.35;}
.unassigned-actions{min-width:230px;vertical-align:top;}
.action-panel{position:relative;}
.action-summary{display:inline-block;cursor:pointer;white-space:nowrap;list-style:none;margin:0;}
.action-summary::-webkit-details-marker{display:none;}
.action-panel[open] .action-summary{margin-bottom:10px;}
.unassigned-command-form{display:grid;grid-template-columns:1fr;gap:8px;width:260px;max-width:100%;background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:12px;box-shadow:0 10px 30px #0f172a14;}
.unassigned-command-form label{display:grid;gap:4px;font-size:12px;color:#475569;margin:0;}
.unassigned-command-form input,.unassigned-command-form select{width:100%;box-sizing:border-box;margin:0;padding:8px;border:1px solid #cbd5e1;border-radius:8px;}
.unassigned-command-form button{width:100%;margin:2px 0 0;}
@media(max-width:760px){.unassigned-sms-table{min-width:0}.unassigned-sms-table,.unassigned-sms-table tbody,.unassigned-sms-table tr,.unassigned-sms-table td,.unassigned-sms-table th{display:block;width:100%}.unassigned-sms-table tr:first-child{display:none}.unassigned-sms-table tr{border:1px solid #e5e7eb;border-radius:12px;margin:10px 0;padding:10px}.unassigned-sms-table td{border:0;padding:6px 0}.unassigned-actions{min-width:0}.action-summary,.unassigned-command-form{width:100%;box-sizing:border-box}.unassigned-sms-table .message-cell code{max-width:none}}

/* v63 - SMS non attribués */
.unassigned-page-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}.unassigned-card-clean{display:flex;flex-direction:column;gap:12px}.unassigned-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.sms-body-preview{white-space:pre-wrap;background:#f8fafc;border:1px solid #e5e7eb;border-radius:12px;padding:12px;max-height:140px;overflow:auto}.unassigned-action-box{border-top:1px solid #e5e7eb;padding-top:10px}.unassigned-action-box summary{cursor:pointer;font-weight:700;margin-bottom:10px}.form-grid-3{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}.badge.warning{background:#fff7ed;color:#9a3412;border:1px solid #fed7aa}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* v70 - UI : navigation, états, actions et feedback */
body.is-guest{display:flex;align-items:center;justify-content:center;min-height:100vh}body.is-guest main{margin:0;padding:24px;width:100%;max-width:460px}aside{box-sizing:border-box;overflow-y:auto}.brand-block{display:flex;align-items:center;gap:10px;margin-bottom:18px}.brand-logo{max-width:44px;max-height:44px;border-radius:10px;background:#fff}.brand-logo-fallback{width:42px;height:42px;border-radius:12px;background:rgba(255,255,255,.18);display:flex;align-items:center;justify-content:center;font-size:24px}.brand-title{font-weight:900;line-height:1.15}.nav-section{margin:16px 0 20px}.nav-section>span{display:block;margin:0 0 7px;padding:0 10px;text-transform:uppercase;letter-spacing:.08em;font-size:11px;font-weight:900;color:rgba(255,255,255,.68)}aside a{margin:4px 0;border-left:3px solid transparent}aside a.active{background:rgba(255,255,255,.18);font-weight:800;border-left-color:#fff}.sidebar-search{margin:10px 0 16px}.sidebar-search input{width:100%;box-sizing:border-box;margin:0;padding:11px 12px;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.12);color:#fff;border-radius:10px}.sidebar-search input::placeholder{color:rgba(255,255,255,.78)}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 18px}.page-head h2{margin:0 0 5px;font-size:28px}.head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.dashboard-cards .stat-card{display:block;color:inherit;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease}.dashboard-cards .stat-card:hover{transform:translateY(-2px);box-shadow:0 10px 26px #0002}.stat-card h3{margin-top:0}.stat-card p{font-size:34px;font-weight:900;margin:8px 0}.stat-card span{font-weight:700;color:#64748b}.stat-card.is-alert{border:1px solid #fecaca;background:#fff1f2}.stat-card.is-alert p,.stat-card.is-alert span{color:#b91c1c}.stat-card.is-ok{border:1px solid #bbf7d0;background:#f0fdf4}.stat-card.is-ok p,.stat-card.is-ok span{color:#166534}
@keyframes slideIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}.alert{animation:slideIn .2s ease;display:flex;align-items:center;justify-content:space-between;gap:12px;border-radius:12px;margin:0 0 16px;padding:12px 14px}.alert.success{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534}.alert.error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b}.alert-close{background:transparent!important;color:inherit!important;padding:0 4px;font-size:22px;line-height:1}.empty-state{border:1px dashed #cbd5e1;background:#f8fafc;border-radius:16px;padding:20px;display:grid;gap:8px;align-items:start}.empty-state strong{font-size:17px}.empty-state .btn{width:max-content}.status-pill{display:inline-block;border-radius:999px;padding:5px 9px;font-weight:800;background:#f1f5f9}.status-pill.status-ok{background:#dcfce7;color:#166534}.status-pill.status-low_battery,.status-pill.status-low_signal{background:#fff7ed;color:#9a3412}.status-pill.status-error,.status-pill.status-unreachable{background:#fee2e2;color:#991b1b}.status-pill.status-unknown{background:#e5e7eb;color:#475569}.actions-cell{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}.actions-menu{position:relative;display:inline-block;margin:0}.actions-menu>summary{list-style:none;margin:0}.actions-menu>summary::-webkit-details-marker,details>summary::-webkit-details-marker{display:none}details>summary{list-style:none}.actions-dropdown{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:180px;background:#fff;border:1px solid #e5e7eb;border-radius:12px;box-shadow:0 14px 34px #0f172a24;padding:8px;display:grid;gap:6px}.actions-dropdown a,.actions-dropdown button{display:block;width:100%;box-sizing:border-box;text-align:left;text-decoration:none;border-radius:8px;padding:9px 10px}.actions-dropdown a{color:#111827;background:#f8fafc}.actions-dropdown form{margin:0}.login-brand{display:grid;justify-items:center;gap:10px;margin-bottom:16px;color:#9d1010;font-size:22px}.login-brand .brand-logo-fallback{background:#9d1010;color:#fff}.login-card h2{margin-top:0}summary{cursor:pointer}.card-table{overflow:visible}@media(max-width:900px){aside{position:static;width:auto}.is-auth main{margin-left:0}.grid{grid-template-columns:1fr}.actions-cell{flex-wrap:wrap}.actions-dropdown{position:static;margin-top:6px}}


/* v73 - correctifs sûrs : marque blanche login + carte protégée */
.login-brand .brand-logo{display:block;margin:0 auto 8px;max-width:110px;max-height:86px;width:auto;height:auto;object-fit:contain;background:transparent;border-radius:12px;}
#dashboard-map .map-marker{position:absolute!important;display:block!important;min-width:0!important;min-height:0!important;width:16px!important;height:16px!important;padding:0!important;margin:0!important;border:2px solid #fff!important;border-radius:50%!important;box-shadow:0 1px 6px #0007!important;pointer-events:auto!important;line-height:0!important;font-size:0!important;box-sizing:border-box!important;appearance:none!important;-webkit-appearance:none!important;transform:translate(-50%,-50%)!important;}
#dashboard-map .map-marker.antenna{width:13px!important;height:13px!important;border-radius:3px!important;transform:translate(-50%,-50%) rotate(45deg)!important;}
#dashboard-map .zoom-control button{display:block!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;margin:0!important;}
@media(max-width:800px){#dashboard-map .map-marker{width:16px!important;height:16px!important;}#dashboard-map .map-marker.antenna{width:13px!important;height:13px!important;}.map-toolbar{display:flex;gap:10px;align-items:center;}.map-toolbar label{display:flex;width:auto;margin:4px 8px 4px 0;}.operator-filters{display:flex;gap:8px;margin-top:8px;}.operator-filters label{width:auto;}}


/* v74 - correction centrage logo + responsive sans toucher à la carte métier */
body.is-guest main{
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
}
.login-brand{
  width:min(440px,100%);
  text-align:center;
  margin:0 auto 0;
}
.login-brand .brand-logo{
  display:block;
  margin:0 auto 10px!important;
  max-width:150px;
  max-height:96px;
  width:auto;
  height:auto;
  object-fit:contain;
  background:transparent;
}
.login-brand .brand-logo-fallback{
  margin:0 auto 10px;
}
aside .brand-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:10px;
}
aside .brand-logo{
  display:block;
  margin:0 auto 10px!important;
  max-width:160px;
  max-height:88px;
  width:auto;
  height:auto;
  object-fit:contain;
}
aside .brand-logo-fallback{
  margin:0 auto 8px;
}
@media(max-width:800px){
  body.is-guest main{padding:18px;justify-content:flex-start;padding-top:36px;}
  .login-brand,.login-card{width:100%;max-width:440px;}
  .login-brand strong{display:block;font-size:24px;line-height:1.15;}
  aside .brand-block{padding-bottom:16px;margin-bottom:16px;}
  aside .brand-logo{max-width:130px;max-height:72px;}
}
