/* ==========================================================
   NU ADMIN UI
   Gemensamt designsystem för hela administrationen
   ========================================================== */

body.adminbody {
    --admin-width: 1380px;
    --nu-blue: #0B0D63;
    --nu-turquoise: #d9f3ef;
    --ui-bg: #f4faf9;
    --ui-surface: #ffffff;
    --ui-line: #d8e8e6;
    --ui-soft: #e9f7f6;

    margin: 0;
    background: var(--ui-bg);
    color: var(--nu-blue);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

body.adminbody *,
body.adminbody *::before,
body.adminbody *::after {
    box-sizing: border-box;
}

body.adminbody,
body.adminbody h1,
body.adminbody h2,
body.adminbody h3,
body.adminbody p,
body.adminbody label,
body.adminbody strong,
body.adminbody th,
body.adminbody td,
body.adminbody .muted {
    color: var(--nu-blue);
}


/* ==========================================================
   SIDLAYOUT
   ========================================================== */

body.adminbody .admin-shell {
    width: calc(100% - 64px);
    max-width: var(--admin-width);
    margin-left: auto;
    margin-right: auto;
}

body.adminbody .wrap {
    margin-top: 24px;
    padding-bottom: 48px;
}


/* ==========================================================
   HEADER
   ========================================================== */

body.adminbody .top {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    height: 76px;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid var(--ui-line);
}

body.adminbody .top-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
}

body.adminbody .brand {
    display: flex;
    align-items: center;
}

body.adminbody .brand img {
    display: block;
    width: 170px;
    height: auto;
}

body.adminbody .top-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

body.adminbody .top-right a {
    color: var(--nu-blue);
}

body.adminbody .role-badge {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}


/* ==========================================================
   NAVIGATION
   ========================================================== */

body.adminbody .mainnav,
body.adminbody .subnav {
    display: flex;
    align-items: center;
    gap: 8px;
}

body.adminbody .mainnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}

body.adminbody .mainnav::-webkit-scrollbar {
    display: none;
}

body.adminbody .subnav {
    flex-wrap: wrap;
}

body.adminbody .mainnav {
    margin: 0 0 22px;
}

body.adminbody .subnav {
    margin: 0 0 18px;
}

body.adminbody .mainnav a,
body.adminbody .subnav a,
body.adminbody .image-folder-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--ui-line);
    border-radius: 999px;
    background: #fff;
    color: var(--nu-blue);
    font-weight: 700;
}

body.adminbody .mainnav a,
body.adminbody .subnav a,
body.adminbody .image-folder-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 7px 12px;
    font-size: 13px;
}

body.adminbody .mainnav a.active,
body.adminbody .subnav a.active,
body.adminbody .image-folder-link.active {
    background: var(--nu-turquoise);
    border-color: var(--nu-turquoise);
    color: var(--nu-blue);
}


/* ==========================================================
   TYPOGRAFI
   ========================================================== */

body.adminbody h1 {
    margin: 0 0 18px;
    font-size: 32px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -.02em;
}

body.adminbody h2 {
    margin: 22px 0 10px;
    font-size: 21px;
    line-height: 1.2;
    font-weight: 750;
}

body.adminbody h3 {
    margin: 12px 0 8px;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 750;
}

body.adminbody .small {
    font-size: 13px;
}

body.adminbody .kpi {
    margin: 6px 0;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
}


/* ==========================================================
   PANELER OCH KORT
   ========================================================== */

body.adminbody .panel,
body.adminbody .card,
body.adminbody .event-card,
body.adminbody .some-card,
body.adminbody .thursday-card,
body.adminbody .todo-panel {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    box-shadow: none;
}

body.adminbody .panel {
    width: 100%;
    padding: 16px;
}

body.adminbody .card,
body.adminbody .event-card,
body.adminbody .some-card,
body.adminbody .thursday-card {
    padding: 14px;
}

body.adminbody .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

body.adminbody .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}


/* ==========================================================
   DASHBOARD
   ========================================================== */

body.adminbody .nu-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.adminbody .nu-dashboard-card {
    min-width: 0;
    padding: 14px;
}

body.adminbody .nu-dashboard-label {
    font-size: 13px;
    line-height: 1.2;
    font-weight: 700;
}

body.adminbody .nu-dashboard-number {
    margin-top: 7px;
    font-size: 30px;
    line-height: 1;
    font-weight: 800;
}

body.adminbody .nu-dashboard-company-list {
    margin-top: 7px;
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

body.adminbody .cards.compact-six-cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

body.adminbody .cards.compact-six-cards .card {
    min-width: 0;
    padding: 12px;
}

body.adminbody .cards.compact-six-cards h3 {
    margin: 7px 0 5px;
}

body.adminbody .cards.compact-six-cards .kpi {
    margin: 4px 0;
    font-size: 28px;
}

body.adminbody .cards.compact-six-cards textarea {
    min-height: 54px;
    height: 54px;
    padding: 7px 9px;
}

body.adminbody .cards.compact-six-cards .group-note-form {
    margin-top: 6px;
}


/* ==========================================================
   FORMULÄR
   ========================================================== */

body.adminbody .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

body.adminbody input,
body.adminbody select,
body.adminbody textarea {
    max-width: 100%;
    border: 1px solid #c8dcda;
    border-radius: 9px;
    background: #fff;
    color: var(--nu-blue);
    font: inherit;
}

body.adminbody input,
body.adminbody select {
    min-height: 40px;
    padding: 7px 10px;
}

body.adminbody textarea {
    min-height: 72px;
    padding: 9px 10px;
    resize: vertical;
}

body.adminbody .form-grid label {
    font-size: 13px;
    font-weight: 700;
}

body.adminbody .form-grid label input,
body.adminbody .form-grid label select,
body.adminbody .form-grid label textarea {
    display: block;
    width: 100%;
    margin-top: 5px;
}


/* ==========================================================
   KNAPPAR
   ========================================================== */

body.adminbody button,
body.adminbody .btn {
    min-height: 38px;
    padding: 7px 12px;
    border: 0;
    border-radius: 9px;
    background: var(--nu-turquoise);
    color: var(--nu-blue);
    font: inherit;
    font-size: 13px;
    line-height: 1.2;
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}

body.adminbody .btn.secondary,
body.adminbody button.secondary {
    background: #e9f3f2;
    color: var(--nu-blue);
}

body.adminbody .btn.danger,
body.adminbody button.danger {
    background: #b8322a;
    color: #fff;
}

body.adminbody .btn.small,
body.adminbody button.small {
    min-height: 34px;
    padding: 5px 9px;
    font-size: 12px;
}


/* ==========================================================
   TABELLER - GEMENSAM STANDARD
   ========================================================== */

body.adminbody .scroll-x {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
}

body.adminbody table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    margin: 0;
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: 12px;
    font-size: 13px;
}

body.adminbody table th,
body.adminbody table td {
    height: auto;
    padding: 6px 9px;
    border-bottom: 1px solid #e8f0ef;
    vertical-align: middle;
    text-align: left;
    line-height: 1.2;
}

body.adminbody table th {
    position: static;
    background: var(--ui-soft);
    font-weight: 800;
}

body.adminbody table tr:last-child td {
    border-bottom: 0;
}

body.adminbody table button,
body.adminbody table .btn {
    min-height: 34px;
    height: 34px;
    padding: 0 10px;
}

body.adminbody table input:not([type="checkbox"]):not([type="radio"]),
body.adminbody table select {
    min-height: 36px;
    height: 36px;
    padding: 4px 8px;
}



/* ==========================================================
   TABELLER - CENTRALA LAYOUTREGLER
   Gemensam design här. Endast kolumnstruktur varierar.
   ========================================================== */

body.adminbody .scroll-x > table {
    width: 100%;
    min-width: 900px;
}

body.adminbody table th,
body.adminbody table td {
    vertical-align: middle;
}

body.adminbody table button,
body.adminbody table .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
}

/* ----------------------------------------------------------
   ELEVER
   ---------------------------------------------------------- */

body.adminbody .student-table-wrap table {
    width: 100%;
    min-width: 1100px;
    table-layout: fixed;
}

body.adminbody .student-table-wrap th:nth-child(1),
body.adminbody .student-table-wrap td:nth-child(1) {
    width: 25%;
}

body.adminbody .student-table-wrap th:nth-child(2),
body.adminbody .student-table-wrap td:nth-child(2) {
    width: 5%;
    text-align: center;
}

body.adminbody .student-table-wrap th:nth-child(3),
body.adminbody .student-table-wrap td:nth-child(3) {
    width: 26%;
}

body.adminbody .student-table-wrap th:nth-child(4),
body.adminbody .student-table-wrap td:nth-child(4) {
    width: 14%;
    white-space: nowrap;
}

body.adminbody .student-table-wrap th:nth-child(5),
body.adminbody .student-table-wrap td:nth-child(5) {
    width: 10%;
    text-align: center;
}

body.adminbody .student-table-wrap th:nth-child(6),
body.adminbody .student-table-wrap td:nth-child(6) {
    width: 9%;
    text-align: center;
}

body.adminbody .student-table-wrap th:nth-child(7),
body.adminbody .student-table-wrap td:nth-child(7) {
    width: 11%;
    text-align: center;
}

body.adminbody .student-table-wrap td:nth-child(6) .btn,
body.adminbody .student-table-wrap td:nth-child(7) button {
    width: 96px;
    height: 42px;
    min-height: 42px;
    padding: 0 10px;
}

/* ----------------------------------------------------------
   FÖRETAGS-MEJL TORSDAG
   Samma fyrkolumnslayout för båda torsdagstabellerna.
   ---------------------------------------------------------- */

body.adminbody .tuesday-mail-table,
body.adminbody .thursday-thanks-table {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
}

body.adminbody .thursday-thanks-table th:nth-child(1),
body.adminbody .thursday-thanks-table td:nth-child(1),
body.adminbody .tuesday-mail-table th:nth-child(1),
body.adminbody .tuesday-mail-table td:nth-child(1) {
    width: 48%;
}

body.adminbody .thursday-thanks-table th:nth-child(2),
body.adminbody .thursday-thanks-table td:nth-child(2),
body.adminbody .tuesday-mail-table th:nth-child(2),
body.adminbody .tuesday-mail-table td:nth-child(2) {
    width: 30%;
}

body.adminbody .thursday-thanks-table th:nth-child(3),
body.adminbody .thursday-thanks-table td:nth-child(3),
body.adminbody .thursday-thanks-table th:nth-child(4),
body.adminbody .thursday-thanks-table td:nth-child(4),
body.adminbody .tuesday-mail-table th:nth-child(3),
body.adminbody .tuesday-mail-table td:nth-child(3),
body.adminbody .tuesday-mail-table th:nth-child(4),
body.adminbody .tuesday-mail-table td:nth-child(4) {
    width: 11%;
    text-align: center;
    white-space: nowrap;
}

body.adminbody .thursday-thanks-table td:nth-child(3) .btn,
body.adminbody .thursday-thanks-table td:nth-child(4) button,
body.adminbody .tuesday-mail-table td:nth-child(3) .btn,
body.adminbody .tuesday-mail-table td:nth-child(4) button {
    width: 128px;
    height: 42px;
    min-height: 42px;
    padding: 0 12px;
}

body.adminbody .thursday-thanks-email,
body.adminbody .tuesday-mail-table td {
    overflow-wrap: anywhere;
}

body.adminbody .thursday-thanks-hidden {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ----------------------------------------------------------
   TISDAGSMEJL
   Fem kolumner.
   ---------------------------------------------------------- */

body.adminbody .tuesday-mail-table.tuesday-mail-page {
    min-width: 900px;
    table-layout: fixed;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page th,
body.adminbody .tuesday-mail-table.tuesday-mail-page td {
    padding: 10px 14px;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(1),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(1) {
    width: 30%;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(2),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(2) {
    width: 22%;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(3),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(3) {
    width: 16%;
    text-align: center;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(4),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(4),
body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(5),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(5) {
    width: 16%;
    text-align: center;
    white-space: nowrap;
}

body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(4) .btn,
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(5) button {
    width: 128px;
    height: 42px;
    min-height: 42px;
    padding: 0 12px;
}

/* ==========================================================
   SPECIALTABELLER
   ========================================================== */

body.adminbody .attendance-table,
body.adminbody .attendance-matrix {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

body.adminbody .attendance-table .att-cell,
body.adminbody .attendance-matrix .att-cell {
    min-width: 90px;
    text-align: center;
}

body.adminbody .attendance-table th:first-child,
body.adminbody .attendance-table td:first-child {
    width: 220px;
    min-width: 220px;
    white-space: normal;
}

body.adminbody .attendance-table td.summary {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    white-space: normal;
}

body.adminbody .summary-grid {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 4px;
    align-items: center;
    justify-content: start;
}

body.adminbody .attendance-table th:nth-last-child(2) {
    width: 190px;
    min-width: 190px;
}

body.adminbody .attendance-table td.student-comment,
body.adminbody .attendance-table th:last-child {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
}

body.adminbody td.student-comment form,
body.adminbody td.student-comment form > div {
    width: 100%;
    margin: 0;
}

body.adminbody td.student-comment form > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

body.adminbody td.student-comment textarea {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 40px;
    min-height: 40px;
    padding: 6px 7px;
}

body.adminbody td.student-comment button {
    flex: 0 0 auto;
    white-space: nowrap;
}

body.adminbody td.summary .tag {
    margin: 0;
    padding: 4px 7px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

body.adminbody table.term-overview {
    width: 100%;
    min-width: 900px;
    table-layout: fixed;
}

body.adminbody table.term-overview th:first-child,
body.adminbody table.term-overview td:first-child {
    width: 80px;
}


/* ==========================================================
   STATUSFÄRGER
   ========================================================== */

body.adminbody .tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

body.adminbody .tag.ok,
body.adminbody .st-present {
    background: #dff4e5 !important;
    color: #1f6a36 !important;
}

body.adminbody .tag.bad,
body.adminbody .st-no-show {
    background: #fde1df !important;
    color: #9a2923 !important;
}

body.adminbody .tag.warn,
body.adminbody .st-none {
    background: #fff2c9 !important;
    color: #7a5a00 !important;
}

body.adminbody .tag.cant,
body.adminbody .st-cant {
    background: #edf0f1 !important;
    color: #555 !important;
}

body.adminbody .tag.late,
body.adminbody .st-late {
    background: #ffe6cf !important;
    color: #8a4d13 !important;
}

body.adminbody .st-sick {
    background: #e0eefc !important;
    color: #24517f !important;
}

body.adminbody .st-empty {
    background: #fff !important;
}

body.adminbody .attendance-not-coming {
    background: #edf0f1 !important;
    color: #555 !important;
}


/* ==========================================================
   SCHEMA
   ========================================================== */

body.adminbody .schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

body.adminbody .event-card {
    min-width: 0;
    border-left: 5px solid var(--nu-turquoise);
}

body.adminbody .event-date {
    font-size: 17px;
    font-weight: 800;
}


/* ==========================================================
   MEJL TORSDAGAR
   ========================================================== */

body.adminbody .thursday-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

body.adminbody .thursday-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

body.adminbody .thursday-card > h2 {
    margin: 0 0 10px;
    font-size: 19px;
}

body.adminbody .thursday-card textarea {
    display: block;
    width: 100%;
    resize: none;
}

body.adminbody .thursday-small-textarea {
    height: 62px;
}

body.adminbody .thursday-subject {
    height: 48px;
}

body.adminbody .thursday-body {
    height: 250px;
}

body.adminbody .thursday-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

body.adminbody .thursday-company-row {
    padding: 10px 0;
    border-bottom: 1px solid var(--ui-line);
}


/* ==========================================================
   SOME
   ========================================================== */




/* ==========================================================
   BILDER
   ========================================================== */

body.adminbody .image-folder-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.adminbody .image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

body.adminbody img {
    max-width: 100%;
    height: auto;
}


/* ==========================================================
   TODO
   ========================================================== */

body.adminbody .todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.adminbody .todo-list {
    display: grid;
    gap: 6px;
}


/* ==========================================================
   SÖKFÄLT
   ========================================================== */

body.adminbody .student-search-wrap,
body.adminbody .attendance-search-wrap {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    margin: 0 0 14px;
}

body.adminbody #student-search,
body.adminbody #attendance-search,
body.adminbody input[type="search"] {
    width: 280px;
    max-width: 100%;
}


/* ==========================================================
   RESPONSIVT
   ========================================================== */

@media (max-width: 1100px) {
    body.adminbody .nu-dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.adminbody .cards.compact-six-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.adminbody .schedule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.adminbody .admin-shell {
        width: calc(100% - 28px);
    }

    body.adminbody .top {
        height: auto;
        min-height: 70px;
    }

    body.adminbody .mainnav,
    body.adminbody .subnav,
    body.adminbody .image-folder-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    body.adminbody .mainnav::-webkit-scrollbar,
    body.adminbody .subnav::-webkit-scrollbar,
    body.adminbody .image-folder-nav::-webkit-scrollbar {
        display: none;
    }

    body.adminbody .mainnav a,
    body.adminbody .subnav a,
    body.adminbody .image-folder-link {
        flex: 0 0 auto;
    }

    body.adminbody .thursday-grid,
    body.adminbody .thursday-two {
        grid-template-columns: 1fr;
    }

    body.adminbody .scroll-x > table {
        width: max-content;
        min-width: 850px;
    }
}

@media (max-width: 600px) {
    body.adminbody .admin-shell {
        width: calc(100% - 24px);
    }

    body.adminbody h1 {
        font-size: 27px;
    }

    body.adminbody .nu-dashboard-cards,
    body.adminbody .cards.compact-six-cards,
    body.adminbody .schedule-grid {
        grid-template-columns: 1fr;
    }

    body.adminbody .top-right {
        gap: 7px;
        font-size: 12px;
    }

    body.adminbody .role-badge {
        display: none;
    }

    body.adminbody input:not([type="checkbox"]):not([type="radio"]),
    body.adminbody select,
    body.adminbody textarea {
        font-size: 16px;
    }

    body.adminbody .image-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* attendance group leads direct */
.attendance-group-nav{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    align-items:flex-start;
    margin-bottom:18px;
}

.attendance-group-nav-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:5px;
}

.attendance-group-nav-item > a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    padding:10px 16px;
    border:1px solid var(--ui-line);
    border-radius:999px;
    background:var(--ui-surface);
    color:inherit;
    text-decoration:none;
    font-weight:700;
}

.attendance-group-nav-item > a.active{
    background:#d7f3f0;
}

.attendance-group-lead{
    font-size:13px;
    line-height:1.2;
    text-align:center;
    color:#6c7f7d;
    white-space:nowrap;
}

/* ==========================================================
   MEJLTABELLER - GEMENSAM KNAPPSTANDARD
   ========================================================== */

body.adminbody .tuesday-mail-table td:nth-child(3) .btn,
body.adminbody .tuesday-mail-table td:nth-child(3) button,
body.adminbody .tuesday-mail-table td:nth-child(4) .btn,
body.adminbody .tuesday-mail-table td:nth-child(4) button,
body.adminbody .tuesday-mail-table td:nth-child(5) .btn,
body.adminbody .tuesday-mail-table td:nth-child(5) button,
body.adminbody .thursday-thanks-table td:nth-child(3) .btn,
body.adminbody .thursday-thanks-table td:nth-child(3) button,
body.adminbody .thursday-thanks-table td:nth-child(4) .btn,
body.adminbody .thursday-thanks-table td:nth-child(4) button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    width: 128px;
    min-width: 128px;
    max-width: 128px;

    height: 42px;
    min-height: 42px;
    max-height: 42px;

    padding: 0 12px;
    margin: 0;

    font-size: 13px;
    font-weight: 750;
    line-height: 1;

    white-space: nowrap;
    text-align: center;
}

/* ==========================================================
   MEJLTABELLER - GEMENSAM ÅTGÄRDSLAYOUT
   Samma kolumnbredd och knappplacering tisdag/torsdag
   ========================================================== */

/* Torsdag: Skicka + Kopiera */
body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) th:nth-child(3),
body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) td:nth-child(3),
body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) th:nth-child(4),
body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) td:nth-child(4),
body.adminbody .thursday-thanks-table th:nth-child(3),
body.adminbody .thursday-thanks-table td:nth-child(3),
body.adminbody .thursday-thanks-table th:nth-child(4),
body.adminbody .thursday-thanks-table td:nth-child(4),

/* Tisdag: Skicka + Kopiera */
body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(4),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(4),
body.adminbody .tuesday-mail-table.tuesday-mail-page th:nth-child(5),
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(5) {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

/* Exakt samma knapp på alla mejltabeller */
body.adminbody .tuesday-mail-table td .btn,
body.adminbody .tuesday-mail-table td button,
body.adminbody .thursday-thanks-table td .btn,
body.adminbody .thursday-thanks-table td button {
    box-sizing: border-box;
}

body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) td:nth-child(3) .btn,
body.adminbody .tuesday-mail-table:not(.tuesday-mail-page) td:nth-child(4) button,
body.adminbody .thursday-thanks-table td:nth-child(3) .btn,
body.adminbody .thursday-thanks-table td:nth-child(4) button,
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(4) .btn,
body.adminbody .tuesday-mail-table.tuesday-mail-page td:nth-child(5) button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 128px;
    min-width: 128px;
    max-width: 128px;

    height: 42px;
    min-height: 42px;
    max-height: 42px;

    padding: 0;
    margin: 0;

    font-size: 13px;
    font-weight: 750;
    line-height: 1;

    white-space: nowrap;
    text-align: center;
}


/* ==========================================================
   MANUS
   ========================================================== */

body.adminbody .manus-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    align-items:stretch;
}

body.adminbody .manus-card{
    min-width:0;
}

body.adminbody .manus-card h2{
    margin:0 0 12px;
}

body.adminbody .manus-card textarea{
    display:block;
    width:100%;
    min-height:520px;
    resize:vertical;
    line-height:1.5;
}

body.adminbody .manus-card [hidden]{
    display:none !important;
}

body.adminbody .manus-form{
    display:flex;
    flex-direction:column;
    min-height:560px;
}

body.adminbody .manus-text{
    width:100%;
    min-height:520px;
    padding:9px 10px;
    border:1px solid #c8dcda;
    border-radius:9px;
    background:#fff;
    color:var(--nu-blue);
    line-height:1.5;
    white-space:normal;
    overflow-wrap:anywhere;
}

body.adminbody .manus-actions{
    display:flex;
    gap:8px;
    margin-top:12px;
}

@media(max-width:1000px){
    body.adminbody .manus-grid{
        grid-template-columns:1fr;
    }

    body.adminbody .manus-card textarea{
        min-height:320px;
    }
}

/* ==========================================================
   MANUS - PDF-FILER
   ========================================================== */

body.adminbody .manus-files{
    margin-top:18px;
    padding-top:16px;
    border-top:1px solid var(--ui-line);
}

body.adminbody .manus-files h3{
    margin:0 0 12px;
}

body.adminbody .manus-pdf-upload{
    margin-bottom:20px;
}

body.adminbody .manus-pdf-upload > p:first-child{
    margin-top:0;
}

body.adminbody .manus-pdf-upload input[type="file"]{
    display:block;
    width:100%;
    min-height:52px;
    padding:10px;
}

body.adminbody .manus-file-list{
    margin-top:18px;
    padding-top:18px;
    border-top:1px solid var(--ui-line);
}

body.adminbody .manus-file-count{
    margin-bottom:10px;
}

body.adminbody .manus-file-item{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 0;
    border-bottom:1px solid var(--ui-line);
}

body.adminbody .manus-file-item:last-child{
    border-bottom:0;
}

body.adminbody .manus-file-name{
    flex:1 1 auto;
    min-width:0;
    font-weight:700;
    overflow-wrap:anywhere;
}

body.adminbody .manus-file-item form{
    margin:0;
}

body.adminbody .manus-file-item .btn,
body.adminbody .manus-file-item button{
    min-width:92px;
    margin:0;
    text-align:center;
    justify-content:center;
}

@media(max-width:700px){
    body.adminbody .manus-file-item{
        align-items:stretch;
        flex-direction:column;
    }

    body.adminbody .manus-file-item .btn,
    body.adminbody .manus-file-item button{
        width:100%;
    }
}

/* ==========================================================
   FÖRETAG - LÄGG TILL
   ========================================================== */

body.adminbody .company-add-panel{
    margin-bottom:20px;
}

body.adminbody .company-add-panel h2{
    margin-top:0;
}

body.adminbody .company-add-form{
    display:grid;
    grid-template-columns:
        minmax(160px,1.2fr)
        minmax(140px,.8fr)
        minmax(160px,1fr)
        minmax(200px,1.3fr)
        minmax(200px,1.3fr)
        auto;
    gap:12px;
    align-items:end;
}

body.adminbody .company-add-form label{
    display:block;
    margin-bottom:5px;
    font-weight:700;
}

body.adminbody .company-add-form input,
body.adminbody .company-add-form select{
    width:100%;
}

body.adminbody .company-add-action{
    display:flex;
    align-items:flex-end;
}

body.adminbody .company-add-action button{
    white-space:nowrap;
}

@media(max-width:1100px){
    body.adminbody .company-add-form{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:650px){
    body.adminbody .company-add-form{
        grid-template-columns:1fr;
    }

    body.adminbody .company-add-action button{
        width:100%;
    }
}

/* ==========================================================
   FÖRETAG - GRUPPVISA MEJL
   ========================================================== */

body.adminbody .company-group-emails{
    margin:-2px 0 14px;
}

body.adminbody .company-group-emails summary{
    display:inline-block;
    cursor:pointer;
    color:var(--nu-blue);
    font-weight:700;
    font-size:14px;
    user-select:none;
}

body.adminbody .company-group-emails summary::marker{
    display:none;
}

body.adminbody .company-group-emails summary::-webkit-details-marker{
    display:none;
}

body.adminbody .company-group-emails summary::before{
    content:"▶";
    display:inline-block;
    margin-right:6px;
    font-size:11px;
    transition:transform .15s ease;
}

body.adminbody .company-group-emails[open] summary::before{
    transform:rotate(90deg);
}

body.adminbody .company-group-emails-content{
    display:flex;
    gap:10px;
    align-items:flex-start;
    margin-top:10px;
}

body.adminbody .company-group-emails-content textarea{
    width:min(760px,100%);
    min-height:66px;
    resize:vertical;
}

body.adminbody .company-group-emails-content button{
    flex:0 0 auto;
    white-space:nowrap;
}

body.adminbody .company-group-emails-empty{
    margin-top:8px;
}

@media(max-width:700px){
    body.adminbody .company-group-emails-content{
        flex-direction:column;
    }

    body.adminbody .company-group-emails-content button{
        width:100%;
    }
}


/* Gemensam flytande scrollist för breda tabeller */
body.adminbody .nu-floating-table-scroll {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 10000;
    height: 18px;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #f1f3f5;
    border-top: 1px solid #d5d9df;
    box-sizing: border-box;
    display: none;
}

body.adminbody .nu-floating-table-scroll-inner {
    height: 1px;
}

body.adminbody .nu-floating-table-scroll::-webkit-scrollbar {
    height: 14px;
}

body.adminbody .nu-floating-table-scroll::-webkit-scrollbar-thumb {
    background: #8993a1;
    border: 3px solid #f1f3f5;
    border-radius: 10px;
}

body.adminbody .nu-floating-table-scroll::-webkit-scrollbar-track {
    background: #f1f3f5;
}
