:root {
    --tn-orange: #f58b20;
    --tn-orange-dark: #d96f0f;
    --tn-cream: #fff3e6;
    --tn-bg: #fff8ef;
    --tn-card: #ffffff;
    --tn-text: #2b2118;
    --tn-muted: #7b6a59;
    --tn-border: #f0dcc7;
    --tn-shadow: 0 24px 70px rgba(98, 55, 18, .12);
    --tn-radius: 28px;
}

* {
    box-sizing: border-box;
}

body.tn-app-body {
    margin: 0;
    font-family: 'Signika', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tn-bg);
    color: var(--tn-text);
}

a {
    color: inherit;
    text-decoration: none;
}

.tn-logo {
    display: inline-flex;
    align-items: center;
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.tn-logo img,
.custom-logo {
    display: block;
    max-width: 180px;
    max-height: 64px;
    width: auto;
    height: auto;
}

.tn-kicker {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--tn-orange-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tn-subtitle {
    margin: 10px 0 0;
    color: var(--tn-muted);
    font-size: 17px;
}

.tn-login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background: radial-gradient(circle at top left, #ffe3c4 0, #fff8ef 36%, #fff 100%);
}

.tn-login-card {
    width: min(480px, 100%);
    padding: 34px;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--tn-border);
    border-radius: 34px;
    box-shadow: var(--tn-shadow);
}

.tn-login-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 34px;
}

.tn-login-brand p {
    margin: 0;
    color: var(--tn-muted);
    font-weight: 600;
}

.tn-login-copy h1 {
    margin: 0 0 12px;
    font-size: 42px;
    line-height: 1;
}

.tn-login-copy p {
    margin: 0 0 28px;
    color: var(--tn-muted);
    font-size: 17px;
}

.login-username,
.login-password,
.login-remember,
.login-submit {
    margin: 0 0 16px;
}

.tn-login-card label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}

.tn-login-card input[type="text"],
.tn-login-card input[type="password"] {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid var(--tn-border);
    border-radius: 16px;
    font: inherit;
}

.login-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--tn-muted);
    font-weight: 600;
}

.login-remember input {
    width: 18px;
    height: 18px;
    accent-color: var(--tn-orange);
}

.login-submit {
    margin-top: 22px;
    margin-bottom: 0;
}

.login-submit .tn-button,
.login-submit input {
    width: 100%;
}

.tn-button,
.login-submit input {
    border: 0;
    border-radius: 999px;
    padding: 15px 24px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.tn-button-primary,
.login-submit input {
    background: var(--tn-orange);
    color: #fff;
    box-shadow: 0 12px 24px rgba(245, 139, 32, .24);
}

.tn-button-primary:hover,
.login-submit input:hover {
    background: var(--tn-orange-dark);
}

.tn-button-light {
    background: #fff;
    color: var(--tn-text);
    border: 1px solid var(--tn-border);
}

.tn-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.tn-sidebar {
    display: flex;
    flex-direction: column;
    gap: 38px;
    padding: 28px;
    background: var(--tn-orange);
    border-right: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 18px 50px rgba(98, 55, 18, .10);
}

.tn-sidebar nav {
    display: grid;
    gap: 10px;
}

.tn-sidebar nav a {
    padding: 14px 16px;
    color: #fff;
    border-radius: 16px;
    font-weight: 800;
}

.tn-sidebar nav a.is-active,
.tn-sidebar nav a:hover {
    background: rgba(255, 255, 255, .20);
    color: #fff;
}

.tn-content {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 34px;
}

.tn-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.tn-topbar h1 {
    margin: 0;
    font-size: 40px;
    line-height: 1.05;
}

.tn-deadline {
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 800;
    white-space: nowrap;
}

.tn-deadline.is-open {
    background: #e9f8ea;
    color: #237334;
}

.tn-card {
    padding: 24px;
    background: var(--tn-card);
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius);
    box-shadow: var(--tn-shadow);
}

.tn-card-spaced {
    margin-top: 22px;
}

.tn-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.tn-card-head h2 {
    margin: 0 0 5px;
    font-size: 26px;
}

.tn-card-head p {
    margin: 0;
    color: var(--tn-muted);
}

.tn-card-head span {
    padding: 8px 12px;
    background: var(--tn-cream);
    color: var(--tn-orange-dark);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.tn-product-list {
    display: grid;
    gap: 10px;
}

.tn-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px;
    background: #fffaf5;
    border: 1px solid var(--tn-border);
    border-radius: 18px;
}

.tn-product-row strong {
    font-size: 18px;
}

.tn-product-row small {
    display: block;
    margin-top: 3px;
    color: var(--tn-muted);
}

.tn-product-row label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tn-product-row input {
    width: 96px;
    height: 46px;
    text-align: center;
    border: 1px solid var(--tn-border);
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
}

.tn-product-row span {
    color: var(--tn-muted);
    font-weight: 700;
}

.tn-submit-area {
    display: flex;
    justify-content: flex-start;
    margin-top: 30px;
    padding-top: 16px;
}

.tn-mobile-sticky {
    display: none;
}

.tn-notice,
.toc-login-notice,
.tn-login-notice {
    margin: 0 0 22px;
    padding: 16px 20px;
    border-radius: 18px;
    font-weight: 800;
}

.tn-notice-success {
    background: #e9f8ea;
    color: #237334;
    border: 1px solid #c8ebcd;
}

.tn-notice-error,
.toc-login-notice,
.tn-login-notice {
    background: #fff0ed;
    color: #b42318;
    border: 1px solid #ffd0c9;
}

.tn-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.tn-stats-grid article {
    padding: 20px;
    background: #fff;
    border: 1px solid var(--tn-border);
    border-radius: 22px;
    box-shadow: 0 14px 40px rgba(98, 55, 18, .08);
}

.tn-stats-grid span {
    display: block;
    color: var(--tn-muted);
    font-weight: 700;
}

.tn-stats-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 34px;
}

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

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

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

.tn-table th {
    color: var(--tn-muted);
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tn-empty-state {
    padding: 20px;
    background: #fffaf5;
    border: 1px dashed var(--tn-border);
    border-radius: 18px;
}

.tn-empty-state strong {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
}

.tn-empty-state p {
    margin: 0;
    color: var(--tn-muted);
}

.tn-client-orders {
    display: grid;
    gap: 18px;
}

.tn-client-order {
    padding: 18px;
    background: #fffaf5;
    border: 1px solid var(--tn-border);
    border-radius: 22px;
}

.tn-client-order h3 {
    margin: 0 0 4px;
    font-size: 22px;
}

.tn-client-order p {
    margin: 0 0 14px;
    color: var(--tn-muted);
}

@media (max-width: 860px) {
    .tn-shell {
        display: block;
        padding-bottom: 92px;
    }

    .tn-sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
    }

    .tn-sidebar .tn-logo img,
    .tn-sidebar .custom-logo {
        max-width: 128px;
        max-height: 48px;
    }

    .tn-sidebar nav {
        display: flex;
        gap: 4px;
    }

    .tn-sidebar nav a {
        padding: 10px 9px;
        font-size: 13px;
    }

    .tn-sidebar nav a:nth-child(n+4) {
        display: none;
    }

    .tn-content {
        padding: 18px 14px;
    }

    .tn-topbar {
        display: block;
    }

    .tn-topbar h1 {
        font-size: 30px;
    }

    .tn-deadline {
        display: inline-flex;
        margin-top: 14px;
    }

    .tn-card {
        padding: 16px;
        border-radius: 22px;
    }

    .tn-card-head {
        display: block;
    }

    .tn-card-head span {
        display: inline-flex;
        margin-top: 12px;
    }

    .tn-product-row {
        align-items: flex-start;
    }

    .tn-product-row strong {
        font-size: 16px;
    }

    .tn-product-row input {
        width: 72px;
    }

    .tn-submit-area-desktop {
        display: none !important;
    }

    .tn-mobile-sticky {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 50;
        padding: 12px 14px;
        background: rgba(255, 248, 239, .94);
        border-top: 1px solid var(--tn-border);
        backdrop-filter: blur(16px);
    }

    .tn-mobile-sticky .tn-button {
        width: 100%;
    }

    .tn-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .tn-login-card {
        padding: 24px;
        border-radius: 26px;
    }

    .tn-login-brand {
        display: block;
    }

    .tn-login-brand p {
        margin-top: 12px;
    }

    .tn-login-copy h1 {
        font-size: 34px;
    }

    .tn-sidebar nav a {
        padding: 9px 7px;
        font-size: 12px;
    }

    .tn-product-row {
        gap: 12px;
        padding: 12px;
    }

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

.tn-login-error {
    margin-bottom: 22px !important;
    background: #fff0ed !important;
    color: #b42318 !important;
    border: 1px solid #ffd0c9 !important;
    box-shadow: 0 10px 24px rgba(180, 35, 24, .08);
}

.tn-submit-area {
    margin-top: 36px !important;
    padding-top: 20px !important;
}

@media (max-width: 860px) {
    .tn-submit-area-desktop {
        display: none !important;
    }

    .tn-mobile-sticky {
        display: block !important;
    }
}

.tn-repeat-button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    background: var(--tn-cream);
    color: var(--tn-orange-dark);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.tn-repeat-button:hover {
    background: #ffe3c4;
}

.tn-submit-area {
    margin-top: 38px !important;
    padding-top: 18px !important;
}

@media (max-width: 860px) {
    .tn-repeat-button {
        width: 100%;
        margin-top: 14px;
    }

    .tn-submit-area-desktop {
        display: none !important;
    }
}

.tn-repeat-button {
    border: 0 !important;
    border-radius: 999px !important;
    padding: 11px 18px !important;
    background: var(--tn-cream) !important;
    color: var(--tn-orange-dark) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.tn-repeat-button:hover {
    background: #ffe3c4 !important;
}

.tn-submit-area {
    margin-top: 42px !important;
    padding-top: 20px !important;
}

@media (max-width: 860px) {
    .tn-repeat-button {
        width: 100% !important;
        margin-top: 14px !important;
    }

    .tn-submit-area-desktop {
        display: none !important;
    }
}

.tn-repeat-button {
    border: 0 !important;
    border-radius: 999px !important;
    padding: 12px 18px !important;
    background: var(--tn-cream) !important;
    color: var(--tn-orange-dark) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.tn-submit-area {
    margin-top: 44px !important;
    padding-top: 24px !important;
}

.tn-submit-area .tn-button {
    display: inline-flex !important;
}

@media (max-width: 860px) {
    .tn-submit-area,
    .tn-submit-area-desktop {
        display: none !important;
    }

    .tn-mobile-sticky {
        display: block !important;
    }
}

.tn-menu-toggle {
    display: none;
}

@media (max-width: 860px) {
    .tn-sidebar {
        position: sticky;
    }

    .tn-menu-toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 46px;
        height: 46px;
        border: 0;
        border-radius: 14px;
        background: rgba(255,255,255,.18);
        cursor: pointer;
    }

    .tn-menu-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        margin: 0 auto;
        background: #fff;
        border-radius: 99px;
    }

    .tn-sidebar nav.tn-mobile-menu {
        display: none;
        position: absolute;
        top: 76px;
        right: 14px;
        left: 14px;
        z-index: 99;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--tn-border);
        border-radius: 18px;
        box-shadow: var(--tn-shadow);
    }

    .tn-sidebar nav.tn-mobile-menu.is-open {
        display: grid;
        gap: 6px;
    }

    .tn-sidebar nav.tn-mobile-menu a {
        color: var(--tn-text);
        padding: 13px 14px;
        border-radius: 14px;
    }

    .tn-sidebar nav.tn-mobile-menu a.is-active,
    .tn-sidebar nav.tn-mobile-menu a:hover {
        background: var(--tn-cream);
        color: var(--tn-orange-dark);
    }
}

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

.tn-client-order-grouped {
    padding: 20px;
}

.tn-client-order-main-head {
    margin-bottom: 16px;
}

.tn-order-subgroup {
    padding: 16px 0;
    border-top: 1px solid var(--tn-border);
}

.tn-order-subgroup-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    color: var(--tn-muted);
}

.tn-order-subgroup-head strong {
    color: var(--tn-text);
}

.tn-missing-list {
    display: grid;
    gap: 10px;
}

.tn-missing-item {
    padding: 14px 16px;
    background: #fffaf5;
    border: 1px solid var(--tn-border);
    border-radius: 16px;
    font-weight: 800;
}

@media (max-width: 860px) {
    .tn-stats-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tn-order-subgroup-head {
        display: block;
    }

    .tn-order-subgroup-head span {
        display: block;
        margin-top: 4px;
    }
}

.tn-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tn-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 22px 0 18px;
}

.tn-filter-form label {
    display: grid;
    gap: 7px;
    color: var(--tn-muted);
    font-weight: 800;
}

.tn-filter-form input[type="date"] {
    height: 50px;
    border: 1px solid var(--tn-border);
    border-radius: 16px;
    padding: 0 14px;
    font: inherit;
    font-weight: 700;
    background: #fffaf5;
}

@media (max-width: 860px) {
    .tn-card-head {
        gap: 14px;
    }

    .tn-card-head .tn-button {
        margin-top: 14px;
        width: auto;
    }

    .tn-filter-form {
        display: grid;
        gap: 12px;
    }

    .tn-filter-form input[type="date"],
    .tn-filter-form .tn-button {
        width: 100%;
    }

    .tn-card-actions {
        display: grid;
        width: 100%;
    }
}

.tn-login-screen-branded {
    background:
        linear-gradient(rgba(255, 248, 239, .76), rgba(255, 248, 239, .76)),
        url("../img/login-pattern.png");
    background-size: 900px auto;
    background-position: center;
    background-repeat: repeat;
}

.tn-login-screen-branded .tn-login-card {
    background: var(--tn-orange);
    color: #fff;
    border: 1px solid rgba(255,255,255,.22);
}

.tn-login-screen-branded .tn-login-brand p,
.tn-login-screen-branded .tn-login-copy p,
.tn-login-screen-branded .tn-kicker {
    color: rgba(255,255,255,.88);
}

.tn-login-screen-branded .tn-login-card input[type="text"],
.tn-login-screen-branded .tn-login-card input[type="password"] {
    border-color: rgba(255,255,255,.35);
}

.tn-login-screen-branded .tn-button-primary {
    background: #fff;
    color: var(--tn-orange);
}

.tn-login-screen-branded .tn-logo img {
    max-width: 190px;
    max-height: 76px;
}

@media (max-width: 860px) {
    .tn-card-head {
        display: block !important;
    }

    .tn-card-actions {
        margin-top: 16px;
    }

    .tn-card-actions .tn-button,
    .tn-card-head > .tn-button {
        display: inline-flex;
        width: auto;
        margin-top: 14px;
        position: static;
    }
}

.tn-deadline.is-closed {
    background: #fff0ed;
    color: #b42318;
}

.tn-repeat-notice {
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 18px;
    font-weight: 800;
    line-height: 1.4;
}

.tn-repeat-notice-success {
    background: #ecfdf3;
    color: #027a48;
    border: 1px solid #abefc6;
}

.tn-repeat-notice-error {
    background: #fff0ed;
    color: #b42318;
    border: 1px solid #fecdca;
}