/* =========================================================
   TELEGRAM FORWARDER
   Premium Amber / Yellow SaaS Theme
   ========================================================= */

:root {
    /* ---------- Core surfaces ---------- */
    --bg: #fbfaf6;
    --surface: #ffffff;
    --surface-soft: #fdfcf9;
    --surface-warm: #fffcf0;

    /* ---------- Text ---------- */
    --text: #181817;
    --text-secondary: #55544f;
    --text-muted: #88867f;

    /* ---------- Borders ---------- */
    --border: #e8e5dc;
    --border-strong: #dcd8cc;

    /* ---------- Amber ---------- */
    --accent: #c58a00;
    --accent-hover: #a97000;
    --accent-dark: #8d5f00;

    --accent-soft: #fff7d6;
    --accent-soft-strong: #ffefad;
    --accent-border: #f0d77b;

    /* ---------- Semantic ---------- */
    --success: #16803b;
    --success-soft: #ecfdf3;
    --success-border: #c8ecd5;

    --danger: #c62828;
    --danger-soft: #fff1f1;
    --danger-border: #f3cccc;

    /* ---------- Neutrals ---------- */
    --neutral-soft: #f2f1ed;
    --neutral-hover: #eae8e2;

    /* ---------- Layout ---------- */
    --sidebar-width: 250px;

    /* ---------- Radius ---------- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* ---------- Shadows ---------- */
    --shadow-sm:
        0 1px 2px rgba(31, 27, 18, 0.035);

    --shadow-md:
        0 5px 18px rgba(31, 27, 18, 0.055);

    --shadow-lg:
        0 15px 40px rgba(31, 27, 18, 0.075);
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background:
        radial-gradient(
            circle at 80% 0%,
            rgba(255, 226, 112, 0.08),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);

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

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

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

svg {
    width: 18px;
    height: 18px;

    fill: none;
    stroke: currentColor;

    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.025em;
}

h1 {
    margin-bottom: 8px;

    font-size: clamp(28px, 3vw, 34px);
    line-height: 1.15;
    font-weight: 700;
}

h2 {
    margin-bottom: 5px;

    font-size: 19px;
    line-height: 1.3;
    font-weight: 700;
}

h3 {
    margin-bottom: 0;

    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
}

h4 {
    margin-bottom: 0;
}

.muted {
    color: var(--text-muted);
}


/* =========================================================
   APP SHELL
   ========================================================= */

.app-shell {
    min-height: 100vh;

    display: flex;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: fixed;

    inset: 0 auto 0 0;

    width: var(--sidebar-width);

    display: flex;
    flex-direction: column;

    padding: 25px 16px 18px;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffefa 100%
        );

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

    z-index: 20;
}


/* ---------- Brand ---------- */

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

    padding: 0 10px;
}


.brand-mark {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    color: #29230f;

    background:
        linear-gradient(
            145deg,
            #ffe98b,
            #f5c83d
        );

    border: 1px solid #e8c75c;

    border-radius: 10px;

    box-shadow:
        0 3px 10px rgba(197, 138, 0, 0.12);
}

.brand-mark svg {
    width: 19px;
    height: 19px;

    stroke: none;
}


.brand-mark.large {
    width: 44px;
    height: 44px;

    border-radius: 12px;
}

.brand-mark.large svg {
    width: 23px;
    height: 23px;
}


.brand-name {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;

    letter-spacing: -0.01em;
}

.brand-subtitle {
    margin-top: 2px;

    color: var(--text-muted);

    font-size: 11px;
    line-height: 1.2;
    font-weight: 500;
}


/* ---------- Navigation ---------- */

.sidebar-nav {
    margin-top: 40px;
}


.nav-label {
    padding: 0 11px 8px;

    color: #aaa59a;

    font-size: 10px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.09em;
}


.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;

    padding: 10px 11px;

    color: var(--text-secondary);

    border-radius: 9px;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

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


.nav-item svg {
    width: 17px;
    height: 17px;
}


.nav-item:hover {
    color: var(--text);

    background: #f7f5ef;
}


.nav-item.active {
    color: #785200;

    background:
        linear-gradient(
            90deg,
            #fff6d2,
            #fff9e8
        );

    box-shadow:
        inset 3px 0 0 #e4ae20;
}


/* ---------- Sidebar status ---------- */

.sidebar-bottom {
    margin-top: auto;
}


.system-status {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 5px 13px;
    padding: 12px;

    background: #fffdf7;

    border: 1px solid #eee8d8;

    border-radius: 10px;
}


.status-dot {
    width: 7px;
    height: 7px;

    flex: 0 0 auto;

    background: var(--success);

    border-radius: 50%;

    box-shadow:
        0 0 0 3px #dcfce7;
}


.system-status div {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.system-status strong {
    color: var(--text);

    font-size: 11px;
    font-weight: 600;
}


.system-status span:last-child {
    margin-top: 1px;

    color: var(--text-muted);

    font-size: 10px;
}


.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 11px;

    color: var(--text-muted);

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    border-radius: 9px;

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


.logout-link:hover {
    color: var(--danger);
    background: var(--danger-soft);
}


.logout-link svg {
    width: 17px;
    height: 17px;
}


/* =========================================================
   MAIN CONTENT
   ========================================================= */

.main-content {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;

    margin-left: var(--sidebar-width);
}


.page-container {
    width: min(1120px, calc(100% - 64px));

    margin: 0 auto;

    padding: 50px 0 40px;
}


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

.mobile-header {
    display: none;
}


/* =========================================================
   PAGE HEADING
   ========================================================= */

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 30px;
}


.page-heading p {
    max-width: 610px;

    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 14px;
}


.eyebrow {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 9px;

    color: var(--accent);

    font-size: 10px;
    line-height: 1;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.1em;
}


.eyebrow-line {
    width: 16px;
    height: 1px;

    background: currentColor;
}


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

.primary-button {
    min-height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 0 15px;

    color: #2b230d;

    background:
        linear-gradient(
            135deg,
            #f8d45b,
            #e9b932
        );

    border: 1px solid #dfb32d;
    border-radius: 9px;

    font-size: 12px;
    font-weight: 700;

    text-decoration: none;

    box-shadow:
        0 2px 5px rgba(197, 138, 0, 0.12);

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


.primary-button svg {
    width: 15px;
    height: 15px;
}


.primary-button:hover {
    background:
        linear-gradient(
            135deg,
            #f5cc42,
            #dfa91e
        );

    border-color: #d6a719;

    box-shadow:
        0 4px 12px rgba(197, 138, 0, 0.17);
}


.primary-button:active {
    transform: translateY(1px);
}


/* ---------- Small buttons ---------- */

.small-button {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 11px;

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

    font-size: 11px;
    font-weight: 600;

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


.small-button svg {
    width: 14px;
    height: 14px;
}


/* ---------- Secondary ---------- */

.secondary-button {
    color: var(--text-secondary);

    background: #ffffff;

    border-color: var(--border-strong);
}


.secondary-button:hover {
    color: #715000;

    background: #fffaf0;

    border-color: #e5ce8e;
}


/* ---------- Danger ---------- */

.danger-button {
    color: var(--danger);

    background: #ffffff;

    border-color: var(--danger-border);
}


.danger-button:hover {
    background: var(--danger-soft);

    border-color: #efbaba;
}


/* ---------- Icon button ---------- */

.icon-button {
    width: 36px;
    height: 36px;

    display: grid;
    place-items: center;

    color: var(--text-secondary);

    background: #ffffff;

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

    border-radius: 9px;
}


.icon-button:hover {
    color: var(--accent-dark);

    background: var(--accent-soft);

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


.icon-button svg {
    width: 17px;
    height: 17px;
}


/* =========================================================
   STATS
   ========================================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 12px;

    margin-bottom: 42px;
}


.stat-card {
    min-height: 88px;

    position: relative;

    display: flex;
    align-items: center;
    gap: 13px;

    overflow: hidden;

    padding: 17px;

    background: var(--surface);

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

    border-radius: var(--radius-md);

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


/* Subtle amber accent on first stat */

.stat-card:first-child::after {
    content: "";

    position: absolute;

    right: 0;
    bottom: 0;

    width: 75px;
    height: 75px;

    background:
        radial-gradient(
            circle,
            rgba(245, 200, 61, 0.13),
            transparent 70%
        );

    pointer-events: none;
}


.stat-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    border-radius: 9px;
}


.stat-icon svg {
    width: 17px;
    height: 17px;
}


.stat-icon.neutral {
    color: #9a6a00;

    background: var(--accent-soft);

    border: 1px solid #f5e5a7;
}


.stat-icon.success {
    color: var(--success);

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


.stat-icon.muted-icon {
    color: #717780;

    background: #f1f2f4;
}


.stat-card > div:last-child {
    display: flex;
    flex-direction: column;
}


.stat-value {
    font-size: 20px;
    line-height: 1.15;
    font-weight: 700;

    letter-spacing: -0.03em;
}


.stat-label {
    margin-top: 3px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 500;
}


/* =========================================================
   CONTENT SECTION
   ========================================================= */

.content-section {
    margin-bottom: 45px;
}


.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 17px;
}


.section-heading p {
    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 12px;
}


.route-count {
    padding: 5px 9px;

    color: #7d5a0a;

    background: #fff9e5;

    border: 1px solid #eee0ad;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 600;
}


/* =========================================================
   ROUTE CARDS
   ========================================================= */

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.route-card {
    position: relative;

    overflow: hidden;

    background: var(--surface);

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

    border-radius: var(--radius-lg);

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

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


.route-card::before {
    content: "";

    position: absolute;

    inset: 0 auto 0 0;

    width: 3px;

    background:
        linear-gradient(
            180deg,
            #f5cc43,
            #d89e12
        );

    opacity: 0;

    transition: opacity 0.2s ease;
}


.route-card:hover {
    border-color: #e2ded3;

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


.route-card:hover::before {
    opacity: 1;
}


.route-card.is-disabled {
    opacity: 0.82;
}


.route-card.is-disabled::before {
    background: #c6c7c9;
}


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

.route-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;

    padding: 19px 20px 17px;
}


.route-title-area {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 12px;
}


.route-avatar {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    color: #936500;

    background:
        linear-gradient(
            145deg,
            #fff8dc,
            #fff2bd
        );

    border: 1px solid #f0df9e;

    border-radius: 10px;
}


.route-avatar svg {
    width: 17px;
    height: 17px;
}


.route-name-row {
    display: flex;
    align-items: center;
    gap: 8px;

    flex-wrap: wrap;
}


.route-id {
    margin: 3px 0 0;

    color: #9a9a91;

    font-family:
        "DM Mono",
        SFMono-Regular,
        Consolas,
        monospace;

    font-size: 9px;
}


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

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 4px 7px;

    border-radius: 999px;

    font-size: 9px;
    line-height: 1;
    font-weight: 700;
}


.status-badge > span {
    width: 5px;
    height: 5px;

    border-radius: 50%;
}


.status-badge.active {
    color: #15803d;

    background: var(--success-soft);

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


.status-badge.active > span {
    background: #22c55e;
}


.status-badge.disabled {
    color: #6b7280;

    background: #f1f2f4;

    border: 1px solid #e1e2e4;
}


.status-badge.disabled > span {
    background: #9ca3af;
}


/* =========================================================
   ROUTE ACTIONS
   ========================================================= */

.route-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}


.route-actions form {
    margin: 0;
}


/* =========================================================
   ROUTE FLOW
   ========================================================= */

.route-flow {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        42px
        minmax(0, 1fr);

    align-items: center;

    gap: 8px;

    padding: 0 20px 20px;
}


.endpoint {
    min-width: 0;
}


.endpoint-label {
    display: flex;
    align-items: center;
    gap: 7px;

    margin-bottom: 8px;

    color: #74746d;

    font-size: 9px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.08em;
}


.endpoint-number {
    color: #b0aca1;

    font-family:
        "DM Mono",
        SFMono-Regular,
        Consolas,
        monospace;

    font-size: 8px;
}


.endpoint-box {
    min-height: 58px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;

    padding: 9px 11px;

    background:
        linear-gradient(
            135deg,
            #fdfcf9,
            #fffefb
        );

    border: 1px solid #e7e5df;

    border-radius: 9px;
}


.endpoint:first-child .endpoint-box {
    box-shadow:
        inset 2px 0 0 #d4d1c8;
}


.endpoint:last-child .endpoint-box {
    background:
        linear-gradient(
            135deg,
            #fffdf5,
            #fffefb
        );

    border-color: #eee5c9;

    box-shadow:
        inset 2px 0 0 #e4b42c;
}


.channel-id {
    min-width: 0;

    display: flex;
    align-items: center;
    gap: 7px;
}


.channel-dot {
    width: 5px;
    height: 5px;

    flex: 0 0 auto;

    background: #7b8188;

    border-radius: 50%;
}


.channel-dot.destination {
    background: #d19a13;
}


.channel-id code {
    overflow: hidden;

    color: #4b4d4f;

    font-family:
        "DM Mono",
        SFMono-Regular,
        Consolas,
        monospace;

    font-size: 10px;

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


/* ---------- Flow arrow ---------- */

.flow-arrow {
    display: flex;
    justify-content: center;

    padding-top: 20px;
}


.flow-arrow span {
    width: 30px;
    height: 30px;

    display: grid;
    place-items: center;

    color: #a37508;

    background:
        linear-gradient(
            145deg,
            #fff9df,
            #fff4c8
        );

    border: 1px solid #efdf9f;

    border-radius: 50%;
}


.flow-arrow svg {
    width: 13px;
    height: 13px;
}


/* =========================================================
   ROUTE METADATA
   ========================================================= */

.route-meta {
    display: flex;
    align-items: center;

    margin: 0 20px;

    padding: 13px 0;

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


.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}


.meta-item > svg {
    width: 15px;
    height: 15px;

    color: #a07b20;
}


.meta-item div {
    display: flex;
    flex-direction: column;
}


.meta-item span {
    color: #92938c;

    font-size: 9px;
    font-weight: 500;
}


.meta-item strong {
    margin-top: 1px;

    color: #454743;

    font-size: 10px;
    font-weight: 600;
}


.meta-divider {
    width: 1px;
    height: 27px;

    margin: 0 20px;

    background: var(--border);
}


/* =========================================================
   ROUTE EDITOR
   ========================================================= */

.route-editor {
    border-top: 1px solid var(--border);
}


.route-editor summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 20px;

    color: var(--text-secondary);

    cursor: pointer;

    list-style: none;

    font-size: 11px;
    font-weight: 600;

    user-select: none;

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


.route-editor summary::-webkit-details-marker {
    display: none;
}


.route-editor summary:hover {
    color: #765300;

    background: #fffdf7;
}


.edit-summary-left {
    display: flex;
    align-items: center;
    gap: 8px;
}


.edit-icon {
    width: 25px;
    height: 25px;

    display: grid;
    place-items: center;

    color: #9a720c;

    background: #fff8df;

    border: 1px solid #f0e0a9;

    border-radius: 7px;
}


.edit-icon svg {
    width: 13px;
    height: 13px;
}


.chevron {
    width: 15px;
    height: 15px;

    color: #9ca3af;

    transition: transform 0.18s ease;
}


.route-editor[open] .chevron {
    transform: rotate(180deg);
}


.editor-content {
    padding: 0 20px 21px;

    background:
        linear-gradient(
            180deg,
            #fffefa 0%,
            #fcfcfa 100%
        );

    border-top: 1px solid #f0eee8;
}


.editor-heading {
    padding: 17px 0 19px;
}


.editor-heading h4 {
    margin-bottom: 3px;

    font-size: 12px;
}


.editor-heading p {
    margin: 0;

    color: var(--text-muted);

    font-size: 10px;
}


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


.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.form-field {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 7px;
}


.form-field label {
    color: #3f403d;

    font-size: 11px;
    font-weight: 600;
}


.form-field input {
    width: 100%;
    height: 40px;

    padding: 0 11px;

    color: var(--text);

    background: #ffffff;

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

    border-radius: 8px;

    outline: none;

    font-size: 12px;

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


.form-field input::placeholder {
    color: #adb0a8;
}


.form-field input:hover {
    border-color: #ccc8bc;
}


.form-field input:focus {
    background: #fffefa;

    border-color: #d4a92b;

    box-shadow:
        0 0 0 3px rgba(225, 174, 35, 0.13);
}


.field-help {
    color: #92938c;

    font-size: 10px;
    line-height: 1.4;
}


.input-suffix {
    position: relative;
}


.input-suffix input {
    padding-right: 74px;
}


.input-suffix span {
    position: absolute;

    top: 50%;
    right: 11px;

    transform: translateY(-50%);

    color: #858780;

    font-size: 10px;
    font-weight: 500;

    pointer-events: none;
}


.editor-actions {
    display: flex;
    justify-content: flex-end;

    padding-top: 2px;
}


.editor-actions .primary-button {
    min-height: 36px;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;

    padding: 55px 25px;

    text-align: center;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #fffefa
        );

    border: 1px dashed #dfd9c8;

    border-radius: var(--radius-lg);
}


.empty-icon {
    width: 48px;
    height: 48px;

    display: grid;
    place-items: center;

    margin-bottom: 15px;

    color: #a27408;

    background:
        linear-gradient(
            145deg,
            #fff9df,
            #fff2bf
        );

    border: 1px solid #f0dda0;

    border-radius: 12px;
}


.empty-icon svg {
    width: 21px;
    height: 21px;
}


.empty-state h3 {
    margin-bottom: 6px;
}


.empty-state p {
    max-width: 390px;

    margin-bottom: 19px;

    color: var(--text-muted);

    font-size: 12px;
}


/* =========================================================
   CREATE ROUTE SECTION
   ========================================================= */

.create-section {
    position: relative;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fffefa 100%
        );

    border: 1px solid #e6e1d3;

    border-radius: var(--radius-lg);

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


/* Soft yellow glow */

.create-section::before {
    content: "";

    position: absolute;

    width: 300px;
    height: 180px;

    top: -100px;
    right: -50px;

    background:
        radial-gradient(
            circle,
            rgba(245, 204, 67, 0.14),
            transparent 70%
        );

    pointer-events: none;
}


.create-header {
    position: relative;

    display: flex;
    align-items: flex-start;
    gap: 13px;

    padding: 23px 23px 20px;

    border-bottom: 1px solid #eeeae0;
}


.create-icon {
    width: 38px;
    height: 38px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    color: #956600;

    background:
        linear-gradient(
            145deg,
            #fff8d9,
            #ffefb2
        );

    border: 1px solid #eedb96;

    border-radius: 10px;

    box-shadow:
        0 2px 8px rgba(197, 138, 0, 0.08);
}


.create-icon svg {
    width: 18px;
    height: 18px;
}


.create-header .eyebrow {
    margin-bottom: 6px;

    color: #98700c;
}


.create-header h2 {
    margin-bottom: 4px;
}


.create-header p {
    margin-bottom: 0;

    color: var(--text-muted);

    font-size: 11px;
}


.create-form {
    position: relative;

    padding: 22px 23px 23px;
}


.create-form .form-field input {
    height: 42px;
}


.delay-field {
    max-width: 310px;
}


.create-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-top: 4px;
}


.security-note {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #8a8b84;

    font-size: 10px;
}


.security-note svg {
    width: 14px;
    height: 14px;

    color: #b0810d;
}


.create-form-footer .primary-button {
    min-height: 40px;
}


.create-form-footer .primary-button svg {
    width: 14px;
    height: 14px;
}


/* =========================================================
   FOOTER
   ========================================================= */

.page-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 28px 0 0;

    color: #aaa79e;

    font-size: 9px;
    font-weight: 500;
}


.footer-dot {
    width: 3px;
    height: 3px;

    background: #cbc7bc;

    border-radius: 50%;
}


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

.login-page {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% 5%,
            rgba(247, 205, 62, 0.16),
            transparent 31%
        ),
        linear-gradient(
            180deg,
            #fffdf7 0%,
            #f7f6f1 100%
        );
}


.login-shell {
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    position: relative;

    padding: 30px 20px;
}


/* ---------- Background grid ---------- */

.login-grid {
    position: fixed;

    inset: 0;

    pointer-events: none;

    opacity: 0.27;

    background-image:
        linear-gradient(#e6dfca 1px, transparent 1px),
        linear-gradient(90deg, #e6dfca 1px, transparent 1px);

    background-size: 48px 48px;

    mask-image:
        linear-gradient(
            to bottom,
            transparent,
            black 20%,
            black 80%,
            transparent
        );
}


/* ---------- Login card ---------- */

.login-card {
    position: relative;

    width: 100%;
    max-width: 420px;

    padding: 31px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.98),
            rgba(255, 254, 250, 0.97)
        );

    border: 1px solid #e4dfd2;

    border-radius: 18px;

    box-shadow:
        0 22px 60px rgba(52, 43, 20, 0.09),
        0 2px 5px rgba(52, 43, 20, 0.04);
}


.login-card::before {
    content: "";

    position: absolute;

    top: 0;
    left: 12%;

    width: 76%;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            transparent,
            #e8bd39,
            transparent
        );

    border-radius: 99px;
}


/* ---------- Login brand ---------- */

.login-brand {
    display: flex;
    align-items: center;
    gap: 11px;

    margin-bottom: 38px;
}


.login-heading {
    margin-bottom: 24px;
}


.login-heading .eyebrow {
    color: #98700c;
}


.login-heading h1 {
    margin-bottom: 7px;

    font-size: 28px;
}


.login-heading p {
    margin: 0;

    color: var(--text-muted);

    font-size: 12px;
}


/* ---------- Login form ---------- */

.login-form {
    display: flex;
    flex-direction: column;

    gap: 17px;
}


.login-input {
    position: relative;
}


.login-input > svg {
    position: absolute;

    top: 50%;
    left: 12px;

    width: 15px;
    height: 15px;

    color: #9b9688;

    transform: translateY(-50%);

    pointer-events: none;
}


.login-input input {
    width: 100%;
    height: 44px;

    padding: 0 12px 0 38px;

    color: var(--text);

    background: #ffffff;

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

    border-radius: 9px;

    outline: none;

    font-size: 12px;

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


.login-input input::placeholder {
    color: #adb0a8;
}


.login-input input:hover {
    border-color: #cbc7bb;
}


.login-input input:focus {
    background: #fffefa;

    border-color: #d3a727;

    box-shadow:
        0 0 0 3px rgba(225, 174, 35, 0.13);
}


/* ---------- Login button ---------- */

.login-submit {
    width: 100%;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    margin-top: 3px;

    color: #2b230d;

    background:
        linear-gradient(
            135deg,
            #f8d45b,
            #e6b52c
        );

    border: 1px solid #dcaf28;

    border-radius: 9px;

    font-size: 12px;
    font-weight: 700;

    box-shadow:
        0 3px 10px rgba(197, 138, 0, 0.13);

    transition:
        background 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}


.login-submit:hover {
    background:
        linear-gradient(
            135deg,
            #f5cc42,
            #dfa91e
        );

    box-shadow:
        0 5px 15px rgba(197, 138, 0, 0.18);
}


.login-submit:active {
    transform: translateY(1px);
}


.login-submit svg {
    width: 15px;
    height: 15px;
}


/* ---------- Login error ---------- */

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;

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

    color: #991b1b;

    background: var(--danger-soft);

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

    border-radius: 9px;
}


.error-icon {
    width: 26px;
    height: 26px;

    display: grid;
    place-items: center;

    flex: 0 0 auto;

    background: #fee2e2;

    border-radius: 7px;
}


.error-icon svg {
    width: 14px;
    height: 14px;
}


.login-error div:last-child {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.login-error strong {
    font-size: 10px;
    font-weight: 700;
}


.login-error span {
    margin-top: 1px;

    font-size: 10px;
}


/* ---------- Login security ---------- */

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 20px;

    color: #99988f;

    font-size: 9px;
    font-weight: 500;
}


.login-security svg {
    width: 13px;
    height: 13px;

    color: #a87908;
}


/* ---------- Login footer ---------- */

.login-footer {
    position: relative;

    margin-top: 20px;

    color: #9d9a90;

    font-size: 9px;
    font-weight: 500;
}


.login-footer span {
    display: inline-block;

    width: 3px;
    height: 3px;

    margin: 0 6px;

    vertical-align: middle;

    background: #c4c0b5;

    border-radius: 50%;
}


/* =========================================================
   ACCESSIBILITY / FOCUS
   ========================================================= */

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(197, 138, 0, 0.55);

    outline-offset: 2px;
}


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

@media (max-width: 1050px) {

    :root {
        --sidebar-width: 220px;
    }

    .page-container {
        width: min(100% - 40px, 1000px);
    }

    .route-flow {
        grid-template-columns:
            minmax(0, 1fr)
            34px
            minmax(0, 1fr);
    }
}


@media (max-width: 800px) {

    .sidebar {
        display: none;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .mobile-header {
        height: 64px;

        display: flex;
        align-items: center;
        justify-content: space-between;

        padding: 0 20px;

        background: rgba(255, 255, 255, 0.96);

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

        backdrop-filter: blur(10px);
    }

    .mobile-header .brand {
        padding: 0;
    }

    .mobile-header .brand-mark {
        width: 32px;
        height: 32px;

        border-radius: 9px;
    }

    .mobile-header .brand-mark svg {
        width: 17px;
        height: 17px;
    }

    .page-container {
        width: min(100% - 40px, 680px);

        padding-top: 35px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;

        gap: 17px;
    }

    .page-heading .primary-button {
        width: 100%;
    }
}


@media (max-width: 650px) {

    .page-container {
        width: calc(100% - 24px);

        padding-top: 27px;
    }

    h1 {
        font-size: 27px;
    }

    .stats-grid {
        grid-template-columns: 1fr;

        margin-bottom: 34px;
    }

    .stat-card {
        min-height: 72px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .route-count {
        display: none;
    }

    .route-card-header {
        flex-direction: column;

        padding: 16px;
    }

    .route-actions {
        width: 100%;
    }

    .route-actions form {
        flex: 1;
    }

    .route-actions .small-button {
        width: 100%;
    }

    .route-flow {
        grid-template-columns: 1fr;

        gap: 7px;

        padding: 0 16px 16px;
    }

    .flow-arrow {
        padding: 0;

        justify-content: center;
    }

    .flow-arrow span {
        transform: rotate(90deg);
    }

    .route-meta {
        margin: 0 16px;

        flex-wrap: wrap;

        gap: 10px;
    }

    .meta-divider {
        height: 20px;

        margin: 0 5px;
    }

    .route-editor summary {
        padding: 12px 16px;
    }

    .editor-content {
        padding: 0 16px 18px;
    }

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

    .delay-field {
        max-width: none;
    }

    .create-header {
        padding: 20px 17px 18px;
    }

    .create-form {
        padding: 18px 17px 19px;
    }

    .create-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .create-form-footer .primary-button {
        width: 100%;
    }

    .security-note {
        line-height: 1.4;
    }

    .login-card {
        padding: 25px 20px;

        border-radius: 15px;
    }

    .login-brand {
        margin-bottom: 31px;
    }
}


@media (max-width: 400px) {

    .route-name-row {
        align-items: flex-start;
        flex-direction: column;

        gap: 6px;
    }

    .route-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .meta-divider {
        display: none;
    }

    .login-shell {
        padding: 16px;
    }

    .login-card {
        padding: 23px 17px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
