/* =========================================================
   Native Manager · Admin UI v1
   ========================================================= */

:root {
    --nm-bg: #f5f4f1;
    --nm-surface: #ffffff;
    --nm-text: #292724;
    --nm-text-soft: #77716a;
    --nm-border: #e5e1dc;
    --nm-accent: #6a5547;
    --nm-accent-hover: #554338;
    --nm-nav-bg: #292724;
    --nm-nav-text: #ffffff;

    --nm-radius: 12px;
    --nm-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --nm-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--nm-bg);
    color: var(--nm-text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Helvetica,
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a {
    color: var(--nm-accent);
}

/* =========================================================
   Header
   ========================================================= */

.nm-header {
    background: var(--nm-nav-bg);
    color: var(--nm-nav-text);
}

.nm-header__inner {
    width: min(calc(100% - 40px), var(--nm-width));
    min-height: 72px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.nm-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #fff;
    text-decoration: none;
}

.nm-brand__logo {
    display: block;
    width: auto;
    height: 20px;
}

.nm-brand__product {
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.28);

    font-size: 17px;
    font-weight: 600;
    line-height: 1;
}

.nm-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.nm-user__info {
    text-align: right;
}

.nm-user__name {
    display: block;
    font-weight: 600;
}

.nm-user__role {
    display: block;
    margin-top: 1px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 12px;
}

.nm-logout {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
}

.nm-logout:hover {
    color: #fff;
}

/* =========================================================
   Navigation
   ========================================================= */

.nm-nav {
    background: var(--nm-surface);
    border-bottom: 1px solid var(--nm-border);
}

.nm-nav__inner {
    width: min(calc(100% - 40px), var(--nm-width));
    margin: 0 auto;

    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 52px;
}

.nm-nav a {
    padding: 8px 12px;
    border-radius: 7px;

    color: var(--nm-text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.nm-nav a:hover {
    background: var(--nm-bg);
    color: var(--nm-text);
}

.nm-nav a.is-active {
    background: var(--nm-bg);
    color: var(--nm-text);
}

/* =========================================================
   Layout
   ========================================================= */

.nm-main {
    width: min(calc(100% - 40px), var(--nm-width));
    margin: 0 auto;
    padding: 46px 0 70px;
}

.nm-page-header {
    margin-bottom: 22px;
}

.nm-page-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.nm-page-description {
    max-width: 650px;
    margin: 9px 0 0;
    color: var(--nm-text-soft);
    font-size: 16px;
}

/* =========================================================
   Dashboard cards
   ========================================================= */

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

.nm-card {
    display: block;
    min-height: 150px;
    padding: 24px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);

    color: inherit;
    text-decoration: none;

    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.nm-card:hover {
    transform: translateY(-2px);
    border-color: #d5cfc8;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.055);
}

.nm-card__eyebrow {
    margin-bottom: 10px;

    color: var(--nm-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nm-card__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
}

.nm-card__description {
    margin: 8px 0 0;
    color: var(--nm-text-soft);
    font-size: 14px;
}

/* =========================================================
   Internal pages
   ========================================================= */

.nm-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.nm-section-header__content {
    min-width: 0;
}

.nm-section-title {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.nm-section-description {
    margin: 7px 0 0;
    color: var(--nm-text-soft);
    font-size: 15px;
}

/* =========================================================
   Buttons
   ========================================================= */

.nm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 16px;

    border: 1px solid transparent;
    border-radius: 8px;

    background: var(--nm-accent);
    color: #fff;

    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.nm-button:hover {
    background: var(--nm-accent-hover);
    color: #fff;
}

/* =========================================================
   Tables
   ========================================================= */

.nm-table-panel {
    overflow: hidden;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

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

.nm-table th,
.nm-table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--nm-border);
    text-align: left;
    vertical-align: middle;
}

.nm-table th {
    background: #faf9f7;
    color: var(--nm-text-soft);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nm-table td {
    font-size: 14px;
}

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

.nm-table tbody tr:hover {
    background: #faf9f7;
}

.nm-table__primary {
    font-weight: 600;
}

.nm-table__action {
    font-weight: 600;
    text-decoration: none;
}

.nm-table__action:hover {
    text-decoration: underline;
}

.nm-nowrap {
    white-space: nowrap;
}

/* =========================================================
   Badges
   ========================================================= */

.nm-badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;

    border-radius: 999px;

    background: #f1efec;
    color: var(--nm-text-soft);

    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.nm-badge--active {
    background: #edf5ee;
    color: #3f6848;
}

.nm-badge--inactive {
    background: #f1efec;
    color: #827b74;
}

.nm-current-user {
    margin-left: 6px;
    color: var(--nm-text-soft);
    font-size: 12px;
    font-weight: 400;
}

/* =========================================================
   Empty states
   ========================================================= */

.nm-empty {
    padding: 36px;
    color: var(--nm-text-soft);
    text-align: center;
}

/* =========================================================
   Forms
   ========================================================= */

.nm-form-panel {
    max-width: 760px;
    padding: 28px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

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

.nm-label {
    color: var(--nm-text);
    font-size: 14px;
    font-weight: 600;
}

.nm-input,
.nm-select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;

    border: 1px solid var(--nm-border);
    border-radius: 8px;
    outline: none;

    background: #fff;
    color: var(--nm-text);

    font: inherit;
    font-size: 15px;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.nm-input:focus,
.nm-select:focus {
    border-color: var(--nm-accent);
    box-shadow: 0 0 0 3px rgba(106, 85, 71, 0.10);
}

.nm-help {
    margin: 0;
    color: var(--nm-text-soft);
    font-size: 13px;
}

.nm-checkbox {
    display: flex;
    align-items: center;
    gap: 9px;
}

.nm-checkbox input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--nm-accent);
}

.nm-checkbox label {
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* =========================================================
   Form actions
   ========================================================= */

.nm-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 4px;
}

.nm-button--secondary {
    background: transparent;
    border-color: var(--nm-border);
    color: var(--nm-text);
}

.nm-button--secondary:hover {
    background: var(--nm-bg);
    border-color: #d5cfc8;
    color: var(--nm-text);
}

/* =========================================================
   Back link
   ========================================================= */

.nm-back {
    display: inline-block;
    margin-bottom: 18px;

    color: var(--nm-text-soft);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.nm-back:hover {
    color: var(--nm-text);
}

/* =========================================================
   Alerts
   ========================================================= */

.nm-alert {
    max-width: 760px;
    margin-bottom: 20px;
    padding: 13px 15px;

    border: 1px solid var(--nm-border);
    border-radius: 8px;

    font-size: 14px;
}

.nm-alert--error {
    background: #fbefee;
    border-color: #eed3d0;
    color: #8a4039;
}

.nm-alert--info {
    background: #f3f1ee;
    color: var(--nm-text-soft);
}

/* =========================================================
   Login
   ========================================================= */

.nm-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;

    background: var(--nm-bg);
}

.nm-login__container {
    width: 100%;
    max-width: 440px;
}

.nm-login__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;

    margin-bottom: 18px;
    padding: 18px 22px;

    background: var(--nm-nav-bg);
    border-radius: var(--nm-radius);
}

.nm-login__logo {
    display: block;
    width: auto;
    height: 20px;
}

.nm-login__product {
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, 0.28);

    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
}

.nm-login__panel {
    padding: 30px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-login__title {
    margin: 0 0 24px;
    font-size: 20px;
    line-height: 1.2;
}

.nm-login__form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nm-login__actions {
    padding-top: 4px;
}

.nm-login__actions .nm-button {
    width: 100%;
}

/* =========================================================
   Header / mancheta preview
   ========================================================= */

.nm-header-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 130px;
    min-height: 30px;
    padding: 5px 12px;

    border-radius: 4px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

/* =========================================================
   Color fields
   ========================================================= */

.nm-color-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.nm-color-input {
    width: 100%;
    height: 44px;
    padding: 4px;

    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: 8px;

    cursor: pointer;
}

/* =========================================================
   Content thumbnails
   ========================================================= */

.nm-table--contents th:first-child,
.nm-table--contents td:first-child {
    width: 130px;
}

.nm-thumbnail {
    display: block;
    width: 100px;
    min-width: 100px;
    max-width: 100px;
    height: 65px;
    object-fit: cover;
    border-radius: 6px;
    background: #eee;
}

/* =========================================================
   Header labels
   ========================================================= */

.nm-header-label {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 4px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

/* =========================================================
   Content information
   ========================================================= */

.nm-content-title {
    max-width: 520px;
    font-weight: 700;
    line-height: 1.35;
}

.nm-content-short-title {
    max-width: 520px;
    margin-top: 5px;

    color: var(--nm-text-soft);
    font-size: 13px;
    line-height: 1.4;
}

/* =========================================================
   Textarea
   ========================================================= */

.nm-textarea {
    width: 100%;
    min-height: 120px;
    padding: 13px 14px;

    font: inherit;
    color: var(--nm-text);

    background: #fff;
    border: 1px solid var(--nm-border);
    border-radius: 8px;

    resize: vertical;
}

.nm-textarea:focus {
    outline: none;
    border-color: var(--nm-accent);
}

/* =========================================================
   Publications
   ========================================================= */

.nm-publication-id {
    margin-bottom: 3px;
    color: var(--nm-text-soft);
    font-size: 12px;
    font-weight: 700;
}

.nm-format-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 90px;
}

.nm-format-item {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.nm-format-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 6px;
    border-radius: 5px;
    background: #eeeae6;
    color: #4f443c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.nm-format-detail {
    color: var(--nm-text);
    font-size: 12px;
    font-weight: 600;
}

.nm-date-cell {
    white-space: nowrap;
}

.nm-muted {
    color: var(--nm-text-soft);
    font-size: 13px;
}

.nm-badge--scheduled {
    background: #f4efe6;
    color: #78633e;
}

/* =========================================================
   Publication forms
   ========================================================= */

.nm-form-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 6px;
}

.nm-form-section__header {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--nm-border);
}

.nm-form-section__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
}

.nm-form-section__description {
    margin: 5px 0 0;
    color: var(--nm-text-soft);
    font-size: 13px;
}

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

.nm-format-card {
    padding: 18px;

    background: #faf9f7;
    border: 1px solid var(--nm-border);
    border-radius: 10px;
}

.nm-format-card__title {
    margin: 0 0 15px;
    font-size: 16px;
    line-height: 1.2;
}

.nm-format-card__fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 18px;
}

.nm-input:disabled,
.nm-select:disabled {
    background: #f1efec;
    color: var(--nm-text-soft);
    cursor: not-allowed;
}

/* =========================================================
   Statistics
   ========================================================= */

.nm-stats-filters {
    margin-bottom: 22px;
    padding: 18px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-stats-filters form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nm-stats-filters__ranges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nm-stats-range {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 34px;
    padding: 7px 11px;

    border-radius: 7px;

    color: var(--nm-text-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
}

.nm-stats-range:hover {
    background: var(--nm-bg);
    color: var(--nm-text);
}

.nm-stats-range.is-active {
    background: #eeeae6;
    color: var(--nm-text);
}

.nm-stats-filters__custom {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.nm-stats-filters__custom label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nm-stats-filters__custom label span {
    color: var(--nm-text-soft);
    font-size: 12px;
    font-weight: 600;
}

.nm-stats-filters__custom input,
.nm-stats-filters__custom select {
    min-height: 40px;
    padding: 8px 10px;

    border: 1px solid var(--nm-border);
    border-radius: 8px;
    outline: none;

    background: #fff;
    color: var(--nm-text);

    font: inherit;
    font-size: 14px;
}

.nm-stats-filters__custom input:focus,
.nm-stats-filters__custom select:focus {
    border-color: var(--nm-accent);
    box-shadow: 0 0 0 3px rgba(106, 85, 71, 0.10);
}


/* KPI */

.nm-stats-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}

.nm-stats-kpi {
    padding: 20px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-stats-kpi__label {
    margin-bottom: 8px;

    color: var(--nm-text-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nm-stats-kpi__value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.025em;
}


/* Sections */

.nm-stats-section {
    margin-top: 34px;
}

.nm-stats-section__header {
    margin-bottom: 14px;
}

.nm-stats-section__title {
    margin: 0;

    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.nm-stats-section__description {
    margin: 5px 0 0;

    color: var(--nm-text-soft);
    font-size: 13px;
}

/* Daily chart */

.nm-stats-section--daily {
    margin-top: 0;
    margin-bottom: 34px;
}

.nm-stats-chart-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.nm-stats-chart-toggle {
    display: inline-flex;
    padding: 3px;

    background: #eeeae6;
    border-radius: 8px;
}

.nm-stats-chart-toggle__button {
    min-height: 32px;
    padding: 6px 11px;

    border: 0;
    border-radius: 6px;

    background: transparent;
    color: var(--nm-text-soft);

    font: inherit;
    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.nm-stats-chart-toggle__button:hover {
    color: var(--nm-text);
}

.nm-stats-chart-toggle__button.is-active {
    background: var(--nm-surface);
    color: var(--nm-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
}

.nm-stats-chart-panel {
    padding: 22px 20px 16px;

    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

.nm-stats-chart {
    width: 100%;
    min-height: 260px;
}

.nm-stats-chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.nm-stats-chart__grid {
    stroke: var(--nm-border);
    stroke-width: 1;
}

.nm-stats-chart__line {
    fill: none;
    stroke: var(--nm-accent);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nm-stats-chart__area {
    fill: rgba(106, 85, 71, 0.07);
}

.nm-stats-chart__point {
    fill: var(--nm-surface);
    stroke: var(--nm-accent);
    stroke-width: 2;
}

.nm-stats-chart__label {
    fill: var(--nm-text-soft);
    font-size: 11px;
}

.nm-stats-chart__value {
    fill: var(--nm-text);
    font-size: 11px;
    font-weight: 600;
}

.nm-stats-chart__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;

    color: var(--nm-text-soft);
    font-size: 14px;
}

/* Content */

.nm-stats-content-link {
    display: inline-block;
    max-width: 520px;

    color: var(--nm-text);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.nm-stats-content-link:hover {
    color: var(--nm-accent);
    text-decoration: underline;
}


/* Numeric columns */

.nm-stats-section .nm-table th:nth-last-child(-n + 3),
.nm-stats-section .nm-table td:nth-last-child(-n + 3) {
    white-space: nowrap;
}

.nm-stats-total td {
    background: #faf9f7;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 700px) {

    .nm-header__inner {
        min-height: 66px;
    }

    .nm-user__info {
        display: none;
    }

    .nm-nav {
        overflow-x: auto;
    }

    .nm-nav__inner {
        width: max-content;
        min-width: calc(100% - 40px);
    }

    .nm-main {
        padding-top: 32px;
    }

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

    .nm-card {
        min-height: auto;
    }

    .nm-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .nm-section-header .nm-button {
        align-self: flex-start;
    }

    .nm-form-panel {
        padding: 22px 18px;
    }

    .nm-form-actions {
        flex-wrap: wrap;
    }

    .nm-color-row {
    grid-template-columns: 1fr;
    }

    .nm-thumbnail {
        width: 80px;
        min-width: 80px;
        max-width: 80px;
        height: 52px;
    }

    .nm-table--contents th:first-child,
    .nm-table--contents td:first-child {
        width: 100px;
    }

    .nm-content-title,
    .nm-content-short-title {
        min-width: 260px;
    }

    .nm-header-label {
        white-space: nowrap;
    }

    .nm-textarea {
        min-height: 140px;
    }

    .nm-format-list {
        min-width: 90px;
    }

    .nm-date-cell {
        min-width: 125px;
    }

    .nm-format-grid {
        grid-template-columns: 1fr;
    }

    .nm-stats-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nm-stats-filters {
        padding: 16px;
    }

    .nm-stats-filters__custom {
        align-items: stretch;
    }

    .nm-stats-filters__custom label {
        flex: 1 1 140px;
    }

    .nm-stats-filters__custom input,
    .nm-stats-filters__custom select {
        width: 100%;
    }

    .nm-stats-filters__custom .nm-button {
        align-self: flex-end;
    }

    .nm-stats-section {
        margin-top: 28px;
    }

        .nm-stats-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nm-stats-chart-panel {
        padding: 18px 12px 12px;
        overflow-x: auto;
    }

    .nm-stats-chart {
        min-width: 560px;
    }

}
