:root {
    --app-bg: #f3f6f7;
    --app-surface: #ffffff;
    --app-surface-muted: #f8fafb;
    --app-border: #dce4e7;
    --app-text: #172126;
    --app-muted: #647178;
    --app-primary: #0f766e;
    --app-primary-hover: #115e59;
    --app-accent: #2563eb;
    --app-danger: #dc2626;
    --app-shadow: 0 1px 2px rgba(23, 33, 38, 0.05), 0 8px 24px rgba(23, 33, 38, 0.06);
}

html {
    background: var(--app-bg);
}

body {
    min-width: 320px;
    background: var(--app-bg) !important;
    color: var(--app-text);
    font-family: 'Mulish', sans-serif;
    letter-spacing: 0;
}

body > .absolute.inset-0,
body > .relative > .absolute.inset-0 {
    display: none;
}

.app-header {
    position: sticky !important;
    top: 0;
    z-index: 50;
    width: 100%;
    height: 64px;
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid var(--app-border) !important;
    box-shadow: 0 1px 2px rgba(23, 33, 38, 0.04);
    backdrop-filter: blur(14px);
}

.app-header > div {
    height: 100%;
    padding: 0 24px;
}

.app-header > div > div {
    height: 100%;
}

.app-brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    background: var(--app-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

.app-mobile-menu {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
    color: var(--app-text);
}

#appSidebar {
    position: sticky;
    top: 64px;
    flex: 0 0 264px;
    width: 264px;
    height: calc(100vh - 64px);
    min-height: 0;
    overflow-y: auto;
    border-right: 1px solid var(--app-border);
    background: #eef3f2 !important;
    box-shadow: none !important;
}

#appSidebar nav > a,
#appSidebar section a,
#appSidebar .add-requirements-menu > button {
    min-height: 44px;
    margin: 2px 8px;
    padding: 8px 10px !important;
    border-radius: 7px !important;
}

#appSidebar nav > a:hover,
#appSidebar section a:hover,
#appSidebar .add-requirements-menu > button:hover {
    background: rgba(255, 255, 255, 0.78) !important;
}

#appSidebar nav > a.bg-white,
#appSidebar section a.bg-white,
#appSidebar .add-requirements-menu > button.bg-white {
    background: #fff !important;
    color: var(--app-primary);
    box-shadow: 0 1px 3px rgba(23, 33, 38, 0.08) !important;
}

#appSidebar nav > a > div,
#appSidebar section a > div,
#appSidebar .add-requirements-menu > button > div {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px;
    border-radius: 7px !important;
}

#appSidebar section > button {
    min-height: 40px;
    border-radius: 7px !important;
}

#sidebarBackdrop {
    display: none;
}

main {
    min-width: 0;
    max-width: 100%;
    padding: 24px !important;
}

main > .mb-6:first-child {
    margin-bottom: 20px !important;
}

main h1.text-3xl {
    color: var(--app-text) !important;
    font-size: 28px !important;
    line-height: 1.25;
    background: none !important;
    -webkit-text-fill-color: currentColor;
}

main h2,
main h3 {
    letter-spacing: 0;
}

main [class*="backdrop-blur"][class*="bg-white/40"],
main [class*="backdrop-blur"][class*="bg-white/20"] {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
    border-radius: 8px !important;
    box-shadow: var(--app-shadow) !important;
    backdrop-filter: none !important;
}

main [class*="hover:-translate-y"] {
    transform: none !important;
}

main [class*="hover:-translate-y"]:hover {
    border-color: #c6d3d7 !important;
    box-shadow: 0 10px 28px rgba(23, 33, 38, 0.1) !important;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    min-height: 42px;
    border: 1px solid #cbd5da !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: var(--app-text) !important;
    box-shadow: inset 0 1px 1px rgba(23, 33, 38, 0.03);
}

textarea {
    min-height: 96px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--app-primary) !important;
    outline: 3px solid rgba(15, 118, 110, 0.13) !important;
    box-shadow: none !important;
}

label {
    color: #344249 !important;
}

main button[class*="bg-gradient-to-r"],
main a[class*="bg-gradient-to-r"][class*="text-white"] {
    border-radius: 6px !important;
    box-shadow: 0 1px 2px rgba(23, 33, 38, 0.14) !important;
}

main button[class*="bg-gradient-to-r"]:hover,
main a[class*="bg-gradient-to-r"][class*="text-white"]:hover {
    transform: none !important;
    filter: brightness(0.96);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: var(--app-surface-muted) !important;
}

th {
    color: #526168 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0 !important;
}

th,
td {
    border-bottom-color: var(--app-border) !important;
    vertical-align: middle;
}

tbody tr:hover {
    background: #f7faf9 !important;
}

#modalOverlay {
    background: rgba(15, 23, 26, 0.52) !important;
}

#modalContent {
    border: 1px solid var(--app-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 24px 60px rgba(15, 23, 26, 0.22) !important;
}

@media (max-width: 900px) {
    .app-header > div {
        padding: 0 14px;
    }

    .app-mobile-menu {
        display: inline-flex;
    }

    .app-user-meta,
    .app-logout-label {
        display: none;
    }

    #appSidebar {
        position: fixed;
        top: 64px;
        bottom: 0;
        left: 0;
        z-index: 60;
        width: 280px;
        height: calc(100vh - 64px);
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open #appSidebar {
        transform: translateX(0);
    }

    #sidebarBackdrop {
        position: fixed;
        inset: 64px 0 0;
        z-index: 55;
        background: rgba(15, 23, 26, 0.42);
    }

    body.sidebar-open #sidebarBackdrop {
        display: block;
    }

    main {
        width: 100% !important;
        padding: 18px 14px !important;
    }

    main > .mb-6:first-child > .flex,
    main > .mb-6:first-child .flex.justify-between {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 12px;
    }

    main > .mb-6:first-child .flex.space-x-3 {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        margin-left: 0;
    }

    main > .mb-6:first-child .flex.space-x-3 > * {
        margin-left: 0 !important;
    }

    main h1.text-3xl {
        font-size: 24px !important;
    }

    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 560px) {
    main button[class*="px-6"],
    main a[class*="px-6"] {
        padding-right: 14px !important;
        padding-left: 14px !important;
    }

    #modalOverlay > div {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #modalContent {
        width: 100%;
        max-height: 92vh !important;
        border-radius: 8px 8px 0 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}