:root {
    --dipeo-orange: #f26a21;
    --dipeo-orange-dark: #d9530c;
    --dipeo-anthracite: #20242a;
    --dipeo-ink: #30353c;
    --dipeo-muted: #707780;
    --dipeo-border: #e5e7eb;
    --dipeo-surface: #f5f6f8;
    --dipeo-white: #ffffff;
    --dipeo-success: #15803d;
    --dipeo-danger: #b42318;
    --sidebar-width: 250px;
    --shadow: 0 18px 45px rgba(32, 36, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--dipeo-anthracite);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--dipeo-surface);
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.enterprise-eyebrow {
    margin: 0 0 8px;
    color: var(--dipeo-orange);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.enterprise-brand,
.auth-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--dipeo-white);
    text-decoration: none;
}

.enterprise-brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: var(--dipeo-white);
    font-size: 21px;
    font-weight: 800;
    background: var(--dipeo-orange);
}

.enterprise-brand strong,
.auth-brand strong {
    display: block;
    font-size: 19px;
}

.enterprise-brand small,
.auth-brand small {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-body {
    background: var(--dipeo-white);
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(340px, 0.9fr) minmax(480px, 1.1fr);
}

.auth-brand-panel {
    display: flex;
    min-height: 100vh;
    padding: 52px;
    flex-direction: column;
    justify-content: space-between;
    color: var(--dipeo-white);
    background:
        radial-gradient(
            circle at 15% 20%,
            rgba(242, 106, 33, 0.28),
            transparent 34%
        ),
        linear-gradient(145deg, #1e2228, #292e35);
}

.auth-introduction {
    max-width: 560px;
}

.auth-introduction h1 {
    max-width: 500px;
    margin: 0 0 22px;
    font-size: clamp(42px, 6vw, 76px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.auth-introduction > p:last-child {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 18px;
    line-height: 1.65;
}

.auth-copyright {
    margin: 0;
    color: rgba(255, 255, 255, 0.48);
    font-size: 13px;
}

.auth-form-panel {
    display: grid;
    min-height: 100vh;
    padding: 48px;
    place-items: center;
    background: var(--dipeo-white);
}

.auth-card {
    width: min(100%, 460px);
}

.auth-card-header {
    margin-bottom: 34px;
}

.auth-card-header h2 {
    margin: 0 0 12px;
    font-size: 36px;
    letter-spacing: -0.035em;
}

.auth-card-header > p:last-child {
    margin: 0;
    color: var(--dipeo-muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 22px;
}

.auth-form label > span {
    display: block;
    margin-bottom: 9px;
    font-size: 13px;
    font-weight: 700;
}

.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--dipeo-border);
    border-radius: 10px;
    outline: none;
    color: var(--dipeo-anthracite);
    background: var(--dipeo-white);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.auth-form input:focus {
    border-color: var(--dipeo-orange);
    box-shadow: 0 0 0 4px rgba(242, 106, 33, 0.12);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: 13px;
}

.auth-options a,
.secondary-link {
    color: var(--dipeo-orange-dark);
    font-weight: 700;
    text-decoration: none;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dipeo-muted);
}

.checkbox-label span {
    margin: 0 !important;
    font-weight: 500 !important;
}

.primary-button {
    width: 100%;
    padding: 15px 20px;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    color: var(--dipeo-white);
    font-weight: 800;
    background: var(--dipeo-orange);
    transition:
        background 160ms ease,
        transform 160ms ease;
}

.primary-button:hover {
    background: var(--dipeo-orange-dark);
    transform: translateY(-1px);
}

.secondary-link {
    display: block;
    text-align: center;
}

.form-message {
    margin-bottom: 22px;
    padding: 13px 15px;
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
}

.form-message-error {
    color: var(--dipeo-danger);
    background: #fff0ee;
}

.form-message-success {
    color: var(--dipeo-success);
    background: #eefbf2;
}

.form-error {
    display: block;
    margin-top: 7px;
    color: var(--dipeo-danger);
}

.enterprise-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.enterprise-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    padding: 28px 22px;
    flex-direction: column;
    color: var(--dipeo-white);
    background: var(--dipeo-anthracite);
}

.enterprise-navigation {
    display: grid;
    gap: 5px;
    margin-top: 46px;
}

.enterprise-navigation a,
.enterprise-navigation span {
    display: block;
    padding: 11px 13px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 14px;
    text-decoration: none;
}

.enterprise-navigation a.is-active {
    color: var(--dipeo-white);
    background: rgba(242, 106, 33, 0.17);
}

.enterprise-sidebar-footer {
    display: grid;
    gap: 4px;
    margin-top: auto;
    color: rgba(255, 255, 255, 0.64);
    font-size: 12px;
}

.enterprise-sidebar-footer small {
    color: rgba(255, 255, 255, 0.38);
}

.enterprise-main {
    display: flex;
    min-height: 100vh;
    grid-column: 2;
    flex-direction: column;
}

.enterprise-header {
    display: flex;
    min-height: 104px;
    padding: 24px 38px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    border-bottom: 1px solid var(--dipeo-border);
    background: var(--dipeo-white);
}

.enterprise-header h1 {
    margin: 0;
    font-size: 27px;
    letter-spacing: -0.03em;
}

.enterprise-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.enterprise-user-data {
    display: grid;
    gap: 3px;
    text-align: right;
}

.enterprise-user-data strong {
    font-size: 13px;
}

.enterprise-user-data span {
    color: var(--dipeo-muted);
    font-size: 12px;
}

.enterprise-logout {
    padding: 9px 13px;
    border: 1px solid var(--dipeo-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--dipeo-ink);
    background: var(--dipeo-white);
}

.enterprise-content {
    width: 100%;
    max-width: 1500px;
    padding: 38px;
    margin: 0 auto;
}

.enterprise-footer {
    display: flex;
    padding: 22px 38px;
    margin-top: auto;
    justify-content: space-between;
    color: var(--dipeo-muted);
    font-size: 12px;
}

.dashboard-welcome {
    display: flex;
    padding: 32px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    border: 1px solid var(--dipeo-border);
    border-radius: 16px;
    background: var(--dipeo-white);
    box-shadow: var(--shadow);
}

.dashboard-welcome h2 {
    margin: 0 0 10px;
    font-size: 30px;
    letter-spacing: -0.035em;
}

.dashboard-welcome p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--dipeo-muted);
    line-height: 1.6;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--dipeo-success);
    font-size: 13px;
    font-weight: 700;
}

.system-status span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--dipeo-success);
}

.dashboard-grid {
    display: grid;
    gap: 20px;
    margin-top: 24px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-card {
    min-height: 220px;
    padding: 25px;
    border: 1px solid var(--dipeo-border);
    border-radius: 14px;
    background: var(--dipeo-white);
}

.dashboard-card-number {
    display: block;
    margin-bottom: 34px;
    color: var(--dipeo-orange);
    font-size: 12px;
    font-weight: 800;
}

.dashboard-card h3 {
    margin: 0 0 11px;
    font-size: 19px;
}

.dashboard-card p {
    margin: 0 0 24px;
    color: var(--dipeo-muted);
    font-size: 14px;
    line-height: 1.55;
}

.dashboard-card-status {
    color: var(--dipeo-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

@media (max-width: 820px) {
    .auth-shell {
        display: block;
    }

    .auth-brand-panel {
        min-height: auto;
        padding: 32px 24px;
    }

    .auth-introduction {
        margin: 70px 0;
    }

    .auth-form-panel {
        min-height: auto;
        padding: 60px 24px;
    }

    .enterprise-shell {
        display: block;
    }

    .enterprise-sidebar {
        position: static;
        width: 100%;
    }

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

    .enterprise-main {
        display: flex;
    }

    .enterprise-header,
    .dashboard-welcome,
    .enterprise-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .enterprise-user {
        width: 100%;
        justify-content: space-between;
    }

    .enterprise-user-data {
        text-align: left;
    }
}

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

    .enterprise-content,
    .enterprise-header,
    .enterprise-footer {
        padding-right: 22px;
        padding-left: 22px;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Dipeo corporate logo */
.auth-logo,
.enterprise-brand {
    display: flex;
    align-items: center;
    width: fit-content;
}

.dipeo-logo {
    display: block;
    width: auto;
    height: 54px;
    object-fit: contain;
}

.enterprise-sidebar .dipeo-logo {
    max-width: 180px;
}

@media (max-width: 620px) {
    .dipeo-logo {
        height: 48px;
    }
}

/* Dipeo corporate wordmark */
.dipeo-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    width: auto;
}

.dipeo-wordmark-icon {
    display: block;
    width: 74px;
    height: 74px;
    flex: 0 0 74px;
    object-fit: contain;
}

.dipeo-wordmark-text {
    display: grid;
    gap: 2px;
    line-height: 1;
}

.dipeo-wordmark-text strong {
    color: #ff5a00;
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.045em;
}

.dipeo-wordmark-text strong span {
    font-size: 0.65em;
    letter-spacing: -0.025em;
}

.dipeo-wordmark-text small {
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.015em;
}

.enterprise-sidebar .dipeo-wordmark {
    gap: 11px;
}

.enterprise-sidebar .dipeo-wordmark-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.enterprise-sidebar .dipeo-wordmark-text strong {
    font-size: 22px;
}

.enterprise-sidebar .dipeo-wordmark-text small {
    max-width: 115px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 9px;
    line-height: 1.2;
}

@media (max-width: 620px) {
    .dipeo-wordmark-icon {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
    }

    .dipeo-wordmark-text strong {
        font-size: 29px;
    }

    .dipeo-wordmark-text small {
        font-size: 12px;
    }
}

/* ==========================================================
   D3.2 – Enterprise Navigation Completion
   ========================================================== */

.enterprise-navigation a {
    border: 1px solid transparent;
    transition:
        color 160ms ease,
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.enterprise-navigation a:hover {
    color: var(--dipeo-white);
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.enterprise-navigation a.is-active {
    border-color: rgba(242, 106, 33, 0.28);
}

.enterprise-header-context {
    min-width: 0;
}

.enterprise-breadcrumb {
    display: flex;
    margin-top: 8px;
    align-items: center;
    gap: 8px;
    color: var(--dipeo-muted);
    font-size: 12px;
}

.enterprise-breadcrumb a {
    color: var(--dipeo-orange-dark);
    font-weight: 700;
    text-decoration: none;
}

.enterprise-breadcrumb a:hover {
    text-decoration: underline;
}

.module-placeholder {
    display: flex;
    min-height: 260px;
    padding: 38px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    border: 1px solid var(--dipeo-border);
    border-radius: 16px;
    background: var(--dipeo-white);
    box-shadow: var(--shadow);
}

.module-placeholder-content {
    max-width: 720px;
}

.module-placeholder h2 {
    margin: 0 0 14px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -0.04em;
}

.module-placeholder-content > p:last-child {
    margin: 0;
    color: var(--dipeo-muted);
    font-size: 16px;
    line-height: 1.7;
}

.module-status-badge {
    display: inline-flex;
    min-height: 34px;
    padding: 7px 12px;
    align-items: center;
    white-space: nowrap;
    border: 1px solid rgba(242, 106, 33, 0.22);
    border-radius: 999px;
    color: var(--dipeo-orange-dark);
    font-size: 12px;
    font-weight: 800;
    background: rgba(242, 106, 33, 0.08);
}

.dashboard-card-link {
    color: inherit;
    text-decoration: none;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.dashboard-card-link:hover {
    border-color: rgba(242, 106, 33, 0.32);
    box-shadow: 0 20px 50px rgba(32, 36, 42, 0.12);
    transform: translateY(-3px);
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 210px;
    }

    .enterprise-sidebar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .enterprise-header {
        padding-right: 24px;
        padding-left: 24px;
    }

    .enterprise-content {
        padding-right: 24px;
        padding-left: 24px;
    }

    .enterprise-user-data {
        display: none;
    }
}

@media (max-width: 700px) {
    .enterprise-shell {
        display: block;
    }

    .enterprise-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        padding: 18px;
    }

    .enterprise-navigation {
        display: flex;
        margin-top: 22px;
        padding-bottom: 6px;
        gap: 7px;
        overflow-x: auto;
    }

    .enterprise-navigation a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .enterprise-sidebar-footer {
        display: none;
    }

    .enterprise-main {
        min-height: auto;
    }

    .enterprise-header {
        min-height: auto;
        padding: 20px;
        align-items: flex-start;
    }

    .enterprise-content {
        padding: 20px;
    }

    .enterprise-footer {
        padding-right: 20px;
        padding-left: 20px;
    }

    .module-placeholder {
        min-height: 220px;
        padding: 26px;
        flex-direction: column;
    }
}

/* ==========================================================
   D4.3 – Customer Explorer
   ========================================================== */

.customer-explorer {
    display: grid;
    gap: 24px;
}

.customer-explorer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.customer-explorer-header h2 {
    margin: 0 0 10px;
    font-size: clamp(30px, 4vw, 44px);
    letter-spacing: -0.04em;
}

.customer-explorer-header p:last-child {
    max-width: 720px;
    margin: 0;
    color: var(--dipeo-muted);
    line-height: 1.65;
}

.customer-explorer-actions,
.customer-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.primary-action-button,
.secondary-button {
    display: inline-flex;
    min-height: 42px;
    padding: 10px 16px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.primary-action-button {
    border: 1px solid var(--dipeo-orange);
    color: var(--dipeo-white);
    background: var(--dipeo-orange);
}

.secondary-button {
    border: 1px solid var(--dipeo-border);
    color: var(--dipeo-anthracite);
    background: var(--dipeo-white);
}

.primary-action-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

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

.customer-statistics article {
    display: grid;
    gap: 7px;
    padding: 20px;
    border: 1px solid var(--dipeo-border);
    border-radius: 13px;
    background: var(--dipeo-white);
}

.customer-statistics span {
    color: var(--dipeo-muted);
    font-size: 12px;
    font-weight: 700;
}

.customer-statistics strong {
    font-size: 25px;
}

.customer-filter-panel {
    display: grid;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--dipeo-border);
    border-radius: 15px;
    background: var(--dipeo-white);
    box-shadow: var(--shadow);
}

.customer-filter-panel label > span,
.customer-filter-search label,
.customer-date-filter legend {
    display: block;
    margin-bottom: 8px;
    color: var(--dipeo-ink);
    font-size: 12px;
    font-weight: 800;
}

.customer-filter-panel input,
.customer-filter-panel select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--dipeo-border);
    border-radius: 8px;
    outline: none;
    color: var(--dipeo-anthracite);
    background: var(--dipeo-white);
}

.customer-filter-panel input:focus,
.customer-filter-panel select:focus {
    border-color: var(--dipeo-orange);
    box-shadow: 0 0 0 4px rgba(242, 106, 33, 0.1);
}

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

.customer-date-filter {
    display: grid;
    margin: 0;
    padding: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border: 1px solid var(--dipeo-border);
    border-radius: 11px;
}

.customer-date-filter legend {
    padding: 0 7px;
}

.customer-table-panel {
    overflow: hidden;
    border: 1px solid var(--dipeo-border);
    border-radius: 15px;
    background: var(--dipeo-white);
    box-shadow: var(--shadow);
}

.customer-table-scroll {
    overflow-x: auto;
}

.customer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.customer-table th,
.customer-table td {
    padding: 15px 14px;
    border-bottom: 1px solid var(--dipeo-border);
    text-align: left;
    vertical-align: top;
}

.customer-table th {
    color: var(--dipeo-muted);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #fafafa;
}

.customer-table tbody tr:hover {
    background: #fffaf7;
}

.customer-table td strong,
.customer-table td small {
    display: block;
}

.customer-table td small {
    margin-top: 5px;
    color: var(--dipeo-muted);
}

.customer-table td a {
    color: var(--dipeo-orange-dark);
    font-weight: 700;
    text-decoration: none;
}

.customer-reference {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.customer-badge,
.customer-status {
    display: inline-flex;
    padding: 5px 9px;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.customer-badge {
    color: var(--dipeo-ink);
    background: #f0f2f5;
}

.customer-badge.is-professional {
    color: #854d0e;
    background: #fef3c7;
}

.customer-badge.is-premium {
    color: #7e22ce;
    background: #f3e8ff;
}

.customer-badge.is-legacy {
    color: #475569;
    background: #e2e8f0;
}

.customer-status.is-active {
    color: var(--dipeo-success);
    background: #eefbf2;
}

.customer-status.is-inactive {
    color: var(--dipeo-danger);
    background: #fff0ee;
}

.customer-pagination {
    display: flex;
    padding: 16px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.customer-pagination p {
    margin: 0;
    color: var(--dipeo-muted);
    font-size: 12px;
}

.customer-pagination-links {
    display: flex;
    align-items: center;
    gap: 13px;
    font-size: 12px;
    font-weight: 700;
}

.customer-pagination-links a {
    color: var(--dipeo-orange-dark);
    text-decoration: none;
}

.customer-pagination-links .is-disabled {
    color: #b6bbc2;
}

.customer-empty-state {
    display: grid;
    min-height: 300px;
    padding: 40px;
    place-items: center;
    align-content: center;
    text-align: center;
}

.customer-empty-state h3 {
    margin: 0 0 10px;
    font-size: 25px;
}

.customer-empty-state > p:not(.enterprise-eyebrow) {
    max-width: 480px;
    margin: 0 0 22px;
    color: var(--dipeo-muted);
}

@media (max-width: 1100px) {
    .customer-filter-grid,
    .customer-statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .customer-explorer-header {
        flex-direction: column;
    }

    .customer-explorer-actions,
    .customer-filter-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .customer-filter-grid,
    .customer-statistics,
    .customer-date-filter {
        grid-template-columns: 1fr;
    }

    .customer-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================
   D4.3 – Final Enterprise Footer
   ========================================================== */

.enterprise-footer {
    display: flex;
    min-height: 82px;
    padding: 18px 38px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-top: 1px solid var(--dipeo-border);
    background: var(--dipeo-white);
}

.enterprise-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--dipeo-anthracite);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.enterprise-footer-brand > span > span {
    color: var(--dipeo-orange);
}

.enterprise-footer-logo {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.enterprise-footer-copyright {
    color: var(--dipeo-muted);
    font-size: 13px;
    font-weight: 600;
}

@media (max-width: 700px) {
    .enterprise-footer {
        min-height: auto;
        padding: 18px 20px;
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================
   D4.3A – Enterprise Icon System
   ========================================================== */

.enterprise-navigation a {
    display: flex;
    align-items: center;
    gap: 11px;
}

.enterprise-navigation-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    stroke-width: 1.8;
}

.enterprise-navigation a.is-active .enterprise-navigation-icon {
    color: var(--dipeo-orange);
}

.enterprise-button-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke-width: 2;
}

.enterprise-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.enterprise-label-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: var(--dipeo-orange-dark);
    stroke-width: 2;
}

.primary-action-button,
.secondary-button {
    gap: 8px;
}

@media (max-width: 700px) {
    .enterprise-navigation-icon {
        width: 18px;
        height: 18px;
    }
}

/* =========================================================
   D5.1 – Enterprise Mail Template Explorer
   ========================================================= */

.enterprise-page {
    display: grid;
    gap: 1.5rem;
}

.enterprise-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.enterprise-page-eyebrow,
.enterprise-dialog-eyebrow {
    margin-bottom: 0.4rem;
    color: #f97316;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.enterprise-page-heading {
    margin: 0;
    color: #172033;
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    line-height: 1.15;
}

.enterprise-page-description {
    max-width: 760px;
    margin: 0.65rem 0 0;
    color: #667085;
    line-height: 1.65;
}

.enterprise-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.65rem 1rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease;
}

.enterprise-button-primary {
    background: #f97316;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.2);
}

.enterprise-button-primary:hover {
    background: #ea580c;
}

.enterprise-button-secondary {
    border-color: #d9dee8;
    background: #ffffff;
    color: #344054;
}

.enterprise-button-secondary:hover {
    border-color: #bfc7d5;
    background: #f8fafc;
}

.enterprise-button-icon {
    width: 1.05rem;
    height: 1.05rem;
    flex: none;
}

.enterprise-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid;
    border-radius: 12px;
    padding: 0.95rem 1rem;
    font-size: 0.9rem;
}

.enterprise-alert ul {
    margin: 0.45rem 0 0;
    padding-left: 1.2rem;
}

.enterprise-alert-success {
    border-color: #a7f3d0;
    background: #ecfdf3;
    color: #067647;
}

.enterprise-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b42318;
}

.enterprise-alert-icon {
    width: 1.3rem;
    height: 1.3rem;
    flex: none;
}

.enterprise-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.enterprise-stat-card {
    display: flex;
    min-height: 112px;
    align-items: center;
    gap: 0.9rem;
    border: 1px solid #e5e9f0;
    border-radius: 14px;
    background: #ffffff;
    padding: 1.1rem;
    box-shadow: 0 4px 15px rgba(16, 24, 40, 0.04);
}

.enterprise-stat-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: none;
    place-items: center;
    border-radius: 12px;
    background: #fff7ed;
    color: #f97316;
}

.enterprise-stat-icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.enterprise-stat-label {
    display: block;
    color: #667085;
    font-size: 0.78rem;
    font-weight: 700;
}

.enterprise-stat-value {
    display: block;
    margin-top: 0.2rem;
    color: #172033;
    font-size: 1.65rem;
    line-height: 1;
}

.enterprise-card {
    overflow: hidden;
    border: 1px solid #e5e9f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.04);
}

.enterprise-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #edf0f5;
    padding: 1.15rem 1.25rem;
}

.enterprise-card-header h3 {
    margin: 0;
    color: #172033;
    font-size: 1rem;
}

.enterprise-card-header p {
    margin: 0.3rem 0 0;
    color: #667085;
    font-size: 0.83rem;
}

.enterprise-filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 2fr) repeat(2, minmax(170px, 1fr)) auto;
    align-items: end;
    gap: 1rem;
    padding: 1.2rem 1.25rem;
}

.enterprise-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 1.5rem;
}

.enterprise-form-field {
    display: grid;
    gap: 0.45rem;
}

.enterprise-form-field-full {
    grid-column: 1 / -1;
}

.enterprise-form-field label {
    color: #344054;
    font-size: 0.82rem;
    font-weight: 700;
}

.enterprise-form-field label span {
    color: #dc2626;
}

.enterprise-input,
.enterprise-select,
.enterprise-textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #d9dee8;
    border-radius: 9px;
    background: #ffffff;
    color: #172033;
    font: inherit;
    font-size: 0.9rem;
    outline: none;
    transition:
        border-color 150ms ease,
        box-shadow 150ms ease;
}

.enterprise-input,
.enterprise-select {
    min-height: 44px;
    padding: 0 0.85rem;
}

.enterprise-textarea {
    min-height: 118px;
    max-height: 190px;
    padding: 0.85rem;
    resize: vertical;
}

.enterprise-input:focus,
.enterprise-select:focus,
.enterprise-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.enterprise-input-icon-wrapper {
    position: relative;
}

.enterprise-input-leading-icon {
    position: absolute;
    top: 50%;
    left: 0.8rem;
    width: 1.05rem;
    height: 1.05rem;
    color: #98a2b3;
    transform: translateY(-50%);
    pointer-events: none;
}

.enterprise-input-with-icon {
    padding-left: 2.45rem;
}

.enterprise-form-hint {
    color: #667085;
    font-size: 0.76rem;
    line-height: 1.5;
}

.enterprise-table-wrapper {
    overflow-x: auto;
}

.enterprise-table {
    width: 100%;
    border-collapse: collapse;
}

.enterprise-table th {
    background: #f8fafc;
    color: #667085;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-align: left;
    text-transform: uppercase;
}

.enterprise-table th,
.enterprise-table td {
    border-bottom: 1px solid #edf0f5;
    padding: 0.95rem 1rem;
    vertical-align: middle;
}

.enterprise-table tbody tr:hover {
    background: #fcfcfd;
}

.enterprise-table tbody tr:last-child td {
    border-bottom: 0;
}

.enterprise-table-primary {
    color: #172033;
    font-size: 0.88rem;
    font-weight: 700;
}

.enterprise-table-secondary,
.enterprise-table-description {
    margin-top: 0.22rem;
    color: #667085;
    font-size: 0.76rem;
    line-height: 1.45;
}

.enterprise-badge,
.enterprise-version-badge,
.enterprise-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.32rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.enterprise-badge {
    background: #f2f4f7;
    color: #475467;
}

.enterprise-version-badge {
    background: #eff6ff;
    color: #1d4ed8;
}

.enterprise-status-draft {
    background: #fffaeb;
    color: #b54708;
}

.enterprise-status-active {
    background: #ecfdf3;
    color: #067647;
}

.enterprise-status-archived {
    background: #f2f4f7;
    color: #475467;
}

.enterprise-table-action-column {
    width: 112px;
    text-align: right !important;
}

.enterprise-table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
}

.enterprise-inline-form {
    display: inline;
}

.enterprise-icon-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #d9dee8;
    border-radius: 9px;
    background: #ffffff;
    color: #475467;
    cursor: pointer;
}

.enterprise-icon-button:hover {
    border-color: #f97316;
    color: #ea580c;
}

.enterprise-icon-button-danger:hover {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #dc2626;
}

.enterprise-icon-button svg {
    width: 1.05rem;
    height: 1.05rem;
}

.enterprise-empty-state {
    display: grid;
    justify-items: center;
    padding: 4rem 1.5rem;
    text-align: center;
}

.enterprise-empty-state-icon {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 17px;
    background: #fff7ed;
    color: #f97316;
}

.enterprise-empty-state-icon svg {
    width: 1.8rem;
    height: 1.8rem;
}

.enterprise-empty-state h3 {
    margin: 1rem 0 0;
    color: #172033;
}

.enterprise-empty-state p {
    max-width: 470px;
    margin: 0.55rem 0 1.25rem;
    color: #667085;
    line-height: 1.6;
}

.enterprise-pagination {
    border-top: 1px solid #edf0f5;
    padding: 1rem 1.25rem;
}

.enterprise-dialog {
    width: min(820px, calc(100vw - 2rem));
    max-width: 820px;
    max-height: calc(100vh - 2rem);
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    padding: 0;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.28);
}

.enterprise-dialog::backdrop {
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(3px);
}

.enterprise-dialog-panel {
    display: flex;
    max-height: calc(100vh - 2rem);
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
}

.enterprise-dialog-header {
    display: flex;
    flex: none;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid #edf0f5;
    padding: 1.4rem 1.6rem;
}

.enterprise-dialog-header h3 {
    margin: 0;
    color: #172033;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
}

.enterprise-dialog-form {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

.enterprise-dialog-body {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 1.4rem 1.6rem;
}


.enterprise-dialog-actions {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin: 0;
    border-top: 1px solid #edf0f5;
    background: #ffffff;
    padding: 1rem 1.6rem 1.35rem;
}

.enterprise-dialog-actions .enterprise-button {
    min-height: 44px;
}


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

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

    .enterprise-filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .enterprise-page-header,
    .enterprise-card-header {
        align-items: stretch;
        flex-direction: column;
    }

    .enterprise-stat-grid,
    .enterprise-filter-grid,
    .enterprise-form-grid {
        grid-template-columns: 1fr;
    }

    .enterprise-form-field-full,
    .enterprise-filter-search {
        grid-column: auto;
    }

    .enterprise-filter-action .enterprise-button,
    .enterprise-page-header > .enterprise-button {
        width: 100%;
    }

    .enterprise-dialog-actions .enterprise-button {
        width: 100%;
    }
}

/* D5.2.2.1 – Enterprise Mail Editor Workspace */
.mail-editor-page {
    display: grid;
    gap: 24px;
}

.mail-editor-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.mail-editor-page-header h2 {
    margin: 6px 0 8px;
    color: #172033;
    font-size: clamp(1.7rem, 2vw, 2.25rem);
    line-height: 1.15;
}

.mail-editor-page-header p {
    max-width: 760px;
    color: #667085;
}

.mail-editor-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    color: #667085;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
}

.mail-editor-back-link:hover {
    color: #e56626;
}

.mail-editor-back-link svg {
    width: 17px;
    height: 17px;
}

.mail-editor-template-state {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mail-editor-workspace {
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.07);
}

.mail-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 74px;
    padding: 14px 18px;
    border-bottom: 1px solid #e4e7ec;
    background: #fff;
}

.mail-editor-toolbar-group,
.mail-editor-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.mail-editor-toolbar-label {
    margin-right: 5px;
    color: #98a2b3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mail-editor-toolbar-group > button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #e4e7ec;
    border-radius: 9px;
    color: #667085;
    background: #f9fafb;
    font-size: 0.82rem;
    font-weight: 600;
}

.mail-editor-toolbar-group > button svg {
    width: 18px;
    height: 18px;
}

.mail-editor-toolbar button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.mail-editor-save-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 6px;
    color: #667085;
    font-size: 0.8rem;
}

.mail-editor-save-state > span {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #f79009;
}

.mail-editor-workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    min-height: 680px;
}

.mail-editor-canvas-panel {
    min-width: 0;
    background: #f2f4f7;
}

.mail-editor-inspector {
    border-left: 1px solid #e4e7ec;
    background: #fff;
}

.mail-editor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 73px;
    padding: 16px 20px;
    border-bottom: 1px solid #e4e7ec;
    background: #fff;
}

.mail-editor-panel-header h3 {
    margin-top: 2px;
    color: #172033;
    font-size: 1rem;
}

.mail-editor-panel-eyebrow {
    color: #e56626;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mail-editor-block-count {
    padding: 5px 9px;
    border-radius: 999px;
    color: #475467;
    background: #f2f4f7;
    font-size: 0.72rem;
    font-weight: 700;
}

.mail-editor-canvas-scroll {
    overflow: auto;
    height: 607px;
    padding: 38px;
}

.mail-editor-document {
    width: min(680px, 100%);
    min-height: 540px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
}

.mail-editor-document-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 28px;
    border-bottom: 1px solid #eaecf0;
}

.mail-editor-document-header img {
    width: 29px;
    height: 29px;
    object-fit: contain;
}

.mail-editor-document-header strong {
    color: #172033;
    font-size: 1.05rem;
}

.mail-editor-document-header strong span {
    color: #e56626;
}

.mail-editor-document-body {
    min-height: 410px;
    padding: 42px;
}

.mail-editor-document-footer {
    padding: 17px 28px;
    border-top: 1px solid #eaecf0;
    color: #98a2b3;
    background: #f9fafb;
    font-size: 0.72rem;
    text-align: center;
}

.mail-editor-empty-state {
    display: flex;
    min-height: 325px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 470px;
    margin: auto;
    text-align: center;
}

.mail-editor-empty-state-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 15px;
    color: #e56626;
    background: #fff3ed;
}

.mail-editor-empty-state-icon svg {
    width: 28px;
    height: 28px;
}

.mail-editor-empty-state h3 {
    margin: 6px 0 9px;
    color: #172033;
    font-size: 1.18rem;
}

.mail-editor-empty-state > p:not(.enterprise-eyebrow) {
    margin-bottom: 21px;
    color: #667085;
    line-height: 1.65;
}

.mail-editor-inspector-section {
    padding: 20px;
    border-bottom: 1px solid #eaecf0;
}

.mail-editor-inspector-section h4 {
    margin-bottom: 14px;
    color: #344054;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mail-editor-property-list {
    display: grid;
    gap: 13px;
}

.mail-editor-property-list > div {
    display: grid;
    gap: 3px;
}

.mail-editor-property-list dt {
    color: #98a2b3;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mail-editor-property-list dd {
    overflow-wrap: anywhere;
    color: #344054;
    font-size: 0.84rem;
    font-weight: 600;
}

.mail-editor-inspector-empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 22px 12px;
    border: 1px dashed #d0d5dd;
    border-radius: 10px;
    color: #98a2b3;
    background: #f9fafb;
    font-size: 0.78rem;
    line-height: 1.5;
    text-align: center;
}

.mail-editor-inspector-empty svg {
    width: 23px;
    height: 23px;
}

.mail-editor-statusbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 22px;
    min-height: 38px;
    padding: 8px 18px;
    border-top: 1px solid #e4e7ec;
    color: #98a2b3;
    background: #f9fafb;
    font-size: 0.7rem;
}

.mail-editor-block + .mail-editor-block {
    margin-top: 20px;
}

.mail-editor-block h1 {
    font-size: 2rem;
}

.mail-editor-block h2 {
    font-size: 1.55rem;
}

.mail-editor-block h3 {
    font-size: 1.2rem;
}

.mail-editor-block p {
    color: #475467;
    line-height: 1.7;
}

.mail-editor-block hr {
    border: 0;
    border-top: 1px solid #d0d5dd;
}

@media (max-width: 1100px) {
    .mail-editor-workspace-grid {
        grid-template-columns: 1fr;
    }

    .mail-editor-inspector {
        border-top: 1px solid #e4e7ec;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    .mail-editor-page-header,
    .mail-editor-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .mail-editor-toolbar-group,
    .mail-editor-toolbar-actions {
        flex-wrap: wrap;
    }

    .mail-editor-canvas-scroll {
        height: auto;
        padding: 18px;
    }

    .mail-editor-document-body {
        padding: 25px 20px;
    }

    .mail-editor-statusbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

.mail-editor-block{
    transition:
        border-color .15s ease,
        box-shadow .15s ease,
        background .15s ease;
    border:2px solid transparent;
    border-radius:10px;
    padding:6px;
    cursor:pointer;
}

.mail-editor-block:hover{
    border-color:#E56626;
    background:#FFF8F4;
}

.mail-editor-block-active{
    border-color:#E56626;
    background:#FFF3ED;
    box-shadow:0 0 0 3px rgba(229,102,38,.15);
}

.mail-editor-toolbar-group form {
    display: contents;
}

.mail-editor-toolbar-group form > button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #e4e7ec;
    border-radius: 9px;
    color: #475467;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        color 0.15s ease,
        background 0.15s ease;
}

.mail-editor-toolbar-group form > button:hover,
.mail-editor-toolbar-group form > button:focus-visible {
    border-color: #e56626;
    color: #c84f17;
    background: #fff8f4;
}

.mail-editor-toolbar-group form > button svg {
    width: 18px;
    height: 18px;
}

.mail-editor-empty-state-hint {
    margin: 0;
    color: #98a2b3;
    font-size: 0.8rem;
    font-weight: 600;
}

/* D5.2.2.4 – Block Editing Foundation */
.mail-editor-inspector-form {
    display: grid;
    gap: 16px;
}

.mail-editor-inspector-form[hidden],
.mail-editor-inspector-empty[hidden],
.mail-editor-inspector-form [hidden] {
    display: none;
}

.mail-editor-inspector-form .enterprise-textarea {
    min-height: 150px;
    resize: vertical;
}

.mail-editor-inspector-form .enterprise-button {
    width: 100%;
    justify-content: center;
}

/* D5.3.3.1 – Enterprise Dialog Runtime */
html.enterprise-dialog-open,
html.enterprise-dialog-open body {
    overflow: hidden;
}
