:root {
    --navy: #0f2742;
    --navy-dark: #091c30;

    --green: #24734b;
    --green-dark: #195839;
    --green-soft: #edf7f1;

    --gold: #efa900;

    --background: #f5f7f6;
    --surface: #ffffff;

    --text: #1d2933;
    --muted: #687683;

    --border: #dce4df;

    --danger: #b42318;
    --danger-soft: #fff0ee;

    --success: #24734b;
    --success-soft: #edf7f1;

    --shadow: 0 8px 24px rgba(15, 39, 66, 0.07);

    --radius: 14px;
    --content-width: 1180px;
}


/* ==========================================================================
   BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;

    background: var(--background);
    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
}

img {
    display: block;
    max-width: 100%;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(36, 115, 75, 0.2);
    outline-offset: 2px;
}


/* ==========================================================================
   HEADER
   ========================================================================== */

.portal-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    min-height: 72px;

    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.portal-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    width: min(var(--content-width), calc(100% - 40px));
    min-height: 72px;

    margin: 0 auto;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 14px;

    color: var(--navy);
    text-decoration: none;
}

.portal-brand img {
    width: 142px;
    height: auto;
}

.portal-brand span {
    padding-left: 14px;

    border-left: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}


/* ==========================================================================
   USER MENU
   ========================================================================== */

.portal-user {
    position: relative;
}

.portal-user__toggle {
    display: flex;
    align-items: center;
    gap: 10px;

    min-height: 48px;
    padding: 5px 10px;

    border-radius: 10px;

    background: transparent;
    color: var(--navy);

    cursor: pointer;

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.portal-user__toggle:hover {
    background: var(--green-soft);
}

.portal-user__avatar {
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 72px;
    height: 36px;
    padding: 0 12px;

    border-radius: 18px;

    background: var(--green);
    color: #ffffff;

    font-size: 0.76rem;
    font-weight: 700;
}

.portal-user__info {
    display: flex;
    min-width: 140px;

    flex-direction: column;

    text-align: left;
}

.portal-user__info strong {
    overflow: hidden;

    color: var(--navy);

    font-size: 0.78rem;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-user__info small {
    margin-top: 2px;

    color: var(--muted);

    font-size: 0.66rem;
}

.portal-user__toggle > span:last-child {
    color: var(--muted);
}

.portal-user__menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;

    display: none;

    width: 260px;
    padding: 12px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);

    box-shadow: var(--shadow);
}

.portal-user.is-open .portal-user__menu {
    display: block;
}

.portal-user__summary {
    display: flex;
    flex-direction: column;

    padding: 8px;
}

.portal-user__summary strong {
    color: var(--navy);

    font-size: 0.84rem;
}

.portal-user__summary small {
    margin-top: 4px;

    color: var(--muted);

    font-size: 0.72rem;
}

.portal-user__logout {
    width: 100%;
    min-height: 40px;

    margin-top: 8px;

    border-radius: 8px;

    background: var(--danger-soft);
    color: var(--danger);

    cursor: pointer;

    font-size: 0.78rem;
    font-weight: 700;
}


/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.portal-context {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.portal-context__inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;

    width: min(var(--content-width), calc(100% - 40px));
    min-height: 42px;

    margin: 0 auto;

    color: var(--muted);

    font-size: 0.72rem;
}

.portal-context a {
    color: var(--green);

    font-weight: 700;
    text-decoration: none;
}

.portal-context strong {
    color: var(--navy);
}


/* ==========================================================================
   SHARED PAGE
   ========================================================================== */

.ndr-page-container {
    width: min(var(--content-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 42px 0 72px;
}

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

    margin-bottom: 28px;
}

.ndr-page-header > div {
    max-width: 760px;
}

.ndr-page-eyebrow {
    display: block;

    margin-bottom: 8px;

    color: var(--green);

    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ndr-page-header h1 {
    margin: 0;

    color: var(--navy);

    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.08;
}

.ndr-page-header p {
    margin: 11px 0 0;

    color: var(--muted);

    line-height: 1.7;
}

.ndr-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: var(--shadow);
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */

.ndr-primary-action,
.ndr-secondary-action,
.ndr-danger-action,
.ndr-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 0 16px;

    border-radius: 9px;

    cursor: pointer;

    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.ndr-primary-action {
    background: var(--green);
    color: #ffffff;
}

.ndr-primary-action:hover {
    background: var(--green-dark);
}

.ndr-secondary-action {
    border: 1px solid var(--border);

    background: #ffffff;
    color: var(--navy);
}

.ndr-secondary-action:hover {
    border-color: var(--green);

    color: var(--green);
}

.ndr-danger-action {
    border: 1px solid var(--danger);

    background: #ffffff;
    color: var(--danger);
}

.ndr-danger-action:hover {
    background: var(--danger);
    color: #ffffff;
}


/* ==========================================================================
   FORMS
   ========================================================================== */

.ndr-form-card {
    padding: 28px;
}

.ndr-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.ndr-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

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

.ndr-field label {
    color: var(--navy);

    font-size: 0.8rem;
    font-weight: 700;
}

.ndr-field input,
.ndr-field select,
.ndr-field textarea {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: #ffffff;
    color: var(--text);
}

.ndr-field input,
.ndr-field select {
    min-height: 44px;
    padding: 0 12px;
}

.ndr-field textarea {
    min-height: 110px;
    padding: 12px;

    resize: vertical;
}

.ndr-field input:focus,
.ndr-field select:focus,
.ndr-field textarea:focus {
    border-color: var(--green);

    outline: 0;

    box-shadow: 0 0 0 3px rgba(36, 115, 75, 0.1);
}

.ndr-field-help {
    color: var(--muted);

    font-size: 0.72rem;
}

.ndr-check-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    cursor: pointer;
}

.ndr-check-option input {
    width: 17px;
    height: 17px;
    min-height: auto;

    accent-color: var(--green);
}

.ndr-form-section-title {
    margin: 0 0 6px;

    color: var(--navy);

    font-size: 1rem;
}

.ndr-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 27px;
    padding-top: 22px;

    border-top: 1px solid var(--border);
}

.ndr-product-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.ndr-product-option {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 13px;

    border: 1px solid var(--border);
    border-radius: 9px;

    background: #f9fbfa;

    cursor: pointer;
}

.ndr-product-option:hover {
    border-color: var(--green);
}

.ndr-product-option input {
    width: 17px;
    height: 17px;
    min-height: auto;

    accent-color: var(--green);
}

.ndr-product-option > span {
    display: flex;
    flex-direction: column;
}

.ndr-product-option strong {
    color: var(--navy);

    font-size: 0.8rem;
}

.ndr-product-option small {
    margin-top: 3px;

    color: var(--muted);

    font-size: 0.69rem;
}


/* ==========================================================================
   TABLE
   ========================================================================== */

.ndr-table-wrap {
    overflow-x: auto;
}

.ndr-table {
    width: 100%;

    border-collapse: collapse;
}

.ndr-table th {
    padding: 13px 16px;

    border-bottom: 1px solid var(--border);

    background: #f7f9f8;
    color: var(--muted);

    font-size: 0.67rem;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.ndr-table td {
    padding: 16px;

    border-bottom: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.8rem;
    vertical-align: middle;
}

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

.ndr-table td strong {
    display: block;

    color: var(--navy);
}

.ndr-table-subtitle {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 0.7rem;
}

.ndr-table-action {
    min-height: 34px;
    padding: 0 11px;

    border: 1px solid var(--border);

    background: #ffffff;
    color: var(--green);
}


/* ==========================================================================
   STATUS
   ========================================================================== */

.ndr-tag,
.ndr-status {
    display: inline-flex;
    align-items: center;

    min-height: 24px;

    margin: 2px 3px 2px 0;
    padding: 0 8px;

    border-radius: 999px;

    font-size: 0.65rem;
    font-weight: 700;
}

.ndr-tag {
    background: var(--green-soft);
    color: var(--green);
}

.ndr-status-active {
    background: var(--success-soft);
    color: var(--success);
}

.ndr-status-inactive {
    background: var(--danger-soft);
    color: var(--danger);
}

.ndr-muted {
    color: var(--muted);

    font-size: 0.73rem;
}


/* ==========================================================================
   FEEDBACK
   ========================================================================== */

.ndr-error {
    margin-bottom: 20px;
    padding: 13px 15px;

    border: 1px solid rgba(180, 35, 24, 0.2);
    border-radius: 9px;

    background: var(--danger-soft);
    color: var(--danger);

    font-size: 0.8rem;
}

.ndr-empty-state {
    padding: 48px 24px;

    text-align: center;
}

.ndr-empty-state h2 {
    margin: 0;

    color: var(--navy);
}

.ndr-empty-state p {
    max-width: 520px;

    margin: 10px auto 22px;

    color: var(--muted);
}

.ndr-danger-zone {
    display: flex;
    justify-content: flex-end;

    margin-top: 18px;
}


/* ==========================================================================
   LOGIN
   ========================================================================== */

   .ndr-login-body {
    background:
        linear-gradient(
            135deg,
            #edf4f2,
            #e7f0ed
        );
}

.ndr-login-page {
    display: grid;
    min-height: 100vh;

    place-items: center;

    padding: 24px;
}

.ndr-login-card {
    width: min(100%, 430px);
    padding: 36px;

    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.ndr-login-brand {
    margin-bottom: 26px;

    text-align: center;
}

.ndr-login-brand img {
    width: 185px;
    margin: 0 auto 18px;
}

.ndr-login-brand h1 {
    margin: 0;

    color: var(--navy);

    font-size: 1.8rem;
}

.ndr-login-brand p {
    margin: 9px 0 0;

    color: var(--muted);
}

.ndr-login-form {
    display: flex;
    flex-direction: column;
    gap: 17px;
}

.ndr-login-button {
    width: 100%;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 720px) {

    .portal-header__inner,
    .portal-context__inner,
    .ndr-page-container {
        width: calc(100% - 28px);
    }

    .portal-brand img {
        width: 118px;
    }

    .portal-brand span,
    .portal-user__info {
        display: none;
    }

    .portal-user__toggle {
        padding: 4px;
    }

    .portal-user__menu {
        width: min(260px, calc(100vw - 28px));
    }

    .ndr-page-container {
        padding: 34px 0 60px;
    }

    .ndr-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .ndr-page-header > .ndr-primary-action {
        width: 100%;
    }

    .ndr-form-grid {
        grid-template-columns: 1fr;
    }

    .ndr-field-full {
        grid-column: auto;
    }

    .ndr-form-card {
        padding: 21px;
    }

    .ndr-form-actions {
        flex-direction: column-reverse;
    }

    .ndr-form-actions a,
    .ndr-form-actions button {
        width: 100%;
    }

    .ndr-danger-zone button {
        width: 100%;
    }

    .ndr-login-card {
        padding: 28px 22px;
    }
}

/*==========================================================================
  SERVER ADMIN
==========================================================================*/

   .ndr-success {
    margin-bottom: 20px;
    padding: 13px 15px;

    border: 1px solid rgba(36, 115, 75, 0.2);
    border-radius: 9px;

    background: var(--success-soft);
    color: var(--success);

    font-size: 0.8rem;
}

.ndr-status-warning {
    background: #fff7df;
    color: #8a6200;
}

.server-service-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin-top: auto;
    padding-top: 20px;

    border-top: 1px solid var(--border);
}

.server-service-actions form {
    display: inline-flex;
    margin: 0;
}

.server-service-actions button,
.server-service-actions a {
    min-height: 38px;
    padding: 0 12px;

    font-size: 0.72rem;
}

.server-log-card {
    overflow: hidden;
}

.server-log-output {
    overflow: auto;

    min-height: 320px;
    max-height: 650px;

    margin: 0;
    padding: 24px;

    background: var(--navy-dark);
    color: #e8f1ed;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 0.76rem;
    line-height: 1.65;

    white-space: pre-wrap;
    word-break: break-word;
}

.ndr-table-output {
    display: block;

    overflow: hidden;

    max-width: 260px;

    text-overflow: ellipsis;
    white-space: nowrap;
}


@media (max-width: 680px) {

    .server-service-actions {
        flex-direction: column;
    }

    .server-service-actions form,
    .server-service-actions button,
    .server-service-actions a {
        width: 100%;
    }
}