:root,
html[data-theme="light"],
html[data-theme="dark"] {
    color-scheme: dark;
    --primary: #c56522;
    --secondary: #17181d;
    --accent: #ff9a3d;
    --primary-fg: #ffffff;
    --body-fg: #d8dae0;
    --body-bg: #101116;
    --body-quiet-color: #858892;
    --body-medium-color: #a5a8b0;
    --body-loud-color: #f1f2f4;
    --header-color: #f1f2f4;
    --header-branding-color: #f1f2f4;
    --header-bg: #121318;
    --header-link-color: #b9bbc2;
    --breadcrumbs-fg: #858892;
    --breadcrumbs-link-fg: #65b9da;
    --breadcrumbs-bg: #101116;
    --link-fg: #65b9da;
    --link-hover-color: #8fd4ed;
    --link-selected-fg: #ff9a3d;
    --hairline-color: #2b2d34;
    --border-color: #32343c;
    --error-fg: #ff8d8d;
    --message-success-bg: rgba(79, 165, 120, .14);
    --message-warning-bg: rgba(255, 154, 61, .12);
    --message-error-bg: rgba(255, 100, 100, .12);
    --darkened-bg: #15161b;
    --selected-bg: rgba(22, 135, 181, .12);
    --selected-row: rgba(22, 135, 181, .08);
    --button-fg: #ffffff;
    --button-bg: #c56522;
    --button-hover-bg: #ad551b;
    --default-button-bg: #c56522;
    --default-button-hover-bg: #ad551b;
    --close-button-bg: #33353d;
    --close-button-hover-bg: #434650;
    --delete-button-bg: #8a4141;
    --delete-button-hover-bg: #743434;
}

* { box-sizing: border-box; }

html { background: var(--body-bg); }

body {
    min-width: 0;
    background: var(--body-bg);
    color: var(--body-fg);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
}

a:link, a:visited { color: var(--link-fg); }
a:hover, a:focus { color: var(--link-hover-color); }

#container { min-height: 100vh; }

#header {
    min-height: 68px;
    padding: 0 32px;
    gap: 24px;
    border-bottom: 1px solid var(--hairline-color);
    background: var(--header-bg);
    color: var(--header-color);
}

#branding { min-width: 180px; }
#site-name { margin: 0; }

.nucleo-admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #f1f2f4 !important;
    text-decoration: none;
}

.nucleo-admin-brand img {
    width: 31px;
    height: 31px;
    object-fit: contain;
}

.nucleo-admin-brand span,
.nucleo-admin-brand strong,
.nucleo-admin-brand small { display: block; }

.nucleo-admin-brand strong {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: -.02em;
}

.nucleo-admin-brand .nucleo-admin-title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 2px;
}

.nucleo-admin-brand .nucleo-admin-title b {
    color: #7f828c;
    font-size: .58rem;
    font-weight: 600;
    letter-spacing: .1em;
}

.nucleo-admin-brand small {
    color: #7f828c;
    font-size: .57rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
}

#user-tools {
    margin-left: auto;
    color: #7f828c;
    font-size: .68rem;
    letter-spacing: 0;
    text-transform: none;
}

#user-tools a { color: #a9acb4; }
#user-tools a:hover { color: #ffffff; }
#user-tools button { color: #a9acb4; font: inherit; }

.admin-logout-footer { display: flex; justify-content: flex-end; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline-color); }
.admin-logout-footer button { min-height: 34px; padding: 0 12px; border: 1px solid #3a3c45; border-radius: 7px; background: transparent; color: #9699a2; font: inherit; font-size: .68rem; cursor: pointer; }
.admin-logout-footer button:hover { border-color: #6d3d41; background: rgba(214, 111, 117, .06); color: #e48a90; }

.theme-toggle { display: none; }

.nucleo-admin-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #30323a;
    border-radius: 7px;
    color: #a9acb4 !important;
    font-size: .65rem;
    text-decoration: none;
    white-space: nowrap;
}

.nucleo-admin-back span { color: #ff9a3d; font-size: 1rem; }
.nucleo-admin-back:hover { border-color: #424550; background: #1a1b21; color: #ffffff !important; }

div.breadcrumbs {
    padding: 13px 40px;
    border-bottom: 1px solid var(--hairline-color);
    background: #101116;
    color: #6f727c;
    font-size: .66rem;
}

div.breadcrumbs a { color: #65b9da; }

.main { min-width: 0; }

#content {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 42px 40px 70px;
}

#content h1 {
    margin: 0 0 32px;
    color: #f1f2f4;
    font-size: 1.42rem;
    font-weight: 500;
    letter-spacing: -.035em;
}

#content h2,
#content h3 {
    color: #dfe1e5;
    font-weight: 500;
    letter-spacing: -.02em;
}

.dashboard #content { max-width: 1060px; }
.dashboard #content-main { width: 100%; }

.module,
.inline-group {
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--hairline-color);
    border-radius: 10px;
    background: #131419;
}

.module caption,
.inline-group h2,
.module h2 {
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid var(--hairline-color);
    background: #17181d;
    color: #ff9a3d;
    font-size: .69rem;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: none;
}

.module caption a { color: #f1f2f4; }

.module table { border-collapse: collapse; }
.module th, .module td { padding: 12px 14px; border-bottom-color: #262830; }
.module tr:last-child th, .module tr:last-child td { border-bottom: 0; }
.module tbody tr:hover { background: rgba(255, 255, 255, .018); }
.module th { color: #adb0b8; font-weight: 500; }

.dashboard .module table th { width: auto; }
.dashboard .module table td { width: 84px; text-align: right; white-space: nowrap; }
.dashboard .module a { font-size: .73rem; }
.dashboard .addlink, .dashboard .changelink { padding-left: 0; background-image: none; color: #777a83; }
.dashboard .addlink:hover, .dashboard .changelink:hover { color: #65b9da; }
.dashboard .addlink::before, .dashboard .changelink::before { display: inline-block; margin-right: 6px; font-weight: 600; }
.dashboard .addlink::before { content: "+"; color: #ff9a3d; }
.dashboard .changelink::before { content: "›"; color: #65b9da; font-size: .9rem; }
.dashboard .openlink {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    color: #858892;
    text-decoration: none;
}
.dashboard .openlink .open-symbol { color: #ff9a3d; font-size: 1rem; font-weight: 600; }
.dashboard .openlink:hover { color: #f1f2f4; }

#content-related {
    width: 250px;
    margin-left: 30px;
    background: transparent;
}

#content-related .module { background: #131419; }
#content-related h2 { color: #f1f2f4; }
#content-related h3 { color: #858892; font-size: .67rem; }
#content-related p { color: #696c75; font-size: .7rem; }

input, textarea, select, .vTextField {
    border: 1px solid #32343c;
    border-radius: 7px;
    background: #15161b;
    color: #e2e3e7;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus, .vTextField:focus {
    border-color: #555862;
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 151, 31, .07);
}

input[type="checkbox"], input[type="radio"] { accent-color: #1687b5; }

.form-row {
    padding: 18px 16px;
    border-bottom-color: #292b32;
}

.form-row label { color: #ff9a3d; font-size: .67rem; font-weight: 500; }
.help, p.help, form p.help, div.help, form div.help { color: #737680; font-size: .66rem; }
.readonly { color: #b4b7be; }

.aligned label { padding-top: 9px; }
fieldset.module { padding: 0; }
fieldset.module h2 { margin: 0; }

.submit-row {
    padding: 14px;
    border: 1px solid var(--hairline-color);
    border-radius: 9px;
    background: #15161b;
}

.button,
input[type="submit"],
input[type="button"],
.submit-row input,
a.button {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 7px;
    background: #c56522;
    color: #ffffff !important;
    font-family: inherit;
    font-size: .7rem;
    font-weight: 500;
}

.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.submit-row input:hover,
a.button:hover { background: #ad551b; }

.submit-row a.deletelink { width: auto; min-width: 0; min-height: 36px; display: inline-grid; place-items: center; padding: 0 14px; border: 1px solid #8a4141; border-radius: 7px; background: transparent; color: #ff7f7f !important; text-decoration: none; }
.submit-row a.deletelink:hover { border-color: #b65757; background: rgba(182, 87, 87, .11); }

.object-tools { margin-top: -52px; }
.object-tools a:link, .object-tools a:visited {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: 7px;
    background: #c56522;
    color: #ffffff;
    font-size: .67rem;
    font-weight: 500;
}

.object-tools a:hover { background: #ad551b; }

#changelist .actions {
    padding: 11px 13px;
    border: 1px solid var(--hairline-color);
    border-radius: 9px 9px 0 0;
    background: #15161b;
}

#changelist .actions label { color: #858892; }
#changelist-form .results { border: 1px solid var(--hairline-color); border-radius: 0 0 9px 9px; }
#changelist table { background: #131419; }
#changelist table thead th { padding: 10px 12px; background: #191a20; color: #9699a2; }
#changelist table tbody td, #changelist table tbody th { padding: 12px; border-color: #282a31; }
#changelist table tbody tr:hover { background: rgba(255, 255, 255, .018); }

#changelist-filter {
    border: 1px solid var(--hairline-color);
    border-radius: 9px;
    background: #15161b;
}

#changelist-filter h2 { background: #191a20; color: #f1f2f4; }
#changelist-filter h3 { color: #ff9a3d; }
#changelist-filter li.selected a { color: #65b9da !important; }

#toolbar {
    padding: 10px;
    border: 1px solid var(--hairline-color);
    border-radius: 9px;
    background: #15161b;
}

#toolbar form input[type="submit"] { margin-left: 6px; }
.paginator { border-bottom-color: var(--hairline-color); color: #858892; }

.messagelist { max-width: 1180px; margin: 20px auto 0 !important; padding: 0 40px !important; }
.messagelist li { border-radius: 8px; color: #dfe1e5; }

.login #container {
    width: min(420px, calc(100% - 32px));
    margin-top: 10vh;
    border: 1px solid var(--hairline-color);
    border-radius: 12px;
    background: #131419;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
}

.login #header { justify-content: center; padding: 22px; }
.login #branding { width: 100%; min-width: 0; display: flex; justify-content: center; text-align: center; }
.login #site-name { width: fit-content; }
.login #content { padding: 30px; }
.login .form-row { padding: 0 0 18px; }
.login .submit-row { padding: 0; border: 0; background: transparent; }
.login .submit-row input { width: 100%; }

.admin-sku-warning {
    width: min(430px, calc(100% - 32px));
    padding: 0;
    border: 1px solid #34363e;
    border-radius: 12px;
    background: #18191f;
    color: #dfe1e5;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.admin-sku-warning::backdrop { background: rgba(4, 5, 8, .72); backdrop-filter: blur(2px); }
.admin-sku-warning > div { padding: 24px; }
.admin-sku-warning small { display: block; margin-bottom: 8px; color: #ff9a3d; font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.admin-sku-warning h2 { margin: 0 0 10px; color: #f1f2f4; font-size: 1rem; font-weight: 500; }
.admin-sku-warning p { margin: 0; color: #8f929b; font-size: .73rem; line-height: 1.6; }
.admin-sku-warning footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.admin-sku-warning button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 7px; color: #ffffff; font: inherit; font-size: .7rem; cursor: pointer; }
.admin-sku-warning [data-admin-sku-cancel] { background: #30323a; }
.admin-sku-warning [data-admin-sku-confirm] { background: #c56522; }

.model-variationtype .tabular th.original,
.model-variationtype .tabular td.original {
    display: table-cell;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden;
    visibility: hidden;
    font-size: 0;
}
.model-variationtype .tabular table { width: 100%; table-layout: fixed; }
.model-variationtype .tabular td { padding: 8px; vertical-align: middle; }
.model-variationtype .tabular th.column-name,
.model-variationtype .tabular td.field-name { width: calc(100% - 250px); }
.model-variationtype .tabular th.column-code,
.model-variationtype .tabular td.field-code { width: 150px; }
.model-variationtype .tabular th.column-is_active,
.model-variationtype .tabular td.field-is_active { width: 58px; text-align: center; }
.model-variationtype .tabular th:last-child { color: transparent; font-size: 0; }
.model-variationtype .tabular th:last-child,
.model-variationtype .tabular td.delete { width: 42px; text-align: center; }
.model-variationtype .tabular input[type="text"] { width: 100%; }
.inline-delete-checkbox { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.inline-delete-button { width: 27px; height: 27px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #ff7f7f; font-size: 1rem; line-height: 1; cursor: pointer; }
.inline-delete-button:hover { border-color: #713d3d; background: rgba(182, 87, 87, .1); }

.change-list .column-delete_control,
.change-list .field-delete_control { width: 34px; padding-right: 14px; text-align: right; }
.row-delete-link { display: inline-grid; width: 27px; height: 27px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #ff7f7f !important; font-size: 1rem; line-height: 1; text-decoration: none; }
.row-delete-link:hover { border-color: #713d3d; background: rgba(182, 87, 87, .1); }

.admin-delete-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid #443238; border-radius: 12px; background: #18191f; color: #dfe1e5; box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }
.admin-delete-dialog::backdrop { background: rgba(4, 5, 8, .72); backdrop-filter: blur(2px); }
.admin-delete-dialog > div { padding: 24px; }
.admin-delete-dialog small { display: block; margin-bottom: 8px; color: #ff7f7f; font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.admin-delete-dialog h2 { margin: 0 0 10px; color: #f1f2f4; font-size: 1rem; font-weight: 500; }
.admin-delete-dialog p { margin: 0; color: #8f929b; font-size: .73rem; line-height: 1.6; }
.admin-delete-dialog footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.admin-delete-dialog button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 7px; color: #ffffff; font: inherit; font-size: .7rem; cursor: pointer; }
.admin-delete-dialog [data-delete-cancel] { background: #30323a; }
.admin-delete-dialog [data-delete-confirm] { background: #8a4141; }

@media (max-width: 800px) {
    #header { min-height: auto; flex-wrap: wrap; padding: 14px 18px; }
    #branding { flex: 1; }
    #user-tools { width: 100%; order: 3; margin: 0; padding-top: 10px; border-top: 1px solid var(--hairline-color); }
    .nucleo-admin-back { margin-left: auto; }
    div.breadcrumbs { padding: 12px 20px; }
    #content { padding: 30px 20px 56px; }
    .dashboard #content-main { width: 100%; }
    #content-related { width: 100%; margin: 28px 0 0; }
    .object-tools { margin-top: 0; margin-bottom: 18px; float: none; }
    .object-tools li { float: none; }
    .object-tools a:link { justify-content: center; }
    .aligned label { float: none; width: auto; padding: 0 0 7px; }
    .aligned .form-row input, .aligned .form-row select, .aligned .form-row textarea { max-width: 100%; }
    .messagelist { padding: 0 20px !important; }
    .model-variationtype .tabular th.column-name,
    .model-variationtype .tabular td.field-name { width: calc(100% - 204px); }
    .model-variationtype .tabular th.column-code,
    .model-variationtype .tabular td.field-code { width: 120px; }
    .model-variationtype .tabular th.column-is_active,
    .model-variationtype .tabular td.field-is_active { width: 46px; }
    .model-variationtype .tabular th:last-child,
    .model-variationtype .tabular td.delete { width: 38px; }
}

@media (max-width: 420px) {
    .model-variationtype .tabular th.column-name,
    .model-variationtype .tabular td.field-name { width: calc(100% - 175px); }
    .model-variationtype .tabular th.column-code,
    .model-variationtype .tabular td.field-code { width: 105px; }
    .model-variationtype .tabular th.column-is_active,
    .model-variationtype .tabular td.field-is_active { width: 38px; }
    .model-variationtype .tabular th:last-child,
    .model-variationtype .tabular td.delete { width: 32px; }
}
