@media (min-width: 48rem) {
    :root {
        --page-bg: #eeeeee;
        --header-bg: #33383e;
        --header-text: #ffffff;
        --accent: #006be8;
        --accent-dark: #004ba7;
        --panel-border: #d4d8dc;
        --panel-heading: #e6e7e8;
        --text: #303942;
        --muted: #6d7277;
        --input-border: #b8c0c7;
        --input-focus: #222222;
    }

    html {
        font-size: 12px;
    }

    body {
        color: var(--text);
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
        line-height: 1.2;
        background:
            radial-gradient(circle at 0 0, rgba(0, 0, 0, 0.045) 0 1px, transparent 1px),
            radial-gradient(circle at 2px 2px, rgba(255, 255, 255, 0.9) 0 1px, transparent 1px),
            var(--page-bg);
        background-size: 4px 4px;
    }

    a {
        color: #0067b1;
    }

    .app-shell {
        min-height: 100vh;
        padding-bottom: 0;
    }

    .app-header {
        min-height: 98px;
        display: block;
        padding: 14px 22px 0;
        color: var(--header-text);
        background: var(--header-bg);
        border-bottom: 0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
        position: relative;
    }

    .app-brand {
        display: inline-block;
        width: auto;
        color: var(--header-text);
        font-size: 29px;
        font-weight: 700;
        line-height: 1;
        text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
    }

    .mobile-menu-toggle,
    .mobile-menu-button {
        display: none;
    }

    .app-nav {
        position: absolute;
        left: 0;
        bottom: 0;
        display: flex;
        gap: 0;
        align-items: flex-end;
        justify-content: flex-start;
        padding-left: 0;
    }

    .app-nav a {
        min-height: 38px;
        display: flex;
        align-items: center;
        padding: 0 21px;
        color: var(--header-text);
        border: 1px solid transparent;
        border-bottom: 0;
        border-radius: 4px 4px 0 0;
        font-size: 14px;
        font-weight: 700;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
    }

    .app-nav a.is-active {
        background: var(--accent);
        border-color: color-mix(in srgb, var(--accent) 78%, #ffffff);
        border-bottom-color: var(--accent);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
        text-decoration: none;
    }

    .logout-form {
        position: absolute;
        top: 16px;
        right: 22px;
        display: flex;
        gap: 12px;
        align-items: center;
        color: #dce7f3;
    }

    .logout-form button,
    .app-header > a[href$="login"] {
        min-height: 20px;
        padding: 1px 8px;
        color: #ffffff;
        cursor: pointer;
        background: linear-gradient(#8ac34a, #4b8f1f);
        border: 1px solid #315d13;
        border-radius: 2px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .global-search {
        position: absolute;
        right: 22px;
        bottom: 9px;
        width: auto;
    }

    .global-search label {
        display: block;
    }

    .global-search span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .global-search input,
    input[type="search"] {
        width: 226px;
        min-height: 26px;
        height: 26px;
        padding: 5px 8px 5px 28px;
        color: #d8d8d8;
        background: linear-gradient(#222222, #0c0c0c);
        border: 1px solid #1d1f22;
        border-radius: 3px;
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
        font-size: 12px;
    }

    .sub-nav {
        min-height: 36px;
        display: flex;
        flex-wrap: nowrap;
        gap: 34px;
        align-items: center;
        padding: 0 30px;
        color: #ffffff;
        background: var(--accent);
        border-bottom: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
    }

    .sub-nav a,
    .sub-nav label,
    .assigned-filter,
    .assigned-filter label {
        color: #ffffff;
        font-size: 12px;
        font-weight: 700;
    }

    .assigned-filter {
        margin: 0;
    }

    .assigned-filter label {
        display: inline-flex;
        gap: 7px;
        align-items: center;
    }

    .app-main {
        width: calc(100% - 44px);
        max-width: 1210px;
        margin: 22px auto 0;
    }

    .auth-panel {
        width: 320px;
        max-width: calc(100vw - 32px);
        margin: 36px auto 0;
        padding: 0 0 32px;
    }

    .auth-panel h1 {
        margin: 0 0 22px;
        color: #000000;
        font-size: 17px;
        line-height: 1.2;
        text-align: center;
    }

    .auth-form {
        position: relative;
        width: 320px;
        max-width: 100%;
        min-height: 256px;
        display: block;
        margin: 0 auto;
        padding: 58px 32px 28px;
        background: #f7f7f7;
        border: 1px solid var(--panel-border);
        border-radius: 4px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
    }

    .auth-form::before {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 36px;
        color: #2e3a45;
        content: "Login to the CRM";
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--panel-heading);
        border-bottom: 1px solid #d9dcdf;
        border-radius: 4px 4px 0 0;
        font-weight: 700;
    }

    .auth-form label:not(.checkbox-row) {
        display: grid;
        grid-template-columns: 78px 1fr;
        gap: 14px;
        align-items: center;
        margin-bottom: 14px;
        color: #5a626a;
        font-weight: 400;
    }

    .auth-form input[type="email"],
    .auth-form input[type="password"] {
        width: 153px;
        min-height: 23px;
        height: 23px;
        padding: 2px 5px;
        border-radius: 2px;
    }

    .auth-form button[type="submit"] {
        width: 145px;
        min-height: 27px;
        height: 27px;
        display: block;
        margin: 0 0 12px 101px;
        background: linear-gradient(#4d8eb5, #1f5c82);
        border: 1px solid #0e3148;
        border-radius: 3px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
        text-transform: lowercase;
    }

    .directory-layout {
        display: grid;
        grid-template-columns: 212px 1fr;
        gap: 20px;
        align-items: start;
    }

    .directory-sidebar {
        order: 1;
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .directory-content {
        order: 2;
        min-width: 0;
    }

    .sidebar-box {
        min-height: 68px;
        padding: 20px;
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid #d5d9dd;
        border-radius: 4px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    }

    .sidebar-box h2 {
        margin: 0;
        color: #000000;
        font-size: 14px;
    }

    .contact-table {
        display: table;
        width: 100%;
        border-collapse: collapse;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.72);
        border: 1px solid #cdd3d8;
        border-radius: 4px;
        box-shadow: none;
    }

    .contact-table th {
        height: 37px;
        color: #005cab;
        background: #e9ecef;
        border-bottom: 1px solid #d5d9dd;
        font-size: 12px;
        font-weight: 700;
        text-align: left;
    }

    .contact-table th,
    .contact-table td {
        padding: 10px 14px;
        white-space: normal;
    }

    .contact-table td {
        height: 64px;
        border-bottom: 1px solid #d6d6d6;
        font-size: 14px;
    }

    .record-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 356px;
        gap: 20px;
        align-items: start;
    }

    .record-hero,
    .record-history-panel,
    .record-details,
    .crm-form-panel,
    .crm-panel,
    .placeholder-panel,
    .task-item {
        background: rgba(255, 255, 255, 0.82);
        border: 1px solid #cdd3d8;
        border-radius: 4px;
        box-shadow: none;
    }

    .tasks-page {
        display: grid;
        gap: 20px;
    }

    .tasks-page .crm-panel h1 {
        margin: 0 0 14px;
        color: #000000;
        font-size: 16px;
    }

    .task-table td strong,
    .task-table td span {
        display: block;
    }

    .task-table td span {
        margin-top: 3px;
        color: #58616a;
    }

    .record-hero {
        min-height: 98px;
        display: flex;
        gap: 12px;
        align-items: center;
        padding: 20px;
        margin-bottom: 20px;
    }

    .record-hero h1 {
        margin: 2px 0 0;
        color: #000000;
        font-size: 20px;
        line-height: 1.15;
        text-transform: uppercase;
    }

    .record-tabs {
        min-height: 36px;
        display: flex;
        gap: 30px;
        align-items: center;
        padding: 0 22px;
        overflow-x: visible;
        background: #0864e6;
        border-bottom: 1px solid #013b97;
    }

    .record-tabs a {
        min-height: auto;
        padding: 0;
        color: #ffffff;
        border-radius: 0;
        font-weight: 700;
    }

    .record-tabs .is-active {
        padding: 5px 14px;
        color: #ffffff;
        background: #07101a;
        border-radius: 14px;
    }

    .record-actions {
        display: flex;
        grid-template-columns: none;
        justify-content: space-between;
        gap: 20px;
        padding: 20px;
        border-bottom: 0;
    }

    .record-options {
        min-width: 350px;
        display: block;
        color: #555d65;
        border-bottom: 1px solid #d1d6da;
    }

    .record-details dl {
        display: grid;
        grid-template-columns: 108px 1fr;
        row-gap: 15px;
        padding: 12px 20px 18px;
    }

    .record-details dt {
        color: #59616a;
        text-align: right;
        padding-right: 40px;
        font-weight: 400;
    }
}

@media (min-width: 48rem) and (max-width: 76rem) {
    .app-nav {
        max-width: calc(100vw - 12px);
        overflow: hidden;
    }

    .app-nav a {
        padding-right: 10px;
        padding-left: 10px;
        font-size: 13px;
        white-space: nowrap;
    }

    .global-search input,
    input[type="search"] {
        width: 190px;
    }
}

@media (min-width: 48rem) and (max-width: 64rem) {
    .global-search {
        display: none;
    }

    .app-nav a {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12px;
    }
}
