:root{--ink:#16253b;--muted:#728096;--navy:#12233b;--navy2:#1c3551;--red:#d52e42;--redh:#af1d32;--border:#e1e8f0;--bg:#f4f7fb;--white:#fff;--blue:#eaf3ff;--row:#f9fbfd;--shadow:0 9px 32px rgba(17,38,62,.07)}
*{box-sizing:border-box}body{margin:0;font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--ink)}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell[hidden],.login-page[hidden],[hidden]{display:none!important}.topbar{height:76px;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 29px;gap:18px}.brand{display:flex;align-items:center;gap:13px}.brand-logo{width:52px;height:52px;object-fit:contain;display:none}.brand-fallback,.login-emblem{display:grid;place-items:center;border:2px solid #8ab2e6;border-radius:12px;background:#243b5c;color:#fff;font-weight:900;letter-spacing:-2px}.brand-fallback{height:49px;width:49px;font-size:24px}.brand-name{font-size:23px;line-height:1.05;font-weight:800;letter-spacing:-.4px}.brand-sub{font-size:9px;color:#b5c5db;letter-spacing:2px;margin-top:4px}.top-actions{display:flex;align-items:center;gap:6px}.who{font-size:12px;color:#b9c9df;margin-right:14px}.btn{border:1px solid transparent;border-radius:8px;padding:9px 15px;font-weight:650;line-height:1.3;transition:background .15s,transform .1s;white-space:nowrap}.btn:hover{filter:brightness(.96)}.btn:active{transform:translateY(1px)}.btn.primary{background:var(--red);color:#fff;box-shadow:0 3px 10px #d52e4229}.btn.primary:hover{background:var(--redh)}.btn.secondary{background:white;color:#43576f;border-color:#d5dfe9}.btn.quiet{background:transparent;color:#e5effb;border-color:#415873}.btn.quiet:hover{background:#243b5a}.btn.danger{background:#fff;color:#bf2340;border-color:#f2bac4}.btn.wide{width:100%}.plus{font-size:19px;margin-right:6px}.content{max-width:1680px;margin:auto;padding:25px 30px 16px}.page-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:21px}.eyebrow{color:#a62c46;font-size:10px;letter-spacing:2px;font-weight:850}.page-heading h1{font-size:30px;letter-spacing:-.8px;margin:3px 0 0;line-height:1.13}.page-heading p{color:var(--muted);margin:7px 0 0}.filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin-bottom:14px}.filters label,.field{font-size:11px;text-transform:uppercase;font-weight:800;letter-spacing:.65px;color:#718095;display:flex;flex-direction:column;gap:6px}.filters input,.filters select,.field input,.field select,.field textarea,.login-card input{min-height:40px;background:#fff;border:1px solid #d9e3ed;border-radius:7px;color:var(--ink);outline-color:#7b9bc5;padding:8px 11px}.filters select{min-width:148px}.search-label{flex:1;min-width:220px}.search-label input{width:100%}.summary{display:flex;align-items:stretch;gap:12px;margin-bottom:15px}.summary>div:not(.summary-hint){min-width:167px;flex:0 1 220px;background:#fff;border:1px solid var(--border);border-radius:9px;display:flex;align-items:center;gap:12px;padding:10px 14px}.summary strong{font-size:24px;font-weight:850;color:#183354;line-height:1}.summary span{font-size:11px;color:var(--muted);line-height:1.25}.summary-hint{margin-left:auto;align-self:center;color:#78869a;font-size:12px}.matrix-card{border:1px solid #dae3ed;background:#fff;border-radius:11px;box-shadow:var(--shadow);overflow:hidden}.matrix-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 17px 12px}.matrix-head h2{font-size:17px;margin:0;letter-spacing:-.2px}.matrix-head span{display:block;margin-top:3px;color:var(--muted);font-size:11px}.head-right{display:flex;gap:9px}.table-scroller{overflow:auto;max-height:calc(100vh - 370px);min-height:230px;scrollbar-color:#bdcddd #f2f6fb}.table-scroller:focus-visible{outline:2px solid #7499d0;outline-offset:-2px}table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed;min-width:1310px;font-size:12px}th,td{border-right:1px solid #edf1f6;border-bottom:1px solid #e9eef4;text-align:left;vertical-align:middle;padding:8px 9px}thead th{position:sticky;top:0;z-index:3;background:#edf2f8;color:#5b7088;font-size:11px;text-transform:uppercase;letter-spacing:.45px;border-top:1px solid #e2e9f1;height:40px}th.name-col,td.name-col{position:sticky;left:0;z-index:2;width:205px;box-shadow:3px 0 5px -5px #72849c}th.name-col{z-index:5}th:not(.name-col):not(.comment-col):not(.more-col){width:110px}.more-col{width:70px}.comment-col{width:245px}tbody tr{background:#fff;cursor:pointer}tbody tr:nth-child(even){background:#f8fafc}tbody tr:hover{background:#eef5fd}tbody tr:hover td.name-col{background:#eef5fd}tbody tr:nth-child(even) td.name-col{background:#f8fafc}tbody tr:nth-child(even):hover td.name-col{background:#eef5fd}tbody td{height:39px}td.name-col{font-weight:700;color:#203854;display:table-cell}td.name-col small{display:block;font-weight:450;color:#9ca7b4;font-size:10px}.mark{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:4px 6px;border-radius:4px;background:#edf3f9;color:#305378;max-width:100%}.mark.new{background:#ddf0e9;color:#0f7653;font-weight:750}.mark.status{background:#fff4e4;color:#8a5a20}.muted-cell{color:#ccd5df}.notes-preview{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#586d83;max-width:100%}.more{font-weight:800;color:#b42b44;text-align:center}.table-footer{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;padding:10px 17px;color:#7f8b9c;font-size:10px;border-top:1px solid #e8edf3}.footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:17px;font-size:11px;color:#95a0af}.login-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 10% 10%,#2b486d,#10233e 65%,#0c1a2e);padding:22px}.login-card{width:min(100%,420px);background:#fff;border-radius:17px;padding:33px;box-shadow:0 20px 60px #06102440}.login-emblem{width:62px;height:62px;margin-bottom:20px;font-size:29px}.login-card h1{font-size:32px;margin:5px 0}.login-card p{color:var(--muted);margin:5px 0 25px}.login-card form{display:grid;gap:14px}.login-card label{font-weight:700;font-size:13px;display:grid;gap:6px}.login-card small{display:block;margin-top:25px;color:#8996a7;font-size:11px}.error-message{color:#ae263e;font-weight:650;min-height:15px}dialog{width:min(740px,calc(100vw - 24px));max-height:calc(100vh - 38px);overflow:auto;border:1px solid #d7e2ef;border-radius:13px;padding:0;color:var(--ink);box-shadow:0 20px 80px #0b1d3259}dialog::backdrop{background:#14283d9e}.modal-header{display:flex;align-items:center;justify-content:space-between;padding:17px 21px;border-bottom:1px solid var(--border);gap:16px;background:#f9fbff}.modal-header h2{margin:0;font-size:20px}.modal-body{padding:20px 22px}.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--border);background:#f9fbfd}.modal-intro{color:#738299;margin:0 0 15px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.form-grid .full{grid-column:1/-1}.field textarea{resize:vertical;min-height:81px;line-height:1.5}.people-entry{padding:14px;background:#f7f9fc;border:1px solid #e3eaf2;border-radius:9px;margin:12px 0}.entry-title{display:flex;justify-content:space-between;align-items:center;font-weight:750;margin-bottom:9px}.history-section{margin:18px 0}.history-section h3{margin:0 0 9px;font-size:14px}.history-entry{border:1px solid #e1e8f0;border-left:4px solid #a6b9cd;border-radius:7px;padding:12px;margin:8px 0}.history-entry.new{border-left-color:#1f976b}.history-entry h4{margin:0 0 4px;font-size:13px}.history-entry p{white-space:pre-wrap;line-height:1.5;margin:6px 0 0}.history-entry small{display:block;color:#7f8d9f;font-size:11px}.note-box{background:#f6f9fc;border:1px solid #e1e9f1;border-radius:8px;padding:12px;margin-bottom:9px}.note-box p{white-space:pre-wrap;margin:6px 0 0}.badge{display:inline-block;background:#eaf0f7;border-radius:4px;color:#5f7489;padding:2px 6px;font-size:10px;font-weight:750}.inline-actions{display:flex;gap:7px;justify-content:flex-end;margin-top:8px}.smallbtn{padding:5px 9px;font-size:11px}.empty-state{text-align:center;padding:46px 18px;color:#7e8da1}#toast{position:fixed;right:20px;bottom:20px;max-width:390px;background:#193c5c;color:#fff;border-radius:9px;padding:13px 16px;box-shadow:0 10px 30px #14243440;display:none;z-index:30}#toast.active{display:block}.loading{color:#8a97a8}.admin-table{width:100%;min-width:0;table-layout:auto}.admin-table td,.admin-table th{font-size:12px}.admin-table th{position:static}.muted{color:#8591a1}.tight{margin:0}a{color:#246eaa}
@media(max-width:950px){.topbar{padding:0 16px}.who{display:none}.content{padding:19px 14px}.summary-hint{display:none}.table-scroller{max-height:calc(100vh - 410px)}}
@media(max-width:680px){.topbar{height:auto;min-height:72px;align-items:flex-start;padding:12px;flex-direction:column}.brand-name{font-size:20px}.top-actions{width:100%;justify-content:flex-end}.top-actions .btn{font-size:11px;padding:7px 10px}.page-heading{align-items:flex-start}.page-heading h1{font-size:25px}.page-heading>.btn{font-size:12px;padding:9px 10px}.filters{gap:9px}.filters label{flex:1 1 44%;min-width:0}.filters .search-label{flex-basis:100%}.filters select{min-width:0;width:100%}.summary{gap:6px}.summary>div:not(.summary-hint){min-width:0;flex:1;display:block;padding:10px}.summary strong{display:block;font-size:23px}.summary span{display:block;margin-top:4px;font-size:10px}.matrix-head{align-items:flex-start;gap:10px;flex-direction:column}.table-scroller{max-height:58vh}table{min-width:1210px}th.name-col,td.name-col{width:164px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:1}.modal-body{padding:14px}.footer{display:block}.footer span{display:block;margin-bottom:5px}}


/* DomarCoach v0.3.2: läsbar förbundslogotyp och Excel-tät översikt. */
.topbar{min-height:83px;height:auto;padding-top:9px;padding-bottom:9px}
.brand{gap:18px;min-width:0}
.brand-logo-frame{display:flex;align-items:center;justify-content:center;width:270px;min-width:270px;height:61px;padding:7px 10px;border-radius:8px;background:#fff;border:1px solid #e4e9ef}
.brand-logo{width:100%;height:100%;object-fit:contain}
.brand-fallback{border-radius:5px;flex-shrink:0}
.brand-name{font-size:24px}
.login-logo-frame{display:flex;align-items:center;justify-content:center;min-height:76px;margin-bottom:20px;padding:10px 12px;border-radius:9px;border:1px solid #e2e8f0;background:#fff}
.login-logo-frame img{display:block;width:100%;max-height:72px;object-fit:contain}

/* Låt sidan skrolla lodrätt i stället för en liten skrollruta inuti tabellen.
   På stor skärm följer kolumnrubrikerna med vid sidans skrollning. */
.matrix-card{overflow:visible}
.table-scroller{overflow:visible;max-height:none;min-height:0}
#matrix{min-width:0;font-size:11.5px}
#matrix thead th{position:sticky;top:0;height:34px;padding:5px 7px;z-index:3;background:#eaf0f7;box-shadow:0 1px 0 #dce5ed}
#matrix thead th.name-col{z-index:7}
#matrix th.name-col,#matrix td.name-col{width:196px}
#matrix th:not(.name-col):not(.comment-col):not(.more-col){width:100px}
#matrix .more-col{width:61px}
#matrix .comment-col{width:330px}
#matrix tbody td{height:30px;max-height:none;padding:3px 7px;line-height:1.18}
#matrix tbody td.name-col{font-weight:700}
#matrix tbody td.name-col small{font-size:9.5px;margin-top:1px}
#matrix .mark{padding:3px 5px;line-height:1.2}
#matrix .notes-preview{line-height:1.25}
#matrix .notes-preview[data-comment]{cursor:help;text-decoration:underline dotted #b0bbca;text-underline-offset:3px}
#matrix .notes-preview[data-comment]:focus-visible{outline:2px solid #5485b7;outline-offset:2px;border-radius:2px}
#matrix tbody tr:hover{background:#f0f6fe}

/* Egen kommentarshjälp, inte webbläsarens lilla fördröjda title-ruta. */
.comment-tooltip{position:fixed;z-index:100;max-width:min(520px,calc(100vw - 24px));max-height:min(58vh,520px);overflow:auto;background:#fff;color:#19314c;border:1px solid #b8c9da;border-radius:9px;box-shadow:0 12px 36px #0d27404d;padding:13px 15px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.5;pointer-events:auto}
.comment-tooltip[hidden]{display:none!important}
.comment-tooltip-label{font-size:10px;color:#687e95;letter-spacing:.7px;font-weight:800;text-transform:uppercase;margin-bottom:8px}
#comment-tooltip-text{white-space:pre-wrap}

@media (max-width:1450px){
  .table-scroller{overflow-x:auto;overflow-y:visible}
  #matrix{min-width:1230px}
  #matrix .comment-col{width:265px}
}
@media (max-width:950px){
  .brand-logo-frame{width:226px;min-width:226px;height:54px;padding:6px 8px}
  .brand-name{font-size:21px}
  .topbar{padding:8px 14px}
}
@media (max-width:680px){
  .topbar{min-height:unset;padding:10px 12px}
  .brand{gap:10px;width:100%}
  .brand-logo-frame{width:180px;min-width:180px;height:46px;padding:5px 6px}
  .brand-name{font-size:18px}
  .brand-sub{font-size:7px;letter-spacing:1px}
  .top-actions{flex-wrap:wrap;gap:5px}
  .top-actions .btn{padding:6px 9px}
  .table-scroller{max-height:none;min-height:0}
  #matrix{min-width:1190px}
  #matrix tbody td{height:29px}
}

/* 0.3.3 – tydlig domaradministration */
.history-manage{margin-bottom:14px;display:flex;justify-content:flex-end}
.ref-status{background:#f4f7fb;border:1px solid #dce6ef;border-radius:8px;padding:12px 14px;margin-top:17px}
.ref-status p{margin:6px 0 0;font-size:12px}
.admin-table-wrap{overflow:auto;max-height:54vh;margin-top:13px;border:1px solid #e2e8f0;border-radius:8px}
.admin-table-wrap .admin-table th{background:#eaf0f7;position:sticky;top:0;z-index:1}
.admin-table-wrap .admin-table td{padding:7px 9px}
.admin-table-wrap tr[hidden]{display:none}
#btn-manage-ref{background:#eaf3ff;color:#244c79}
@media(max-width:680px){.matrix-head .head-right{flex-wrap:wrap}.modal-footer{flex-wrap:wrap}}

/* 0.3.4 – senaste coachningskommentaren först, annars äldre Excelanteckning.
   Tre läsrader + informationsrad; endast rader med text växer. */
#matrix th.comment-col{width:365px}
#matrix tbody td{height:auto;min-height:30px;vertical-align:middle;padding:5px 7px}
#matrix .comment-cell{display:flex;flex-direction:column;gap:3px;min-width:0;padding:1px 0 2px}
#matrix .comment-meta{display:block;align-self:flex-start;font-size:10px;line-height:1.2;font-weight:750;letter-spacing:.05px;color:#246149}
#matrix .comment-legacy .comment-meta{color:#6b778b}
#matrix .notes-preview{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;text-overflow:ellipsis;white-space:normal;overflow-wrap:anywhere;line-height:1.33;max-width:100%;color:#334d68;font-size:11.5px}
#matrix .notes-preview[data-comment]{text-decoration:none;cursor:help}
#matrix .notes-preview[data-comment]:hover{text-decoration:underline dotted #9aacbe;text-underline-offset:2px}
#matrix .comment-new .notes-preview{color:#153d31}
#matrix .mark{white-space:nowrap}
@media(max-width:1450px){#matrix th.comment-col{width:310px}}
@media(max-width:680px){#matrix th.comment-col{width:300px}}

/* 0.3.5: tydlig varning vid blandade frontend/backend-versioner */
.version-warning:not([hidden]) { border: 1px solid #be7e17; border-radius: 8px; background: #fff4d5; color: #583600; padding: 12px 16px; margin: 12px 0; font-weight: 600; line-height: 1.4; }


/* DomarCoach 0.3.6 – tydlig uppdelning av aktuell/vald säsong och äldre data. */
.history-focus{border:1px solid #c9dceb;background:#f6faff;border-radius:10px;padding:14px 16px;margin:14px 0 24px}
.history-focus-heading{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:7px}
.history-focus-heading h3{font-size:20px;margin:0;color:#183653}
.current-badge{background:#e0f0fa;color:#18567b;font-size:11px;padding:4px 9px}
.history-explainer{font-size:12px;color:#5b7085;line-height:1.45;margin:5px 0 15px}
.history-focus .history-section{margin:17px 0 0}
.history-section h4{font-size:13px;margin:0 0 7px;color:#1f3c59}
.history-empty{font-size:12px;margin:4px 0 10px}
.history-entry-kicker{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-bottom:6px}
.excel-badge{background:#e8eef5;color:#49647f}
.web-badge{background:#e0f5eb;color:#176b48}
.history-entry.new{background:#fbfefc}
.history-entry small{margin-top:7px}
.note-box small{display:block;font-size:11px;margin-top:8px}
.history-previous{margin:18px 0 3px}
.history-previous>h3{margin:0 0 12px;font-size:17px;color:#203b59}
.history-year{border:1px solid #e0e8f1;border-radius:8px;background:#fff;margin:9px 0;overflow:hidden}
.history-year>summary{cursor:pointer;display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 14px;background:#f3f6fa;font-weight:750;color:#284562}
.history-year[open]>summary{border-bottom:1px solid #e4ebf3}
.history-year-count{font-size:11px;font-weight:500;color:#718498}
.history-year-body{padding:10px 14px}
.history-year-body article:last-child{margin-bottom:0}
@media(max-width:680px){.history-focus{padding:12px}.history-year>summary{align-items:flex-start;flex-direction:column;gap:3px}}

/* 0.3.7: en gemensam coachningshistorik utan synliga källmarkörer. */
.history-focus .history-section{margin:12px 0 0}
.history-focus .history-section>h4{margin-bottom:12px}
.history-entry{background:#fff;border-left-color:#8fa9c1}
.history-entry.season-note{background:#fbfcfe;border-left-color:#8fa9c1}
.note-badge{background:#edf2f7;color:#475e76}
.history-entry .history-entry-kicker{margin-bottom:6px}
.history-entry h4{margin:0 0 5px;font-size:13px;color:#1f3c59}
.history-entry p{overflow-wrap:anywhere}


/* 0.3.9 – Färgen visar SÄSONG, aldrig registreringskälla.
   Alla historikkort i senaste säsongen är gröna (även importerade anteckningar);
   poster i äldre säsonger är neutralt grå oavsett datakälla. */
.history-focus.is-current .history-entry,
.history-year.is-current .history-entry {
  border-left-color: #249568;
}
.history-focus.is-previous .history-entry,
.history-year.is-previous .history-entry {
  border-left-color: #9daab9;
}
.history-focus.is-current .current-badge {
  background: #e2f4e9;
  color: #176c46;
}

/* 0.3.9 – Snabbregistrering i tom coachningsruta. Klickbara celler, inte
   nya datapositioner: första tomma rutan får ett diskret grönt plustecken. */
#matrix td.quick-add-cell{padding:2px 4px;cursor:pointer}
#matrix .quick-add{display:block;width:100%;min-height:30px;border:1px solid transparent;background:transparent;color:#b6c4d1;border-radius:5px;text-align:left;padding:3px 7px;font-size:13px;cursor:pointer}
#matrix .quick-add-next{color:#237d5a;font-weight:850;background:#ecf7f0}
#matrix .quick-add:hover,#matrix .quick-add:focus-visible{color:#116a46;background:#e0f4e9;border-color:#82c4a5;outline-offset:1px}
#matrix .quick-add:not(.quick-add-next):hover span,#matrix .quick-add:not(.quick-add-next):focus-visible span{font-size:0}
#matrix .quick-add:not(.quick-add-next):hover span::after,#matrix .quick-add:not(.quick-add-next):focus-visible span::after{content:"＋";font-size:13px}

#matrix td.quick-add-cell:hover .quick-add{color:#116a46;background:#e0f4e9;border-color:#82c4a5}


/* DomarCoach 0.3.10 – klickstyrd hjälpguide i pratbubblor. */
.guide-toggle{border-color:#5b7190!important;white-space:nowrap}
.guide-toggle[aria-pressed="true"]{background:#e8f6ee;color:#125d3b;border-color:#73b895!important}
.guide-target{outline:3px solid #e7a83d!important;outline-offset:3px!important;box-shadow:0 0 0 6px rgba(231,168,61,.12)!important;border-radius:5px;position:relative;z-index:7}
.guide-bubble{position:fixed;z-index:9999;width:min(325px,calc(100vw - 24px));max-width:calc(100vw - 24px);padding:14px 16px;background:#fff;border:1px solid #9cb8d4;border-radius:13px;box-shadow:0 15px 44px rgba(15,37,62,.27);color:#1b2d45;font-size:13px;line-height:1.45;text-align:left}
.guide-bubble::before{content:"";position:absolute;top:-7px;left:21px;width:12px;height:12px;background:#fff;transform:rotate(45deg);border-top:1px solid #9cb8d4;border-left:1px solid #9cb8d4}
.guide-bubble.guide-above::before{top:auto;bottom:-7px;transform:rotate(225deg)}
.guide-bubble-heading{display:flex;justify-content:space-between;align-items:center;color:#61738a;font-weight:750;font-size:11px;margin-bottom:6px}
#guide-dismiss{background:none;border:0;padding:2px 7px;color:#546985;font-size:18px;border-radius:5px}
#guide-dismiss:hover{background:#eef3f9}
#guide-title{display:block;font-size:16px;color:#142d49}
#guide-description{margin:5px 0 13px;white-space:normal;color:#435976}
.guide-bubble-actions{display:flex;align-items:center;justify-content:space-between;gap:9px;border-top:1px solid #e6edf5;padding-top:10px}
.guide-bubble-actions .btn{font-size:11px;padding:6px 9px}
.guide-bubble-actions span{font-size:10px;color:#75859b;max-width:180px;text-align:right}
@media(max-width:760px){.topbar{height:auto;min-height:76px;flex-wrap:wrap;padding:9px 16px}.top-actions{flex-wrap:wrap}.guide-bubble{width:min(310px,calc(100vw - 24px))}}
@media(prefers-reduced-motion:reduce){.guide-target{scroll-behavior:auto}}
