/* ---------------------------------------------------------------------------
   dt-base — the standalone foundation of the redesign.

   This file exists so the purchased theme can eventually be unlinked. It
   reimplements, from the token layer, the layout and utility classes the app's
   markup actually uses — measured across the rendered pages, not guessed: the
   12-column grid, the display/flex/spacing/typography utilities, and the few
   visual helpers. Component styling lives in dt-components.css, the uploader in
   dt-uploader.css, tokens in dt-tokens.css.

   Nothing here targets a theme class by name. It is a replacement, not a patch.
   --------------------------------------------------------------------------- */

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

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

body {
    margin: 0;
    background: var(--dt-paper);
    color: var(--dt-ink-body);
    font-family: var(--dt-font-body);
    font-size: var(--dt-t-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { max-width: 100%; }
svg { vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--dt-line); margin: 20px 0; }
[hidden], .hidden { display: none !important; }

/* ------------------------------------------------------------- typography */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--dt-font-heading);
    color: var(--dt-ink);
    margin: 0 0 8px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    text-wrap: balance;
}
h1, .h1 { font-size: 30px; font-weight: 800; }
h2, .h2 { font-size: 24px; font-weight: 800; }
h3, .h3 { font-size: var(--dt-t-xl); font-weight: 700; }
h4, .h4 { font-size: var(--dt-t-lg); font-weight: 700; }
h5, .h5 { font-size: var(--dt-t-md); font-weight: 700; }
h6, .h6 { font-size: var(--dt-t-base); font-weight: 700; }

p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
small, .small { font-size: var(--dt-t-xs); }
strong, b { font-weight: 700; color: var(--dt-ink); }

a { color: var(--dt-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { margin: 0 0 10px; padding-left: 22px; }
li { margin-bottom: 4px; }
a, p, h2, h4, h6, .card { letter-spacing: normal; }

/* the app's own weight helpers */
.f-w-300 { font-weight: 300; }
.f-w-400 { font-weight: 400; }
.f-w-500 { font-weight: 500; }
.f-w-600 { font-weight: 600; }
.f-w-700, .font-weight-bold, .fw-bold { font-weight: 700; }
.f-w-800 { font-weight: 800; }

/* type floor: 12px for anything readable, 11px only inside a pill */
.f-10, .f-11, .font-10 { font-size: var(--dt-t-xs); }
.f-12 { font-size: var(--dt-t-xs); }
.f-14 { font-size: var(--dt-t-base); }
.f-16 { font-size: 16px; }
.f-18 { font-size: 18px; }
.f-20 { font-size: var(--dt-t-xl); }

.text-center { text-align: center; }
.text-start, .text-left { text-align: left; }
.text-end, .text-right { text-align: right; }
.text-nowrap { white-space: nowrap; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.text-capitalize { text-transform: capitalize; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.text-break { overflow-wrap: break-word; word-break: break-word; }

.text-muted { color: var(--dt-ink-muted); }
.text-primary { color: var(--dt-secondary); }
.text-secondary { color: var(--dt-ink-muted); }
.text-success { color: var(--dt-good-ink); }
.text-warning, .text-danger { color: var(--dt-warn-ink); }
.text-dark { color: var(--dt-ink); }
.text-white { color: #FFFFFF; }

/* ------------------------------------------------------------------ grid */
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.container-fluid { width: 100%; padding: 0 16px; }

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}
.row > * { padding: 0 12px; width: 100%; }
.row.no-gutters, .row.g-0 { margin: 0; }
.row.no-gutters > *, .row.g-0 > * { padding: 0; }

.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1  { flex: 0 0 auto; width: 8.3333%; }
.col-2  { flex: 0 0 auto; width: 16.6667%; }
.col-3  { flex: 0 0 auto; width: 25%; }
.col-4  { flex: 0 0 auto; width: 33.3333%; }
.col-5  { flex: 0 0 auto; width: 41.6667%; }
.col-6  { flex: 0 0 auto; width: 50%; }
.col-7  { flex: 0 0 auto; width: 58.3333%; }
.col-8  { flex: 0 0 auto; width: 66.6667%; }
.col-9  { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.3333%; }
.col-11 { flex: 0 0 auto; width: 91.6667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.3333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
    .d-md-flex { display: flex !important; }
    .d-md-block { display: block !important; }
    .d-md-none { display: none !important; }
    .ml-md-4 { margin-left: 24px; }
}
@media (min-width: 992px) {
    .col-lg-2 { flex: 0 0 auto; width: 16.6667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
    .d-lg-flex { display: flex !important; }
    .d-lg-none { display: none !important; }
    .mb-lg-0 { margin-bottom: 0 !important; }
}
@media (min-width: 1200px) {
    .col-xl-3 { flex: 0 0 auto; width: 25%; }
    .col-xl-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
    .d-xl-block { display: block !important; }
    .d-xl-none { display: none !important; }
}
@media (min-width: 1400px) {
    .col-xxl-3 { flex: 0 0 auto; width: 25%; }
    .col-xxl-4 { flex: 0 0 auto; width: 33.3333%; }
    .col-xxl-6 { flex: 0 0 auto; width: 50%; }
    .col-xxl-8 { flex: 0 0 auto; width: 66.6667%; }
    .col-xxl-12 { flex: 0 0 auto; width: 100%; }
}

/* ------------------------------------------------------ display and flex */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-fill { flex: 1 1 auto; }

.justify-content-start { justify-content: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }
.align-items-start { align-items: flex-start; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-items-stretch { align-items: stretch; }
.align-self-stretch { align-self: stretch; }
.align-self-center { align-self: center; }

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.gap-5 { gap: 32px; }

.ms-auto, .ml-auto { margin-left: auto; }
.me-auto, .mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --------------------------------------------------------------- spacing */
.m-0 { margin: 0; } .m-1 { margin: 4px; } .m-2 { margin: 8px; } .m-3 { margin: 16px; } .m-4 { margin: 24px; } .m-5 { margin: 48px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; } .mt-4 { margin-top: 24px; } .mt-5 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; } .mb-4 { margin-bottom: 24px; } .mb-5 { margin-bottom: 48px; }
.ms-1, .ml-1 { margin-left: 4px; } .ms-2, .ml-2 { margin-left: 8px; } .ms-3, .ml-3 { margin-left: 16px; } .ms-4, .ml-4 { margin-left: 24px; }
.me-1, .mr-1 { margin-right: 4px; } .me-2, .mr-2 { margin-right: 8px; } .me-3, .mr-3 { margin-right: 16px; } .me-4, .mr-4 { margin-right: 24px; }
.my-1 { margin-top: 4px; margin-bottom: 4px; } .my-2 { margin-top: 8px; margin-bottom: 8px; } .my-3 { margin-top: 16px; margin-bottom: 16px; }
.mx-1 { margin-left: 4px; margin-right: 4px; } .mx-2 { margin-left: 8px; margin-right: 8px; } .mx-3 { margin-left: 16px; margin-right: 16px; }

.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; } .p-3 { padding: 16px; } .p-4 { padding: 24px; } .p-5 { padding: 48px; }
.pt-0 { padding-top: 0; } .pt-1 { padding-top: 4px; } .pt-2 { padding-top: 8px; } .pt-3 { padding-top: 16px; } .pt-4 { padding-top: 24px; }
.pb-0 { padding-bottom: 0; } .pb-1 { padding-bottom: 4px; } .pb-2 { padding-bottom: 8px; } .pb-3 { padding-bottom: 16px; } .pb-4 { padding-bottom: 24px; }
.ps-0, .pl-0 { padding-left: 0; } .ps-1, .pl-1 { padding-left: 4px; } .ps-2, .pl-2 { padding-left: 8px; } .ps-3, .pl-3 { padding-left: 16px; }
.pe-0, .pr-0 { padding-right: 0; } .pe-1, .pr-1 { padding-right: 4px; } .pe-2, .pr-2 { padding-right: 8px; } .pe-3, .pr-3 { padding-right: 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; } .px-3 { padding-left: 16px; padding-right: 16px; } .px-4 { padding-left: 24px; padding-right: 24px; }
.py-0 { padding-top: 0; padding-bottom: 0; } .py-2 { padding-top: 8px; padding-bottom: 8px; } .py-3 { padding-top: 16px; padding-bottom: 16px; }

/* ---------------------------------------------------------------- visual */
.w-100 { width: 100%; } .w-75 { width: 75%; } .w-50 { width: 50%; } .w-auto { width: auto; }
.h-100 { height: 100%; } .h-auto { height: auto; }
.mw-100 { max-width: 100%; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.rounded { border-radius: var(--dt-r); }
.rounded-pill { border-radius: var(--dt-r-pill); }
.rounded-circle { border-radius: 50%; }
.b-r-10 { border-radius: var(--dt-r-sm); }
.border { border: 1px solid var(--dt-line); }
.border-0 { border: 0; }
.shadow-sm { box-shadow: var(--dt-shadow-sm); }
.shadow { box-shadow: var(--dt-shadow); }
.bg-white { background: var(--dt-panel); }
.bg-light { background: var(--dt-tint); }
.bg-primary { background: var(--dt-solid); color: var(--dt-on-solid); }
.bg-success { background: var(--dt-good-soft); color: var(--dt-good-ink); }
.bg-warning, .bg-danger { background: var(--dt-warn-soft); color: var(--dt-warn-ink); }
.cursor-p, .cursor-pointer { cursor: pointer; }
.opacity-50 { opacity: 0.5; }
.fade { opacity: 0; transition: opacity var(--dt-dur-enter) var(--dt-ease-enter); }
.fade.show { opacity: 1; }

/* the app's own tinted-surface helpers */
.btn-light1-primary { background: var(--dt-primary-soft); }
.b-light1-primary { border: 1px solid var(--dt-line); }
.b-light1-success { border: 1px solid var(--dt-line); }
.b-light1-danger { border: 1px solid var(--dt-line); }

/* ----------------------------------------------------------------- focus */
:focus-visible {
    outline-style: solid;
    outline-width: var(--dt-ring-width);
    outline-offset: var(--dt-ring-offset);
    outline-color: var(--dt-ring);
}

/* ------------------------------------------------------- screen-reader only */
.sr-only, .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .fade { transition: none; }
}
