/* FM27 V10.86 R27 – targeted redesign. All selectors deliberately scoped. */
/* Fully use large monitors without widening type or making nested cards. */
body.fm27-midnight .ws-app.fm27-app:has(#fm27-manager-portal){max-width:none;width:100%;padding-inline:clamp(12px,1.65vw,38px)}
body.fm27-midnight .fm27-home-dashboard .fmh-top{grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(12px,1vw,20px)}
body.fm27-midnight .fm27-home-dashboard .fmh-bottom{gap:clamp(12px,1vw,20px)}
body.fm27-midnight .fmh-lineup-status{display:flex;align-items:center;justify-content:center;gap:7px;margin:7px 14px 5px;font-size:.78rem;color:#ffcd80}
body.fm27-midnight .fmh-lineup-status.is-ready{color:#5ae6a7}
body.fm27-midnight .fmh-live-row.is-finished .fmh-minute{background:#273a54;border-color:#55718e;color:#e2ecfb;min-width:38px;font-size:.74rem}
body.fm27-midnight .fmh-transfer-phase{display:flex;align-items:center;gap:10px;padding:11px 12px;margin:9px 11px 10px;border:1px solid #2d4668;border-radius:8px;background:rgba(35,57,84,.35);color:#ecf4ff;text-decoration:none;font-size:.78rem}
body.fm27-midnight .fmh-transfer-phase:hover{border-color:#4ea982;color:#baf5d6}
body.fm27-midnight .fmh-transfer-phase>i{color:#58db9c;font-size:1.05rem}
body.fm27-midnight .fmh-transfer-phase>span:nth-child(2){display:grid;gap:3px;flex:1;min-width:0}
body.fm27-midnight .fmh-transfer-phase small{font-size:.72rem;color:#9eafc9}
body.fm27-midnight .fmh-phase-dot{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#8896ad}
body.fm27-midnight .fmh-phase-dot.is-open{background:#42e5a2;box-shadow:0 0 0 4px rgba(66,229,162,.13)}
/* recruitment list – compact factual table, no duplicate navigation on market */
body.fm27-midnight .fm27-r27-actionbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
body.fm27-midnight .fm27-r27-actionbar a{display:inline-flex;gap:8px;align-items:center}
body.fm27-midnight .fm27-recruitment-table th:first-child,body.fm27-midnight .fm27-recruitment-table td:first-child{width:76px;min-width:76px;white-space:nowrap}
body.fm27-midnight .fm27-market-person,body.fm27-midnight .fm27-market-club-name{display:inline-flex;align-items:center;gap:8px;text-decoration:none;max-width:260px}
body.fm27-midnight .fm27-market-person>a,body.fm27-midnight .fm27-market-club-name>span{line-height:1.25;overflow-wrap:anywhere}
body.fm27-midnight .fm27-market-avatar{display:grid;place-items:center;width:32px;height:32px;min-width:32px;border-radius:8px;background:#233550;color:#b8cbe3;overflow:hidden}
body.fm27-midnight .fm27-market-avatar img{width:100%;height:100%;object-fit:cover}
body.fm27-midnight .fm27-market-club-name img{width:23px;height:23px;object-fit:contain;flex-shrink:0}
body.fm27-midnight .fm27-market-nation{display:inline-flex;align-items:center;gap:7px;white-space:nowrap;font-size:.79rem}
body.fm27-midnight .fm27-market-nation img{height:16px;width:24px;object-fit:contain}
body.fm27-midnight .fm27-recruitment-table .fm27-contract-seasons{white-space:nowrap}
body.fm27-midnight #market-search{border:0;background:transparent;box-shadow:none}
body.fm27-midnight #market-search>.card-body{padding:13px 0}
/* roster table */
body.fm27-midnight .fm27-v8528-positions{max-width:105px!important;width:105px;white-space:nowrap;font-size:.76rem;letter-spacing:-.015em}
body.fm27-midnight .fm27-v8528-nation{gap:5px;white-space:nowrap;font-size:.78rem}
body.fm27-midnight .fm27-r27-status-icon{color:#b0c8df;font-size:.86rem}
body.fm27-midnight .fm27-r27-captain-icon{color:#eabf54;font-size:.92rem}
body.fm27-midnight .fm27-r27-player-actions{display:inline-flex;gap:5px;align-items:center;padding:4px 9px;border-radius:8px;font-size:.75rem}
/* team formation preview, never imply submission */
body.fm27-midnight .fm27-r27-no-fixture{background:rgba(47,74,101,.2);border-color:#456782;color:#c6d8ec}
body.fm27-midnight .fm27-r27-no-match-label{color:#cbd9e7}
body.fm27-midnight .fm27-v69-save[disabled]{opacity:.45;filter:grayscale(.6);cursor:not-allowed}
/* finance – one continuous surface; remove nested tile hierarchy */
body.fm27-midnight .fm27-finance{border-radius:10px;overflow:hidden}
body.fm27-midnight .fm27-finance-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0!important;background:transparent!important;border:0!important;padding:0!important}
body.fm27-midnight .fm27-finance-kpis>div{border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;border-right:1px solid #314761!important;padding:15px 17px!important;min-width:0}
body.fm27-midnight .fm27-finance-kpis>div:last-child{border-right:0!important}
body.fm27-midnight .fm27-budget-adjust{border-top:1px solid #304967;border-radius:0!important;box-shadow:none!important}
body.fm27-midnight #accountStatementTable{border-collapse:collapse;min-width:560px}
body.fm27-midnight #accountStatementTable th{font-weight:700;text-transform:uppercase;letter-spacing:.035em;font-size:.73rem;background:#192a40;border-bottom:1px solid #435d75}
body.fm27-midnight #accountStatementTable tbody tr{background:transparent!important}
body.fm27-midnight #accountStatementTable td{padding:12px 13px;border-bottom:1px solid rgba(135,159,190,.16);font-size:.83rem;vertical-align:middle}
body.fm27-midnight #accountStatementTable td:last-child{text-align:right;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
body.fm27-midnight .fm27-finance-ledger-title{margin-top:25px}
/* Friendly fixtures */
body.fm27-midnight .fm27-r27-friendlies{display:grid;gap:15px}
body.fm27-midnight .fm27-r27-friendlies-intro{display:flex;gap:12px;align-items:flex-start;border-bottom:1px solid #344c65;color:#a8bfd7;font-size:.84rem;padding:10px 0 18px}
body.fm27-midnight .fm27-r27-friendlies-intro .bi{font-size:1.1rem;color:#55d59c}
body.fm27-midnight .fm27-r27-friendlies section{background:#112037;border:1px solid #304865;border-radius:10px;padding:17px 20px}
body.fm27-midnight .fm27-r27-friendlies h2{font-size:1rem;margin:0 0 16px}
body.fm27-midnight .fm27-r27-friendly-compose form{margin-bottom:0!important}
body.fm27-midnight .fm27-r27-friendly-history table{margin-bottom:0}
/* Stadion – ticket prices integrated in tribunes, four maintenance points in stadium info */
body.fm27-midnight .fm27-r27-ticket-inline{margin:14px 0 0;padding:15px 0 12px;border-top:1px solid #334861}
body.fm27-midnight .fm27-r27-ticket-header{display:flex;align-items:baseline;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
body.fm27-midnight .fm27-r27-ticket-header h3{font-size:.98rem;margin:0;display:flex;gap:8px;align-items:center}
body.fm27-midnight .fm27-r27-ticket-header small{color:#9fb3ca;font-size:.72rem}
body.fm27-midnight .fm27-r27-ticket-form{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:end;gap:9px}
body.fm27-midnight .fm27-r27-ticket-form label{display:flex;flex-direction:column;gap:6px;min-width:0;font-size:.73rem;color:#b9c9dd}
body.fm27-midnight .fm27-r27-ticket-form button{grid-column:1/-1;justify-self:end;margin-top:5px}
body.fm27-midnight .fm27-r27-maintenance{border-top:1px solid rgba(95,123,152,.3);margin-top:12px;padding-top:13px}
body.fm27-midnight .fm27-r27-maintenance h3{font-size:.97rem;margin:0 0 5px}
body.fm27-midnight .fm27-r27-maintenance p{font-size:.76rem;color:#a6bcd5}
body.fm27-midnight .fm27-r27-maintenance .fm27-stadium-upgrades{width:100%;font-size:.79rem;margin-top:9px}
body.fm27-midnight .fm27-r27-maintenance .fm27-stadium-upgrades td{padding:7px 4px;border-color:#334962}
body.fm27-midnight .fm27-r27-maintenance .fm27-stadium-upgrades .bi-star{color:#657993}
body.fm27-midnight .fm27-r27-maintenance .fm27-stadium-upgrades .bi-star-fill{color:#d9b95e}
body.fm27-midnight .fm27-s74-service .fm27-s742-tabpanel{display:block!important;visibility:visible!important;opacity:1!important;height:auto!important;max-height:none!important}
body.fm27-midnight .fm27-s74-service .fm27-s74-service-nav{display:none!important}
/* World league: selector left, actions right */
body.fm27-midnight .fm27-r27-league-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
body.fm27-midnight .fm27-r27-league-select{display:flex;align-items:center;gap:11px;min-width:min(100%,290px);flex:1 1 380px;margin:0}
body.fm27-midnight .fm27-r27-league-select label{font-size:.82rem;white-space:nowrap;margin:0}
body.fm27-midnight .fm27-r27-league-select select{width:auto;min-width:220px;flex:1;max-width:450px}
body.fm27-midnight .fm27-r27-league-links{display:flex;gap:14px;align-items:center;margin-left:auto}
body.fm27-midnight .fm27-r27-league-links a{display:inline-flex;gap:7px;align-items:center;text-decoration:none;font-size:.82rem}
/* Training/camp – presentation only; costs and training effects unchanged */
body.fm27-midnight #trainersTable,body.fm27-midnight .fm27-r27-camp-table{border-collapse:collapse}
body.fm27-midnight #trainersTable thead,body.fm27-midnight .fm27-r27-camp-table thead{background:#1b2d46}
body.fm27-midnight #trainersTable td,body.fm27-midnight .fm27-r27-camp-table td{padding:13px 12px;border-bottom:1px solid #344965;vertical-align:middle}
body.fm27-midnight #trainersTable td:first-child p,body.fm27-midnight .fm27-r27-camp-table td:first-child p{margin:0 0 5px}
body.fm27-midnight #trainersTable td:last-child .progress,body.fm27-midnight .fm27-r27-camp-table .progress{max-width:145px}
@media(max-width:1250px){body.fm27-midnight .fm27-r27-ticket-form{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){body.fm27-midnight .fm27-home-dashboard .fmh-top{grid-template-columns:1fr}body.fm27-midnight .fm27-finance-kpis{grid-template-columns:1fr}body.fm27-midnight .fm27-finance-kpis>div{border-right:0!important;border-bottom:1px solid #314761!important}body.fm27-midnight .fm27-r27-ticket-form{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){body.fm27-midnight .fm27-r27-ticket-form{grid-template-columns:1fr}body.fm27-midnight .fm27-r27-league-select{flex-direction:column;align-items:stretch;min-width:0}body.fm27-midnight .fm27-r27-league-select select{width:100%;min-width:0}body.fm27-midnight .fm27-r27-league-links{margin-left:0}}

/* Youth, trainers and camps: one shared light-weight table rhythm. */
body.fm27-midnight .fm27-r27-development-intro{display:flex;gap:12px;align-items:center;margin:10px 0 17px;padding:12px 16px;border-radius:9px;border:1px solid #2e465c;background:rgba(31,53,78,.35)}
body.fm27-midnight .fm27-r27-development-intro>i{font-size:1.3rem;color:#65dbaa}
body.fm27-midnight .fm27-r27-development-intro span{display:grid;gap:3px}
body.fm27-midnight .fm27-r27-development-intro small{color:#a9bed5}
body.fm27-midnight .fm27-r27-coach-rating{font-variant-numeric:tabular-nums;font-weight:700;color:#eaf3ff}
body.fm27-midnight .fm27-r27-coach-rating small{color:#a6bdd6;font-size:.73rem;font-weight:400}
body.fm27-midnight .fm27-r27-youth-table{border-collapse:collapse}
body.fm27-midnight .fm27-r27-youth-table thead{background:#1b2d46}
body.fm27-midnight .fm27-r27-youth-table td{padding:11px 13px;border-bottom:1px solid #314762;vertical-align:middle}
body.fm27-midnight .fm27-r27-youth-table td>p{margin:0 0 6px}
body.fm27-midnight .fm27-r27-youth-table .dropdown-toggle{border-radius:8px}

/* R27.1 – transfermarket, actions, youth roster, stadium merge. */
body.fm27-midnight .fm27-market-club-head,body.fm27-midnight .fm27-market-club-cell{width:auto!important;min-width:155px!important;max-width:none!important;text-align:left!important;padding:12px 10px!important}
body.fm27-midnight .fm27-market-club-cell .fm27-market-club-name{display:inline-flex!important;align-items:center!important;gap:8px;max-width:none!important;white-space:normal!important}
body.fm27-midnight .fm27-market-club-cell .fm27-market-club-name img{width:24px!important;height:24px!important;max-width:none!important;max-height:none!important;border-radius:0!important;background:none!important;border:0!important;padding:0!important}
body.fm27-midnight .fm27-market-person>a,body.fm27-midnight .fm27-market-club-name>span{overflow-wrap:normal;word-break:normal}
body.fm27-midnight .fm27-market-nation b,body.fm27-midnight .fm27-v8528-nation b{font-weight:700;letter-spacing:.02em}
body.fm27-midnight .fm27-r27-inline-actions .dropdown-menu,body.fm27-midnight .fm27-profile-actions .dropdown-menu{background:#1a2640;border:1px solid #4d5d79;border-radius:12px;box-shadow:0 16px 34px rgba(2,8,20,.34);padding:8px;min-width:240px}
body.fm27-midnight .fm27-r27-inline-actions .dropdown-item,body.fm27-midnight .fm27-profile-actions .dropdown-item{border-radius:9px;padding:9px 11px;display:flex;align-items:center;gap:9px;color:#eef4ff}
body.fm27-midnight .fm27-r27-inline-actions .dropdown-item:hover,body.fm27-midnight .fm27-r27-inline-actions .dropdown-item:focus,body.fm27-midnight .fm27-profile-actions .dropdown-item:hover,body.fm27-midnight .fm27-profile-actions .dropdown-item:focus{background:#233552;color:#fff}
body.fm27-midnight .fm27-r27-inline-actions .dropdown-item.text-danger{color:#ffb3b3}
body.fm27-midnight .fm27-r27-inline-actions .dropdown-item.text-danger:hover{color:#fff;background:#573242}
body.fm27-midnight .fm27-r27-inline-action-toggle{border-radius:10px;box-shadow:none}
body.fm27-midnight .fm27-finance-ledger-panel{background:#121b30;border:1px solid #303b55;border-radius:12px;overflow:hidden;margin-bottom:10px}
body.fm27-midnight .fm27-finance-ledger-table{margin-bottom:0}
body.fm27-midnight .fm27-finance-ledger-table thead th{background:#1a2740!important}
body.fm27-midnight .fm27-r27-ticket-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
body.fm27-midnight .fm27-r27-ticket-card{background:rgba(26,40,61,.72);border:1px solid #39516f;border-radius:10px;padding:11px 10px 10px;display:flex;flex-direction:column;gap:6px}
body.fm27-midnight .fm27-r27-ticket-card input{background:#13203a;border:1px solid #51627e;color:#fff}
body.fm27-midnight .fm27-r27-ticket-card small{color:#95abc4;font-size:.7rem}
body.fm27-midnight .fm27-r27-maintenance-merged{border-top:1px solid rgba(95,123,152,.3);margin-top:14px;padding-top:14px}
body.fm27-midnight .fm27-r27-maintenance-merged h3{font-size:.97rem;margin:0 0 10px}
body.fm27-midnight .fm27-r27-maintenance-cards{display:grid;grid-template-columns:1fr;gap:10px}
body.fm27-midnight .fm27-r27-maintenance-card{display:flex;justify-content:space-between;gap:12px;align-items:center;background:rgba(28,40,61,.55);border:1px solid #38506d;border-radius:10px;padding:10px 12px}
body.fm27-midnight .fm27-r27-maintenance-main{display:grid;gap:4px;min-width:0}
body.fm27-midnight .fm27-r27-maintenance-title{font-weight:700;font-size:.83rem;color:#edf4ff}
body.fm27-midnight .fm27-r27-maintenance-rating .bi-star{color:#667a93}
body.fm27-midnight .fm27-r27-maintenance-rating .bi-star-fill{color:#e1bf5c}
body.fm27-midnight .fm27-r27-maintenance-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;text-align:right}
body.fm27-midnight .fm27-r27-maintenance-actions.is-max span{font-weight:700;color:#dfe9f8}
body.fm27-midnight .fm27-r27-maintenance-actions .btn{white-space:nowrap}
body.fm27-midnight .fm27-r27-youth-table .fm27-v8528-avatar{background:#22344f;color:#c1d3ea}
body.fm27-midnight .fm27-r27-youth-table .fm27-v8528-rating{display:flex;align-items:center;gap:7px}
body.fm27-midnight .fm27-r27-youth-table .fm27-v8528-rating .badge{font-size:.68rem}
@media(max-width:1250px){body.fm27-midnight .fm27-r27-ticket-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:900px){body.fm27-midnight .fm27-market-club-head,body.fm27-midnight .fm27-market-club-cell{min-width:135px!important}body.fm27-midnight .fm27-r27-ticket-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body.fm27-midnight .fm27-r27-maintenance-card{flex-direction:column;align-items:flex-start}body.fm27-midnight .fm27-r27-maintenance-actions{text-align:left;justify-content:flex-start}}
@media(max-width:520px){body.fm27-midnight .fm27-r27-ticket-grid{grid-template-columns:1fr}}
