*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --green-brand: #4caf22;
    --green-dark: #2e7d14;
    --green-light: #e8f5e0;
    --orange: #d44a0a;
    --yellow: #f5c200;
    --white: #fff;
    --gray-100: #f4f4f4;
    --gray-200: #e0e0e0;
    --gray-400: #aaa;
    --gray-600: #666;
    --gray-800: #333;
    --black: #111;
    --shadow: 0 2px 8px rgba(0, 0, 0, .10);
    --shadow-lg: 0 4px 18px rgba(0, 0, 0, .14);
    --radius: 10px;
    --radius-sm: 6px;
    --font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --day0: #f0fae8;
    --day1: #e4f5d8;
    --day2: #d4edbc;
    --day3: #c0e4a0;
    --day4: #a8d880;
    --day5: #8ecb58;
    --day6: #72bc2e
}

html,
body {
    min-height: 100%
}

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--gray-800);
    font-size: 16px
}

.hidden {
    display: none !important
}

.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: linear-gradient(180deg, var(--green-light), #f7f7f7)
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--shadow-lg)
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px
}

.login-brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 10px
}

.login-brand h1 {
    font-size: 1.7rem;
    color: var(--green-dark);
    line-height: 1
}

.login-brand p {
    color: var(--gray-600);
    font-weight: 600
}

.login-card h2 {
    font-size: 1.35rem;
    margin-bottom: 6px
}

.login-help {
    color: var(--gray-600);
    margin-bottom: 16px
}

.login-card input {
    width: 100%;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 13px 12px;
    font: inherit;
    margin-bottom: 10px
}

.primary-btn {
    width: 100%;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px;
    background: var(--orange);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer
}

.message {
    padding: 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    margin-bottom: 10px;
    white-space: pre-wrap
}

.message.error {
    background: #fee;
    color: #b42318
}

.message.status {
    background: var(--green-light);
    color: var(--green-dark)
}

.topbar {
    background: var(--green-brand);
    color: white;
    padding: 0 16px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    gap: 10px
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-shrink: 0
}

.topbar-logo img {
  height: 60px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 0;
}


.topbar-logo-text {
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.1
}

.topbar-logo-sub {
    font-size: .68rem;
    opacity: .85;
    font-weight: 400;
    letter-spacing: .2px
}

.topbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center
}

.week-label {
    font-size: 1.05rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -.2px
}

.week-nav-btn {
    background: rgba(255, 255, 255, .22);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.week-nav-btn:active {
    background: rgba(255, 255, 255, .4)
}

.week-nav-btn:disabled {
    opacity: .35;
    cursor: not-allowed
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0
}

.username-badge {
    font-size: .85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .2);
    border-radius: 20px;
    padding: 4px 11px;
    white-space: nowrap;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis
}

.select-week-btn,
.logout-btn {
    background: white;
    color: var(--green-dark);
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .12)
}

.logout-btn {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    box-shadow: none
}

.statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 16px;
    background: white;
    border-bottom: 1px solid var(--gray-200);
    font-size: .8rem;
    min-height: 36px
}

.autosave-indicator {
    color: var(--gray-400);
    font-size: .78rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color .3s
}

.autosave-indicator.saving {
    color: var(--orange)
}

.autosave-indicator.saved {
    color: var(--green-brand)
}

.autosave-indicator.error {
    color: #b42318
}

.autosave-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0
}

.send-week-btn {
    background: var(--green-brand);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: .83rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow)
}

body.history-mode .week-container {
    filter: grayscale(1) brightness(.97);
    pointer-events: none;
    opacity: .88
}

body.history-mode .week-container::after {
    content: 'HISTORIK – Kun visning';
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    display: block;
    background: rgba(80, 80, 80, .92);
    color: white;
    text-align: center;
    font-size: .9rem;
    font-weight: 700;
    padding: 10px;
    letter-spacing: 1px;
    z-index: 50
}

body.history-mode .topbar {
    background: #888
}

body.history-mode .statusbar {
    background: #f0f0f0
}

body.submitted-mode .week-container {
    outline: 3px solid rgba(76, 175, 34, .35);
    outline-offset: 0
}

body.submitted-mode .send-week-btn {
    background: #777
}

.main {
    padding: 12px 12px 120px;
    max-width: 740px;
    margin: 0 auto
}

.day-card {
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow)
}

.day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px 10px;
    cursor: pointer;
    user-select: none;
    gap: 8px
}

.day-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0
}

.day-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--black);
    min-width: 90px
}

.day-date {
    font-size: .82rem;
    color: var(--gray-600);
    font-weight: 500
}

.day-summary {
    font-size: .78rem;
    color: var(--gray-600);
    font-weight: 500;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    padding-right: 6px
}

.day-toggle-icon {
    font-size: .9rem;
    color: var(--gray-600);
    transition: transform .2s;
    flex-shrink: 0
}

.day-card.open .day-toggle-icon {
    transform: rotate(180deg)
}

.day-card:nth-child(1) .day-header {
    background: var(--day0)
}

.day-card:nth-child(2) .day-header {
    background: var(--day1)
}

.day-card:nth-child(3) .day-header {
    background: var(--day2)
}

.day-card:nth-child(4) .day-header {
    background: var(--day3)
}

.day-card:nth-child(5) .day-header {
    background: var(--day4)
}

.day-card:nth-child(6) .day-header {
    background: var(--day5)
}

.day-card:nth-child(7) .day-header {
    background: var(--day6)
}

.status-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 9px;
    letter-spacing: .3px;
    flex-shrink: 0
}

.status-badge.sick {
    background: #fdd;
    color: #c00
}

.status-badge.off {
    background: #ddf;
    color: #006
}

.status-badge.fullDay {
    background: #ffe8b0;
    color: #a05900
}

.day-body {
    background: white;
    border-top: 1px solid var(--gray-200);
    display: none;
    padding: 0 0 4px
}

.day-card.open .day-body {
    display: block
}

.status-row {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-200)
}

.status-btn {
    flex: 1;
    padding: 10px 4px;
    font-size: .82rem;
    font-weight: 700;
    border: none;
    background: white;
    color: var(--gray-600);
    cursor: pointer;
    border-right: 1px solid var(--gray-200);
    text-align: center
}

.status-btn:last-child {
    border-right: none
}

.status-btn.active-sick {
    background: #fdd;
    color: #c00
}

.status-btn.active-off {
    background: #ddf;
    color: #006
}

.status-btn.active-fullDay {
    background: #fff3cc;
    color: #a05900
}

.task-block {
    padding: 12px 14px 6px;
    border-bottom: 1px solid var(--gray-100)
}

.task-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px
}

.task-label {
    font-size: .75rem;
    font-weight: 700;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: .6px
}

.remove-task-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1
}

.remove-task-btn:active {
    background: #fee;
    color: #c00
}

.time-row {
    display: flex;
    gap: 8px;
    margin-bottom: 9px;
    align-items: flex-end
}

.time-group {
    flex: 1
}

.field-label {
    font-size: .72rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 3px;
    display: block
}

.time-duration {
    flex: 0 0 auto;
    font-size: .88rem;
    font-weight: 700;
    color: var(--green-dark);
    padding-bottom: 10px;
    white-space: nowrap;
    align-self: flex-end
}

input[type=time],
input[type=text],
textarea {
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 10px 11px;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--black);
    outline: none;
    transition: border-color .15s, box-shadow .15s
}

input[type=time]:focus,
input[type=text]:focus,
textarea:focus {
    border-color: var(--green-brand);
    box-shadow: 0 0 0 3px rgba(76, 175, 34, .13)
}

input[type=time] {
    font-size: 1.15rem;
    font-weight: 600;
    padding: 9px 8px
}

textarea {
    resize: none;
    min-height: 54px;
    line-height: 1.4
}

.fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0
}

.field-full {
    grid-column: 1/-1
}

.day-body.locked input,
.day-body.locked textarea {
    background: #f5f5f5;
    color: var(--gray-400);
    pointer-events: none;
    border-color: #e0e0e0
}

.add-task-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: calc(100% - 28px);
    margin: 10px 14px 4px;
    padding: 11px;
    background: var(--green-light);
    color: var(--green-dark);
    border: 1.5px dashed var(--green-brand);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer
}

.fab-save {
    position: fixed;
    bottom: 22px;
    right: 18px;
    background: var(--orange);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 24px;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .22);
    z-index: 200;
    letter-spacing: .2px
}

.fab-save:active {
    transform: scale(.96)
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 400;
    align-items: flex-end;
    justify-content: center
}

.modal-overlay.open {
    display: flex
}

.modal-sheet {
    background: white;
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 560px;
    padding: 20px 18px 36px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, .18);
    animation: slideUp .22s ease
}

@keyframes slideUp {
    from {
        transform: translateY(60px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 16px;
    text-align: center
}

.week-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 55vh;
    overflow-y: auto
}

.week-list li button {
    width: 100%;
    text-align: left;
    padding: 13px 16px;
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .97rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center
}

.week-list li button:hover,
.week-list li button:active {
    background: var(--green-light);
    border-color: var(--green-brand);
    color: var(--green-dark)
}

.week-list li.current button {
    background: var(--green-light);
    border-color: var(--green-brand);
    color: var(--green-dark);
    font-weight: 800
}

.modal-close-btn {
    margin-top: 16px;
    width: 100%;
    padding: 13px;
    background: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer
}

@media (min-width:600px) {
    .main {
        padding: 18px 20px 100px
    }

    .topbar {
        height: 80px;
        padding: 0 24px
    }

    .fields-row {
        grid-template-columns: 1fr 1fr 1fr
    }

    .field-full {
        grid-column: 1/-1
    }
}

@media (max-width:680px) {
    .topbar {
        height: auto;
        min-height: 58px;
        flex-wrap: wrap;
        padding: 8px 12px
    }

    .topbar-center {
        order: 3;
        width: 100%;
        flex: 0 0 100%
    }

    .logout-btn {
        display: none
    }

    .select-week-btn {
        padding: 6px 8px
    }

    .username-badge {
        max-width: 80px
    }

    .topbar-logo-sub {
        display: none
    }
}

@media (max-width:380px) {
    .topbar-logo-text {
        font-size: 1rem
    }

    .username-badge {
        max-width: 64px;
        font-size: .75rem
    }

    .select-week-btn {
        font-size: .75rem
    }

    .day-name {
        min-width: 70px;
        font-size: .92rem
    }
}
.time-select-wrap {
  display: flex;
  gap: 6px;
}

.time-select {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: 1.05rem;
  font-family: var(--font);
  font-weight: 700;
  color: var(--black);
}

.time-select:focus {
  border-color: var(--green-brand);
  box-shadow: 0 0 0 3px rgba(76, 175, 34, 0.13);
  outline: none;
}

.time-select:disabled {
  background: #f5f5f5;
  color: var(--gray-400);
}

.day-summary-box {
  margin: 10px 24px;
  padding: 12px 14px;
  background: #f4f9f0;
  border: 1px solid rgba(76, 175, 34, 0.2);
  border-radius: 10px;
  font-size: 0.9rem;
}

.day-summary-box strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green-dark);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-summary-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
}

.day-summary-box span {
  font-weight: 800;
}

.week-summary-box {
  margin: 14px 0 4px;
  padding: 16px;
  background: #ffffff;
  border: 2px solid rgba(76, 175, 34, 0.35);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}

.week-summary-box strong {
  display: block;
  margin-bottom: 10px;
  color: var(--green-dark);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.week-summary-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #edf2ea;
}

.week-summary-box div:last-child {
  border-bottom: none;
}

.week-summary-box span {
  font-weight: 800;
  color: var(--green-dark);
}

.week-status {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-current {
  color: #2e7d32;
}

.status-submitted {
  color: #999;
}

.status-draft {
  color: #e65100;
}

.gdpr-btn {
  background: #f0f0f0;
  color: #333;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 8px;
  box-shadow: var(--shadow);
}

.gdpr-btn:hover {
  background: #e0e0e0;
}

#gdprModal .modal-sheet p {
  margin-bottom: 12px;
  line-height: 1.45;
  color: var(--gray-800);
}

.statusbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.statusbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}


/* Pippis workflow fix: tre dagshandlinger og returkommentar */
.day-action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.day-rest-btn,
.secondary-action-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  cursor: pointer;
  background: var(--gray-100, #edf2f6);
  color: var(--gray-800, #1e2933);
}
.day-rest-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.sick-rest-btn { background: #fff1f1; color: #8c2e2e; }
.off-rest-btn { background: #eef7ff; color: #1f4568; }
.rest-status-note,
.admin-comment-box {
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff7dc;
  color: #5d4300;
  font-weight: 700;
}
.admin-comment-box {
  margin-bottom: 14px;
  border: 1px solid #ecd27a;
}
.task-block.completed {
  border-left: 5px solid var(--green, #37bf1f);
}
.status-badge.sickRest { background: #fff1f1; color: #8c2e2e; }
.status-badge.offRest { background: #eef7ff; color: #1f4568; }
@media (max-width: 720px) {
  .day-action-row { grid-template-columns: 1fr; }
}

/* Pippis fix: ens handlingsknapper, synlig afslut opgave og korrekt bredde */
.day-summary-box {
  margin: 14px !important;
}

.day-action-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin: 14px !important;
  width: auto !important;
  box-sizing: border-box !important;
}

.day-action-row .add-task-btn,
.day-action-row .secondary-action-btn,
.day-action-row .day-rest-btn {
  width: 100% !important;
  height: 54px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  border-radius: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  font-size: 15px !important;
  font-weight: 800 !important;
}

.day-action-row .add-task-btn,
.day-action-row .secondary-action-btn {
  background: #eef8e8 !important;
  color: #2e7d14 !important;
  border: 1.5px dashed #4caf22 !important;
}

.day-action-row .sick-rest-btn {
  background: #fdeaea !important;
  color: #b42323 !important;
  border: none !important;
}

.day-action-row .off-rest-btn {
  background: #eaf1f8 !important;
  color: #29527a !important;
  border: none !important;
}

.day-action-row .day-rest-btn:disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
}

.finish-task-btn {
  width: 100%;
  min-height: 42px;
  margin: 10px 0 4px;
  border: 1.5px solid rgba(76, 175, 34, .35);
  border-radius: 10px;
  background: #f4f9f0;
  color: #2e7d14;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.finish-task-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.task-block.completed .finish-task-btn {
  background: #e8f5e0;
  border-color: #4caf22;
}

@media (max-width: 720px) {
  .day-action-row {
    grid-template-columns: 1fr !important;
  }
}

/* Pippis indbakke */
.inbox-card {
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #eef7ff;
  border: 1px solid #cfe6f8;
}
.inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px 10px;
  cursor: pointer;
  user-select: none;
  gap: 8px;
  background: #dff0ff;
}
.inbox-card.has-unread .inbox-header {
  background: #cfe9ff;
  box-shadow: inset 5px 0 0 #1f75b7;
}
.inbox-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.inbox-icon { font-size: 1.05rem; }
.inbox-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #163f63;
}
.inbox-summary {
  font-size: .78rem;
  color: #315d7c;
  font-weight: 700;
  margin-left: auto;
}
.inbox-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e22d2d;
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
}
.inbox-body {
  display: none;
  background: #fff;
  border-top: 1px solid #cfe6f8;
  padding: 10px 14px 12px;
}
.inbox-card.open .inbox-body { display: block; }
.inbox-card.open .day-toggle-icon { transform: rotate(180deg); }
.inbox-message {
  padding: 11px 12px;
  border-radius: 12px;
  background: #f5fbff;
  border: 1px solid #d7ebfa;
  margin-bottom: 9px;
}
.inbox-message.unread {
  background: #eaf6ff;
  border-color: #8bc7f2;
}
.inbox-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #163f63;
  font-size: .85rem;
  margin-bottom: 5px;
}
.inbox-message-meta span { color: #6e7d8b; font-weight: 700; }
.inbox-message-text {
  white-space: pre-wrap;
  line-height: 1.35;
  color: var(--gray-800);
}
.inbox-empty {
  color: #315d7c;
  font-weight: 700;
  padding: 8px 0;
}

/* Pippis indbakke v2 - skriv + historik */
.inbox-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.inbox-compose,
.inbox-history {
  background: #fff;
  border: 1px solid #dce6ee;
  border-radius: 16px;
  padding: 14px;
}
.inbox-compose h3,
.inbox-history h3 {
  margin: 0 0 10px;
  color: #17324d;
  font-size: .98rem;
}
.inbox-compose textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 11px;
  font: inherit;
}
.inbox-compose-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.inbox-send-btn {
  border: none;
  border-radius: 12px;
  background: #2b5f8f;
  color: #fff;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
}
#employeeMessageStatus {
  font-weight: 800;
  color: #2b5f8f;
}
.inbox-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}
.inbox-message.from-employee {
  border-left: 5px solid #f45100;
}
.inbox-message.from-admin {
  border-left: 5px solid #4a94c9;
}
@media (max-width: 720px) {
  .inbox-two-col { grid-template-columns: 1fr; }
}


/* Message modal + inbox click fix */
body.history-mode .inbox-card,
body.history-mode .inbox-card * {
  pointer-events: auto;
}
.inbox-message {
  cursor: pointer;
}
.inbox-message:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(23,50,77,.10);
}
.message-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.message-modal-overlay.open { display: flex; }
.message-modal {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28);
  padding: 22px;
  position: relative;
}
.message-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef2f6;
  color: #17324d;
  font-size: 1.35rem;
  font-weight: 900;
  cursor: pointer;
}
.message-modal-title {
  color: #17324d;
  font-size: 1.15rem;
  font-weight: 900;
  padding-right: 42px;
}
.message-modal-subtitle {
  color: #6e7d8b;
  font-size: .88rem;
  font-weight: 700;
  margin-top: 4px;
}
.message-modal-body {
  margin-top: 16px;
  white-space: pre-wrap;
  line-height: 1.5;
  color: #1e2933;
  font-size: 1rem;
}
@media (max-width: 600px) {
  .message-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .message-modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    padding: 20px 18px 28px;
  }
}

/* Fælles dagsregistrering */
.shared-day-control {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  max-width: 260px;
}
.shared-picker-btn,
.shared-active-label {
  border: 1px solid rgba(31,69,104,.18);
  background: #eef7ff;
  color: #1f4568;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .72rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.shared-picker-btn.pending {
  background: #fff7dc;
  color: #7a5700;
  border-color: #ecd27a;
}
.shared-active-label {
  background: #e8f5e0;
  color: var(--green-dark);
  cursor: default;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shared-day-panel {
  margin: 10px 14px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #eef7ff;
  border: 1px solid rgba(31,69,104,.16);
  color: #1f4568;
}
.shared-day-panel strong {
  display: block;
  margin-bottom: 4px;
  font-size: .9rem;
}
.shared-day-panel p {
  font-size: .82rem;
  line-height: 1.35;
  margin-bottom: 10px;
}
.shared-employee-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.shared-employee-option {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 10px;
  padding: 9px 10px;
  font-weight: 700;
  cursor: pointer;
}
.shared-employee-option input {
  width: auto;
  margin: 0;
}
.shared-pending-note,
.shared-empty {
  margin-top: 10px;
  font-size: .82rem;
  font-weight: 800;
  color: #7a5700;
}
@media (max-width: 680px) {
  .shared-day-control { max-width: 100%; margin-left: 0; margin-top: 4px; }
  .day-header-left { flex-wrap: wrap; }
  .shared-employee-list { grid-template-columns: 1fr; }
  .shared-picker-btn,
  .shared-active-label { font-size: .7rem; }
}

/* Fælles dagsregistrering popup-fix */
.shared-day-control {
  margin-left: 10px;
}
.shared-picker-btn.pending {
  background: #fff7dc;
  color: #7a5700;
  border-color: #ecd27a;
}
.shared-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.42);
}
.shared-modal-overlay.open {
  display: flex;
}
.shared-modal {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
  padding: 22px;
  position: relative;
}
.shared-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #eef3f8;
  color: #1f4568;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}
.shared-modal h3 {
  margin: 0 36px 8px 0;
  color: #1f4568;
  font-size: 1.18rem;
}
.shared-modal p {
  color: var(--gray-600);
  line-height: 1.4;
  margin-bottom: 14px;
  font-size: .92rem;
}
.shared-modal-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
  padding: 2px 0;
}
.shared-modal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d7e6f2;
  border-radius: 12px;
  background: #f8fcff;
  color: #1f4568;
  font-weight: 800;
  cursor: pointer;
}
.shared-modal-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.shared-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.shared-cancel-btn,
.shared-submit-btn {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}
.shared-cancel-btn {
  background: #edf2f6;
  color: #465567;
}
.shared-submit-btn {
  background: #2b6597;
  color: #fff;
}
@media (max-width: 600px) {
  .shared-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .shared-modal {
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 22px 18px 28px;
    max-height: 88vh;
    overflow: auto;
  }
  .shared-modal-actions {
    flex-direction: column-reverse;
  }
  .shared-cancel-btn,
  .shared-submit-btn {
    width: 100%;
  }
}

/* Fælles dagsregistrering v2: indkommende anmodninger */
.shared-request-box {
  margin: 12px 14px;
  padding: 12px;
  background: #eef7ff;
  border: 1px solid #bdd9f2;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shared-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #17324d;
  font-size: 0.9rem;
}

.shared-request-item span {
  color: #4d6478;
  font-weight: 700;
}

.shared-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.shared-request-actions button {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}

.shared-reject-btn {
  background: #fff1f1;
  color: #9f2626;
}

.shared-accept-btn {
  background: #2f6aa3;
  color: #fff;
}

@media (max-width: 560px) {
  .shared-request-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .shared-request-actions {
    width: 100%;
  }

  .shared-request-actions button {
    flex: 1;
  }
}


/* Fælles dagsregistrering v3 */
.shared-day-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  flex-shrink: 0;
}
.shared-picker-btn.incoming {
  background: #fff7dc;
  color: #7a5600;
  border-color: #ecd27a;
}
.shared-cancel-small {
  border: 1px solid #e7b7b7;
  background: #fff4f4;
  color: #9c2b2b;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 800;
  cursor: pointer;
}
.shared-active-label {
  color: #486276;
  font-weight: 800;
  font-size: .82rem;
}
.shared-modal-option.was-rejected {
  opacity: .75;
}
.shared-modal-option small {
  color: #9c2b2b;
  font-weight: 700;
}
.shared-request-box {
  margin: 12px 14px;
  border: 1px solid #ecd27a;
  background: #fff9e8;
  border-radius: 14px;
  padding: 12px;
}
.shared-request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.shared-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.shared-accept-btn,
.shared-reject-btn {
  border: none;
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.shared-accept-btn {
  background: var(--green-brand);
  color: #fff;
}
.shared-reject-btn {
  background: #fee;
  color: #a22;
}
@media (max-width: 520px) {
  .shared-day-control { margin-left: 0; }
  .shared-request-item { align-items: stretch; flex-direction: column; }
  .shared-request-actions button { flex: 1; }
}
