<style>
    .dashboard {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        box-sizing: border-box;
    }
    #admin-home-header {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }
    #admin-home-header h1 {
        margin: 0;
        width: max-content;
        justify-self: start;
    }
    .admin-home-net-message {
        display: flex;
        align-items: center;
        align-content: right;
        gap: 0.75rem;
        padding: 0.35rem 0.75rem;
        border-radius: 6px;
        background: var(--darkened-bg);
        color: var(--body-fg);
        --net-message-text-color: #3f3f3f;
        min-height: 2.25rem;
        box-sizing: border-box;
    }
    .admin-home-net-message__label {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--body-quiet-color);
        white-space: nowrap;
    }
    .admin-home-net-message__link {
        color: inherit;
        text-decoration: none;
    }
    .admin-home-net-message__link:focus-visible {
        outline: 2px solid var(--body-fg);
        outline-offset: 2px;
    }
    .admin-home-net-message__content {
        font-family: var(
            --font-family-monospace,
            SFMono-Regular,
            Menlo,
            Monaco,
            Consolas,
            'Liberation Mono',
            'Courier New',
            monospace
        );
        font-size: 0.875rem;
        white-space: pre-wrap;
        word-break: break-word;
        flex: 1 1 auto;
        color: var(--net-message-text-color, #3f3f3f);
    }
    .admin-home-net-message__content--empty {
        color: var(--body-quiet-color);
    }
    .admin-home-net-message {
        justify-self: start;
    }
    .admin-home-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
    .admin-dashboard-warning {
        margin-bottom: 1.25rem;
        padding: 0.9rem 1rem;
        border-radius: 8px;
        border: 1px solid rgba(240, 129, 15, 0.35);
        background: rgba(240, 129, 15, 0.12);
        color: inherit;
        line-height: 1.5;
    }
    .admin-dashboard-warning__title {
        margin: 0 0 0.35rem;
        font-size: 1rem;
        font-weight: 600;
    }
    .admin-dashboard-warning__body {
        margin: 0;
    }
    .admin-dashboard-warning__body a {
        color: inherit;
        font-weight: 600;
        text-decoration: underline;
    }
    [data-theme="dark"] .admin-home-net-message {
        --net-message-text-color: #ffffff;
    }
    [data-theme="dark"] .admin-dashboard-warning {
        border-color: rgba(240, 129, 15, 0.5);
        background: rgba(240, 129, 15, 0.2);
    }
    @media (max-width: 992px) {
        #admin-home-header {
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }
        .admin-home-actions {
            justify-content: flex-start;
        }
        .admin-home-net-message {
            width: 100%;
        }
    }
    .dashboard-main {
        flex: 1 1 calc(70% - 0.5rem);
        min-width: 300px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .dashboard-side {
        flex: 1 1 calc(30% - 0.5rem);
        min-width: 300px;
        max-width: 100%;
        box-sizing: border-box;
        background: var(--darkened-bg);
        padding-top: 12px;
        padding-left: 12px;
        padding-right: 12px;
    }
    .dashboard-side .module {
        background: none;
    }
    .dashboard-side .module h2 {
        background: none;
        padding-left: 16px;
        padding-right: 16px;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--hairline-color);
        font-size: 1.125rem;
        color: var(--body-fg);
    }
    .dashboard-side h3 {
        color: var(--body-quiet-color);
        padding: 0 16px;
        margin: 0 0 16px;
    }
    .dashboard-side p {
        padding: 0 16px;
    }
    .dashboard-side .actionlist {
        padding: 0;
        margin: 16px;
    }
    .dashboard-side .actionlist li {
        line-height: 1.2;
        margin-bottom: 10px;
        padding-left: 18px;
    }
    .dashboard-side .latest-updates-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .dashboard-side .latest-updates-timestamp {
        font-size: 0.75rem;
        color: var(--body-quiet-color);
    }
    #google-calendar-module {
        margin-bottom: 16px;
    }
    #google-calendar-module .calendar-event-list {
        list-style: none;
        padding: 0 16px 8px;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    #google-calendar-module .calendar-event {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    #google-calendar-module .calendar-event-title {
        font-weight: 600;
        text-decoration: none;
        color: inherit;
    }
    #google-calendar-module .calendar-event-title:focus,
    #google-calendar-module .calendar-event-title:hover {
        text-decoration: underline;
    }
    #google-calendar-module .calendar-event-time,
    #google-calendar-module .calendar-event-location {
        padding: 0;
        margin: 0;
        color: var(--body-quiet-color);
    }
    #google-calendar-module .calendar-empty,
    #google-calendar-module .calendar-link {
        padding: 0 16px 16px;
        margin: 0;
    }
    #google-calendar-module .calendar-link a {
        color: var(--body-quiet-color);
        text-decoration: none;
        font-weight: 600;
    }
    #google-calendar-module .calendar-link a:focus,
    #google-calendar-module .calendar-link a:hover {
        text-decoration: underline;
        color: var(--link-fg);
    }

    .dashboard-main .dashboard-model-cell {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .dashboard-main .dashboard-model-heading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .dashboard-main .dashboard-model-name {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dashboard-main .dashboard-model-status {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .dashboard-main .dashboard-model-status--failure {
        color: #ff7043;
    }

    .dashboard-main .module th[scope="row"] .favorite-star {
        margin-right: 8px;
    }
    #release-manager-module {
        margin-bottom: 16px;
    }
    #release-manager-module .release-manager-task-list {
        list-style: none;
        margin: 0;
        padding: 0 16px 12px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    #release-manager-module .release-manager-module__empty {
        margin: 0;
        padding: 0 16px 16px;
        color: var(--body-quiet-color);
    }
    #release-manager-module .release-manager-task {
        background: var(--body-bg);
        border: 1px solid var(--hairline-color);
        border-radius: 10px;
        padding: 12px 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        color: var(--body-fg);
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    }
    [data-theme="dark"] #release-manager-module .release-manager-task {
        background: rgba(15, 23, 42, 0.7);
        border-color: rgba(148, 163, 184, 0.35);
        box-shadow: none;
    }
    #release-manager-module .release-manager-task__title {
        font-weight: 600;
        font-size: 0.95rem;
        display: flex;
        align-items: baseline;
        gap: 6px;
    }
    #release-manager-module .release-manager-task__link {
        color: inherit;
        text-decoration: none;
    }
    #release-manager-module .release-manager-task__link:hover,
    #release-manager-module .release-manager-task__link:focus {
        text-decoration: underline;
        color: var(--link-fg);
    }
    #release-manager-module .release-manager-task__meta {
        margin: 0;
        font-size: 0.8rem;
        color: var(--body-quiet-color);
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }
    #release-manager-module .release-manager-task__label {
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }
    #release-manager-module .release-manager-task__details {
        margin: 0;
        color: var(--body-quiet-color);
    }
    #release-manager-module .release-manager-task__actions {
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
    #release-manager-module .release-manager-task__action {
        color: var(--link-fg);
        font-weight: 600;
        text-decoration: none;
        word-break: break-word;
    }
    #release-manager-module .release-manager-task__action:hover,
    #release-manager-module .release-manager-task__action:focus {
        text-decoration: underline;
    }
    #release-manager-module .release-manager-task__action--secondary {
        color: var(--body-quiet-color);
    }
    #release-manager-module .release-manager-task__action--secondary:hover,
    #release-manager-module .release-manager-task__action--secondary:focus {
        color: var(--link-fg);
    }
    #release-manager-module .release-manager-module__footer {
        padding: 0 16px 16px;
        margin: 0;
    }
    #release-manager-module .release-manager-module__footer a {
        color: var(--body-quiet-color);
        font-weight: 600;
        text-decoration: none;
    }
    #release-manager-module .release-manager-module__footer a:hover,
    #release-manager-module .release-manager-module__footer a:focus {
        text-decoration: underline;
        color: var(--link-fg);
    }
    /* Override Django's dashboard defaults so the flex layout works */
    .dashboard #content {
        width: auto;
        box-sizing: border-box;
    }
    #content-main,
    #recent-boxes {
        float: none;
        width: auto;
    }
    .dashboard-main td.actions {
        text-align: right;
        white-space: nowrap;
    }
    .dashboard-main td.actions .actionlink {
        display: inline;
        margin-left: 0;
    }
    .dashboard-main .module table {
        width: 100%;
    }
    .dashboard-main .app-caption {
        width: 100%;
        box-sizing: border-box;
        padding: 6px 8px;
    }
    .app-caption-inner {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .app-caption-link {
        display: block;
        width: 100%;
        color: inherit;
        text-decoration: none;
        padding: 2px;
        margin-left: auto;
    }
    .app-caption-link:focus-visible,
    .app-caption-link:hover {
        text-decoration: underline;
    }
    .app-caption-inner .section {
        flex: 1 1 auto;
    }
    .dashboard-main .dashboard-model-heading {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }
    .dashboard-main .dashboard-model-name {
        flex: 1 1 auto;
        min-width: 0;
    }
    .dashboard-main .rfid-release-separator {
        font-weight: 700;
        color: var(--body-quiet-color);
    }
    .dashboard-main .app-caption .section {
        display: block;
        width: 100%;
    }
    #viewhistory-mini-module {
        margin-top: 16px;
    }
    #viewhistory-mini-module .chart-wrapper {
        position: relative;
        padding: 0 16px 16px;
    }
    #viewhistory-mini-module canvas {
        display: block;
        width: 100%;
        height: 180px;
    }
    #viewhistory-mini-empty {
        padding: 0 16px;
        margin: 0;
        color: var(--body-quiet-color);
    }
    #viewhistory-mini-module .chart-link {
        padding: 0 16px 16px;
        margin: 0;
    }

    @media (max-width: 640px) {
        .dashboard {
            flex-direction: column;
        }

        .dashboard-main,
        .dashboard-side {
            min-width: 0;
        }

        .dashboard-main .module table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
        }

        .dashboard-main .module table thead {
            display: none;
        }

        .dashboard-main .module tbody {
            display: block;
        }

        .dashboard-main .module tbody tr {
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 12px 16px;
            margin: 0 0 12px;
            border: 1px solid var(--hairline-color);
            border-radius: 12px;
            background: var(--body-bg);
        }

        .dashboard-main .module tbody tr:last-child {
            margin-bottom: 0;
        }

        .dashboard-main .module th[scope="row"] {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 0;
            margin: 0;
        }

        .dashboard-main .dashboard-model-cell {
            display: flex;
            align-items: center;
            gap: 8px;
            width: 100%;
        }

        .dashboard-main .module td {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 0;
            margin: 0;
        }

        .dashboard-main .module td.actions {
            text-align: left;
        }

        .dashboard-main .module [data-label]::before {
            content: attr(data-label);
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--body-quiet-color);
        }

        .dashboard-main .module .change-link-cell {
            display: none;
        }

        .dashboard-main .module .change-link-cell.change-link-cell--view-only {
            display: flex;
        }

        .dashboard-side {
            padding-left: 0;
            padding-right: 0;
        }
    }
  </style>
