html, body {
    min-height: 100%;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: #f6fafc;
}

a {
    text-decoration: none;
}

.page-shell {
    width: calc(100% - 40px);
    max-width: none;
    margin: 20px 20px 0;
    padding-left: 0;
    padding-right: 0;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.top-user-avatar {
    width: 64px;
    height: 64px;
}

.top-user-avatar img {
    object-fit: cover;
}

.top-user-avatar-clickable {
    cursor: pointer;
}

.top-user-avatar-clickable:hover {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 2px;
}

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

.editor-grid-wide {
    grid-column: 1 / -1;
}

.confirm-dialog {
    min-width: min(360px, 72vw);
    padding-top: 6px;
}

.record-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.record-subline {
    color: #235e84;
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
}

.avatar-crop-shell {
    width: 250px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(15, 76, 129, 0.18);
    background: #eef6fb;
}

.avatar-crop-canvas {
    display: block;
    width: 250px;
    height: 250px;
    max-width: 100%;
    cursor: move;
}

.gallery-crop-workspace {
    display: grid;
    grid-template-columns: minmax(0, 700px) minmax(220px, 320px);
    gap: 18px;
    align-items: start;
}

.gallery-crop-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.gallery-crop-result {
    min-height: 180px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10px;
    border: 1px dashed rgba(15, 76, 129, 0.22);
    border-radius: 8px;
    background: #f8fbfd;
}

.gallery-upload-preview-shell {
    width: min(700px, 100%);
    border: 1px solid rgba(15, 76, 129, 0.18);
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff;
    touch-action: none;
}

.gallery-upload-preview-canvas {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
    cursor: crosshair;
    touch-action: none;
}

.gallery-confirm-crop-button {
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 38px;
    padding: 8px 16px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: #2f7d32;
    font: 600 0.95rem Inter, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.gallery-confirm-crop-button:hover {
    background: #256628;
}

#galleryImagePreview {
    width: 100%;
    max-height: 240px;
    border: 1px solid rgba(15, 76, 129, 0.18);
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
}

@media (max-width: 899.98px) {
    .gallery-crop-workspace {
        grid-template-columns: 1fr;
    }

    .gallery-crop-result {
        justify-content: flex-start;
    }

    #galleryImagePreview {
        width: min(320px, 100%);
    }
}

.gallery-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.gallery-card {
    height: 100%;
    overflow: hidden;
    border-color: rgba(15, 76, 129, 0.14) !important;
    background: #ffffff !important;
}

.gallery-card-image-wrap {
    aspect-ratio: 4 / 3;
    width: 100%;
    overflow: hidden;
    background: #eef6fb;
}

.gallery-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.gallery-card-title {
    color: #1f2d3d;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.gallery-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    color: #607d8b;
    font-size: 0.78rem;
}

.gallery-card-meta span {
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(15, 76, 129, 0.07);
}

.campaign-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.campaign-card {
    min-height: 145px;
    overflow: hidden;
    border-color: rgba(15, 76, 129, 0.14) !important;
    background: #ffffff !important;
}

.campaign-card-body {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
}

.campaign-card-period {
    color: #0f6b7a;
    font-weight: 800;
}

.campaign-card-title {
    color: #1f2d3d;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.campaign-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: auto;
}

.campaign-logo-input {
    display: none;
}

.campaign-logo-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 16px;
    border-radius: 4px;
    color: #ffffff;
    background: #0f4c81;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.campaign-logo-upload-button:hover {
    background: #0b365b;
}

.campaign-logo-upload-button-disabled,
.campaign-logo-upload-button-disabled:hover {
    background: #9eb4c7;
    cursor: wait;
    pointer-events: none;
}

.campaign-logo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.campaign-logo-card {
    position: relative;
    aspect-ratio: 1.6 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 14px;
    border-color: rgba(15, 76, 129, 0.14) !important;
    background: #ffffff !important;
}

.campaign-logo-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.campaign-logo-delete {
    position: absolute !important;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.9) !important;
}

.users-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.user-card {
    height: 100%;
    overflow: hidden;
    border-color: rgba(15, 76, 129, 0.14) !important;
    background: rgba(255, 255, 255, 0.94) !important;
}

.user-card-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    padding: 24px;
}

.user-card-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-card-avatar {
    width: 88px;
    height: 88px;
    flex: 0 0 88px;
    border: 4px solid rgba(255, 255, 255, 0.92);
    border-radius: 24px;
    object-fit: cover;
    background: #dbe8f4;
    box-shadow: 0 14px 28px rgba(15, 76, 129, 0.16);
}

.user-card-title {
    min-width: 0;
}

.user-card-name {
    color: #1f2d3d;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.user-card-status {
    display: inline-flex;
    align-items: center;
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #0f6b7a;
    background: rgba(23, 162, 184, 0.12);
    font-size: 0.9rem;
    font-weight: 700;
}

.user-card-meta {
    display: grid;
    gap: 14px;
    margin: 0;
}

.user-card-meta dt {
    margin: 0 0 5px;
    color: #7e8da3;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.user-card-meta dd {
    margin: 0;
    color: #1f2d3d;
    font-size: 0.98rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.user-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.users-empty-state {
    text-align: center;
}

.profile-summary-card {
    height: 100%;
}

.profile-summary-avatar {
    width: 150px;
    height: 150px;
    border: 5px solid rgba(255, 255, 255, 0.92);
    border-radius: 32px;
    object-fit: cover;
    background: #dbe8f4;
    box-shadow: 0 16px 36px rgba(15, 76, 129, 0.18);
}

.profile-summary-meta {
    width: 100%;
    margin-top: 12px;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background:
        radial-gradient(circle at 16% 18%, rgba(91, 140, 90, 0.18), transparent 26%),
        linear-gradient(135deg, #f5fbf8 0%, #eef6fb 48%, #fff8ee 100%);
}

.login-card {
    width: min(100%, 980px);
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
    overflow: hidden;
    border: 1px solid rgba(15, 76, 129, 0.12);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 26px 70px rgba(15, 76, 129, 0.16);
}

.login-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 56px;
    color: #173f5f;
    background:
        linear-gradient(145deg, rgba(15, 76, 129, 0.08), rgba(91, 140, 90, 0.18)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.22));
}

.login-mark {
    width: 72px;
    height: 72px;
    color: #ffffff;
    background: linear-gradient(135deg, #0f4c81, #5b8c5a);
}

.login-title {
    color: #173f5f;
    font-weight: 800;
}

.login-subtitle {
    color: #5b8c5a;
    font-weight: 700;
}

.login-copy {
    max-width: 430px;
    color: #38566d;
    line-height: 1.8;
}

.login-panel {
    display: flex;
    align-items: center;
    border-radius: 0;
    background: #ffffff;
}

.application-page {
    min-height: 100vh;
    color: #27323a;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 196, 87, 0.32), transparent 27%),
        radial-gradient(circle at 88% 12%, rgba(67, 146, 122, 0.22), transparent 28%),
        radial-gradient(circle at 72% 88%, rgba(224, 112, 92, 0.18), transparent 32%),
        linear-gradient(145deg, #fff7e8 0%, #f7ece2 45%, #eef7f2 100%);
}

.application-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 42px;
    padding-bottom: 42px;
}

.application-panel {
    width: 100%;
    padding: 34px;
    border: 1px solid rgba(116, 86, 54, 0.14);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.92) !important;
    box-shadow: 0 24px 70px rgba(94, 71, 47, 0.18);
    backdrop-filter: blur(18px);
}

.application-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    padding: 22px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 246, 227, 0.82)),
        linear-gradient(135deg, rgba(15, 76, 129, 0.08), rgba(91, 140, 90, 0.12));
}

.application-mark {
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #e0705c, #0f7b76);
    box-shadow: 0 16px 34px rgba(15, 123, 118, 0.22);
}

.application-mark .mud-icon-root {
    font-size: 34px;
}

.application-hero-copy {
    min-width: 0;
}

.application-eyebrow {
    color: #b25f38;
    font-weight: 800;
    letter-spacing: 0;
}

.application-title {
    color: #263b34;
    font-weight: 800;
    line-height: 1.12;
}

.application-muted {
    max-width: 680px;
    color: #5f6d66;
    line-height: 1.7;
}

.application-stepper {
    overflow: hidden;
    border: 1px solid rgba(116, 86, 54, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.application-stepper .mud-stepper-actions {
    display: none;
}

.application-panel .mud-button-filled-primary {
    background: #0f7b76 !important;
    box-shadow: 0 12px 26px rgba(15, 123, 118, 0.22);
}

.application-panel .mud-button-text {
    color: #8c4e2f !important;
}

.application-panel .mud-input-control {
    background: rgba(255, 255, 255, 0.46);
    padding-top: 8px;
}

.application-panel .mud-input-label {
    max-width: calc(133% - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translate(0, 1.5px) scale(0.75) !important;
    transform-origin: top left;
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.application-grid-wide {
    grid-column: 1 / -1;
}

.muted-cell {
    color: #607d8b;
    font-size: 0.9rem;
}

@media (max-width: 1199.98px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .users-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .campaign-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 599.98px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        padding: 14px;
    }

    .login-card {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: 20px;
    }

    .login-visual {
        padding: 32px 28px 18px;
    }

    .login-panel {
        padding: 28px !important;
    }

    .application-shell {
        min-height: 100vh;
        padding: 16px;
    }

    .application-panel {
        padding: 18px;
    }

    .application-hero {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .application-mark {
        width: 58px;
        height: 58px;
    }

    .application-grid {
        grid-template-columns: 1fr;
    }

    .application-grid-wide {
        grid-column: auto;
    }

    .users-card-grid {
        grid-template-columns: 1fr;
    }

    .campaign-card-grid {
        grid-template-columns: 1fr;
    }

    .user-card-body {
        padding: 20px;
    }

    .user-card-avatar {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }
}
