/* Per-audience skins. .tk-portal--customer, --technician, --admin, --auth,
   and --public reassign --cyan and restyle the shell.
   These selectors are more specific than 04-components.css, so they win.
   An audience-specific button or card change belongs here. */

/* ==========================================================================
   Purpose-built product surfaces
   --------------------------------------------------------------------------
   Each audience gets its own visual system. The public site remains an
   expressive storefront; signed-in areas feel like focused products rather
   than marketing pages with different links.
   ========================================================================== */

.tk-portal--customer {
    --cyan: #4F8CFF;
    --cyan-bright: #79A9FF;
    --cyan-dim: rgba(79, 140, 255, .13);
    --cyan-line: rgba(79, 140, 255, .34);
    --focus-ring: rgba(79, 140, 255, .2);
}
.tk-portal--technician {
    --cyan: #F5A524;
    --cyan-bright: #FFC65C;
    --cyan-dim: rgba(245, 165, 36, .13);
    --cyan-line: rgba(245, 165, 36, .36);
    --focus-ring: rgba(245, 165, 36, .2);
}
.tk-portal--admin {
    --cyan: #9A7CFF;
    --cyan-bright: #B7A2FF;
    --cyan-dim: rgba(154, 124, 255, .13);
    --cyan-line: rgba(154, 124, 255, .34);
    --focus-ring: rgba(154, 124, 255, .2);
}
.tk-portal--employee {
    --cyan: #35CDA0;
    --cyan-bright: #69E0BD;
    --cyan-dim: rgba(53, 205, 160, .12);
    --cyan-line: rgba(53, 205, 160, .34);
    --focus-ring: rgba(53, 205, 160, .2);
}

.tk-body--app {
    background-color: var(--bg);
    background-attachment: fixed;
}
.tk-portal--customer {
    background-image:
        radial-gradient(800px 430px at 8% 4%, rgba(79, 140, 255, .11), transparent 65%),
        linear-gradient(180deg, rgba(79, 140, 255, .035), transparent 40%);
}
.tk-portal--technician {
    background-image:
        linear-gradient(rgba(245, 165, 36, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 165, 36, .025) 1px, transparent 1px),
        radial-gradient(760px 380px at 85% 0%, rgba(245, 165, 36, .1), transparent 68%);
    background-size: 32px 32px, 32px 32px, auto;
}
.tk-portal--admin {
    background-image:
        radial-gradient(900px 500px at 50% -10%, rgba(154, 124, 255, .1), transparent 67%);
}
.tk-portal--employee {
    background-image:
        linear-gradient(135deg, rgba(53, 205, 160, .04) 25%, transparent 25%),
        linear-gradient(315deg, rgba(53, 205, 160, .025) 25%, transparent 25%);
    background-size: 46px 46px;
}

html[data-theme="light"] .tk-portal--customer {
    --cyan: #245DD8;
    --cyan-bright: #174AB9;
    --cyan-dim: rgba(36, 93, 216, .09);
    --cyan-line: rgba(36, 93, 216, .24);
}
html[data-theme="light"] .tk-portal--technician {
    --cyan: #A85E00;
    --cyan-bright: #874B00;
    --cyan-dim: rgba(168, 94, 0, .09);
    --cyan-line: rgba(168, 94, 0, .25);
}
html[data-theme="light"] .tk-portal--admin {
    --cyan: #6545C7;
    --cyan-bright: #4F32A8;
    --cyan-dim: rgba(101, 69, 199, .09);
    --cyan-line: rgba(101, 69, 199, .24);
}
html[data-theme="light"] .tk-portal--employee {
    --cyan: #087F61;
    --cyan-bright: #05664E;
    --cyan-dim: rgba(8, 127, 97, .09);
    --cyan-line: rgba(8, 127, 97, .24);
}

.tk-body--app {
    --tk-header-h: 70px;
}
.tk-body--app .tk-header {
    border-bottom: 0;
    box-shadow: 0 1px 0 var(--line);
}
.tk-body--app .tk-header__inner { min-height: var(--tk-header-h); }
.tk-logo--workspace .tk-logo-mark {
    width: 38px;
    height: 38px;
    padding: 7px;
    border: 1px solid var(--cyan-line);
    border-radius: 11px;
    background: var(--cyan-dim);
}
.tk-logo--workspace .tk-logo__ar {
    max-width: 11rem;
    overflow: hidden;
    font-size: .92rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tk-logo--workspace .tk-logo__en {
    color: var(--cyan);
    font-size: .56rem;
    letter-spacing: .12em;
}

.tk-body--app .tk-main {
    padding-block-start: 28px;
}
.tk-footer--workspace {
    padding-block: 14px;
    border-top-color: var(--line-soft);
    background: var(--bg-raised);
}
.tk-footer--workspace .tk-footer__bottom {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: .72rem;
}
.tk-footer__workspace { color: var(--cyan); }

.tk-portal--customer .tk-card,
.tk-portal--customer .tk-request-card {
    border-radius: 20px;
}
.tk-portal--customer .tk-timeline__dot { box-shadow: 0 0 0 5px var(--bg); }

.tk-portal--technician .tk-grid--2 > .tk-card {
    position: relative;
    height: 100%;
    border-inline-start: 3px solid var(--cyan);
    border-radius: 8px 16px 16px 8px;
}
html[dir="rtl"] .tk-portal--technician .tk-grid--2 > .tk-card {
    border-radius: 16px 8px 8px 16px;
}
.tk-portal--technician .tk-total--grand {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--cyan-dim);
}
.tk-portal--technician .tk-cut-notes {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    text-align: start;
}
.tk-portal--technician .tk-cut-notes p { margin: 0; }

.tk-portal--admin .tk-adminmenu-btn {
    border-color: var(--cyan-line);
    background: var(--cyan-dim);
}

.tk-portal--employee .tk-card,
.tk-portal--employee .tk-stat {
    border-radius: 9px;
}
.tk-portal--employee .tk-adminmenu-btn {
    border-radius: 8px;
    border-inline-start: 4px solid var(--cyan);
}
.tk-portal--employee .tk-sidebar {
    border-inline-start: 4px solid var(--cyan);
}

.tk-portal--public .tk-main > .tk-container {
    max-width: 1240px;
}
.tk-portal--public .tk-service {
    border-radius: 20px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .018), transparent 45%),
        var(--bg-card);
}
.tk-portal--public .tk-service__icon {
    border-radius: 50%;
}

@media (max-width: 720px) {
    .tk-body--app .tk-header__inner { min-height: var(--tk-header-h); }
    .tk-logo--workspace .tk-logo__ar { max-width: 7.5rem; }
    .tk-logo--workspace .tk-logo-mark { width: 34px; height: 34px; }
    .tk-footer--workspace { display: none; }
}

/* ==========================================================================
   Dedicated shells: technician wizard, compact timelines, auth
   ========================================================================== */

.tk-header--auth { border-bottom-color: transparent; }
.tk-main--auth {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}
.tk-portal--auth .tk-auth { max-width: 460px; margin-inline: auto; }
.tk-portal--auth .tk-auth--wide { max-width: 640px; }
.tk-portal--auth .tk-auth--booking { max-width: 100%; width: 100%; }

.tk-tech-wizard {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}
.tk-tech-wizard li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--silver-faint);
    font-size: .78rem;
    background: var(--bg-card);
}
.tk-tech-wizard li.is-done { color: var(--ok); border-color: rgba(46, 204, 143, .35); }
.tk-tech-wizard li.is-current {
    color: var(--text);
    border-color: var(--cyan-line);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}
.tk-fieldset.is-current {
    border-color: var(--cyan-line);
    box-shadow: 0 0 0 3px var(--cyan-dim);
}

.tk-timeline--compact {
    margin: 12px 0 0;
    font-size: .7rem;
}
.tk-timeline--compact .tk-timeline__dot {
    width: 18px;
    height: 18px;
    font-size: .65rem;
}

.tk-tabs__item { position: relative; }
.tk-tabs__badge {
    position: absolute;
    top: 6px;
    inset-inline-end: 18%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--cyan);
    color: #04222B;
    font-size: .62rem;
    font-weight: 800;
    line-height: 16px;
    text-align: center;
}

:lang(en).tk-portal--public .tk-hero h1,
.tk-portal--public:lang(en) .tk-hero h1,
html[lang="en"] .tk-portal--public .tk-hero h1 { letter-spacing: -.04em; }
.tk-portal--auth .tk-header__inner { min-height: 64px; }

.tk-tabs__badge[hidden] { display: none !important; }

.tk-portal--auth {
    background-image: radial-gradient(620px 340px at 50% -8%, rgba(0, 212, 232, .08), transparent 70%);
}
.tk-portal--auth .tk-header { background: transparent; box-shadow: none; }
.tk-main--auth {
    min-height: calc(100vh - 140px);
    padding-block: 36px 64px;
}
.tk-portal--auth .tk-footer--workspace { display: block; background: transparent; }

.tk-portal--public .tk-header {
    backdrop-filter: blur(16px);
}
.tk-portal--public .tk-tabs__item--book .tk-tabs__book {
    box-shadow: 0 10px 24px rgba(0, 212, 232, .28);
}

@media (max-width: 900px) {
    .tk-tech-wizard { grid-template-columns: 1fr 1fr; }
}


/* ---- Takefat 2.0 portal UX additions ---- */

.tk-auth {
    max-width: min(470px, 100%);
    width: 100%;
}
.tk-auth--booking,
.tk-portal--auth .tk-auth--booking {
    max-width: 100%;
}
.tk-main--auth {
    min-height: max(240px, calc(100vh - 160px));
    min-height: max(240px, calc(100dvh - 160px));
}
.tk-portal--auth .tk-auth__head { max-width: 100%; }

.tk-filterbar.sticky {
    position: sticky;
    top: var(--tk-header-h, 64px);
    z-index: 8;
    padding: 12px 0 28px;
    margin-bottom: 0;
    background:
        linear-gradient(var(--line-soft), var(--line-soft)) left bottom 28px / 100% 1px no-repeat,
        var(--bg);
    border-bottom: 0;
}
.tk-density {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.tk-density .is-active {
    border-color: var(--cyan-line);
    color: var(--cyan);
}

.tk-testimonials .tk-quote {
    margin: 0;
    padding: 18px 16px;
    border-inline-start: 3px solid var(--cyan);
    background: var(--bg-card);
    border-radius: 0 12px 12px 0;
}
html[dir="rtl"] .tk-testimonials .tk-quote {
    border-radius: 12px 0 0 12px;
}
.tk-testimonials .tk-quote p {
    margin: 0 0 10px;
    color: var(--silver);
    line-height: 1.55;
}
.tk-testimonials .tk-quote footer {
    color: var(--silver-faint);
    font-size: .85rem;
    font-weight: 700;
}

.tk-grid:has(> .tk-job-card) {
    align-items: stretch;
}
.tk-job-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tk-job-card:hover,
.tk-job-card:focus-within {
    border-color: var(--cyan-line);
    box-shadow: var(--shadow);
}
.tk-job-card__hit {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}
.tk-job-card__body { flex: 1 1 auto; min-height: 0; }
.tk-job-card__foot {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex: 0 0 auto;
    margin-top: auto;
    width: 100%;
}
.tk-job-card__foot > p { margin-bottom: 0; }
.tk-job-card__action { position: relative; z-index: 2; }
.tk-job-header {
    margin-bottom: 18px;
}
/* Desktop: pin the admin/ops sidebar while page content scrolls.
   Sticky (not viewport-fixed) keeps it in the centered grid column and
   below the sticky header. Do not min-height the rail to ~100vh — that
   makes sticky a no-op and, with multiple content roots, hides later
   sections below the fold. Content MUST be a single .tk-admin-main sibling. */
.tk-admin-main { min-width: 0; }
@media (min-width: 1100px) {
    .tk-body--admin {
        --tk-admin-sidebar-top: calc(var(--tk-header-h, 70px) + 12px);
    }
    .tk-body--admin .tk-main > .tk-container:has(.tk-admin-shell) {
        display: grid;
        grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
        column-gap: 28px;
        align-items: start;
    }
    .tk-body--admin .tk-main > .tk-container:has(.tk-admin-shell) > .tk-admin-shell {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
        position: sticky;
        top: var(--tk-admin-sidebar-top);
        align-self: start;
        max-height: calc(100vh - var(--tk-admin-sidebar-top) - 16px);
        z-index: 25;
    }
    .tk-body--admin .tk-main > .tk-container:has(.tk-admin-shell) > .tk-admin-main {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .tk-admin-shell .tk-adminmenu-btn,
    .tk-admin-shell .tk-sidebar-backdrop,
    .tk-admin-shell .tk-sidebar__close {
        display: none !important;
    }

    .tk-admin-shell .tk-sidebar {
        position: static;
        inset: auto;
        z-index: auto;
        width: 100%;
        max-width: none;
        min-height: 0;
        height: 100%;
        max-height: inherit;
        transform: none !important;
        box-shadow: none;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--bg-card);
        overflow: hidden;
    }
    html[dir="rtl"] .tk-admin-shell .tk-sidebar {
        transform: none !important;
    }
    .tk-admin-shell .tk-sidebar__head {
        border-bottom: 1px solid var(--line-soft);
    }
    .tk-admin-shell .tk-sidebar__nav {
        flex: 1 1 auto;
        min-height: 0;
    }
}

/* --------------------------------------------------------------------------
   Admin / ops spacing — clearer sections, less crowded lists
   -------------------------------------------------------------------------- */

.tk-admin-section {
    margin-top: 2.35rem;
}
.tk-admin-section:first-child {
    margin-top: 0;
}
.tk-body--admin .tk-main {
    padding-block: 28px 72px;
}
.tk-body--admin .tk-pagehead {
    margin-bottom: 18px;
}
.tk-body--admin .tk-pagehead h1 {
    margin: 0 0 .45rem;
    line-height: 1.2;
}
.tk-body--admin .tk-pagehead h2 {
    margin: 0 0 .4rem;
    font-size: 1.22rem;
    line-height: 1.25;
}
.tk-body--admin .tk-pagehead .tk-muted,
.tk-body--admin .tk-pagehead > p {
    margin: 0;
    max-width: 40rem;
    line-height: 1.5;
}
.tk-body--admin .tk-pagehead .tk-row {
    gap: 12px 16px;
}
.tk-body--admin .tk-filterbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
    justify-content: start;
    align-items: end;
    gap: 12px 16px;
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
}
.tk-filterbar__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    min-width: 0;
}
.tk-body--admin .tk-filterbar .tk-btn { align-self: end; justify-self: start; }
form .tk-grid { align-items: start; }
.tk-catalogue-add .tk-label { display: block; margin: 0 0 6px; }
.tk-catalogue-add .tk-input,
.tk-catalogue-add .tk-select {
    display: block;
    width: 100%;
    height: 40px;
    max-height: 40px;
    margin-bottom: 12px;
}
.tk-body--admin .tk-admin-editor .tk-field { margin-bottom: 0; }
.tk-body--admin .tk-admin-editor .tk-input,
.tk-body--admin .tk-admin-editor .tk-select {
    height: 40px;
    max-height: 40px;
}
.tk-catalogue-add {
    margin-top: 20px;
    padding: 20px 16px 12px;
    border-top: 1px solid var(--line-soft);
    max-width: 32rem;
}
.tk-catalogue-add h3 { margin: 0 0 12px; font-size: 1.0625rem; }
.tk-body--admin .tk-filterbar .tk-density {
    margin-inline-start: auto;
    flex: 0 0 auto;
}
.tk-body--admin .tk-filterbar .tk-check {
    align-self: end;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}
.tk-body--admin .tk-grid {
    gap: 16px;
}
.tk-body--admin .tk-earnings {
    gap: 14px;
}
.tk-body--admin .tk-stat {
    padding: 18px 16px;
    gap: 8px;
}
.tk-body--admin .tk-card.tk-table-wrap {
    padding: 4px 0;
    overflow: hidden;
}
.tk-body--admin .tk-table th,
.tk-body--admin .tk-table td {
    padding: 13px 16px;
}
.tk-body--admin .tk-support-grid {
    gap: 16px;
}
.tk-body--admin .tk-support-grid > .tk-card {
    padding: 20px;
}
.tk-body--admin .tk-alert.tk-pii-banner {
    margin-bottom: 20px;
    padding: 14px 16px;
}
.tk-body--admin .tk-pii-form {
    margin-top: 12px;
}
.tk-body--admin .tk-pii-form .tk-grid {
    gap: 12px;
    margin-bottom: 10px;
}
.tk-body--admin .tk-cancel-stats {
    gap: 12px;
}
.tk-body--admin .tk-cancel-stats__row {
    padding: 14px 16px;
}
.tk-body--admin .tk-empty {
    padding: 36px 20px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
}
.tk-body--admin .tk-admin-shell {
    margin-bottom: 18px;
}
.tk-body--admin .tk-pager {
    margin-top: 20px;
}
.tk-body--admin .tk-facts {
    gap: 14px 18px;
    margin-top: 14px;
}
.tk-body--admin .tk-admin-editor {
    margin-bottom: 18px;
}
.tk-body--admin .tk-admin-editor + .tk-admin-editor {
    margin-top: 8px;
}
.tk-body--admin .tk-admin-editor__body {
    padding: 4px 18px 18px;
}
.tk-body--admin .tk-admin-editor .tk-panel {
    margin-bottom: 16px;
    padding: 16px;
}
.tk-body--admin .tk-admin-editor .tk-panel:last-child {
    margin-bottom: 0;
}
.tk-body--admin .tk-support-grid > .tk-card h3 {
    margin: 0 0 6px;
    line-height: 1.3;
}
.tk-body--admin .tk-support-grid > .tk-card > p {
    margin: 0 0 10px;
    line-height: 1.5;
}
.tk-body--admin .tk-support-grid > .tk-card > form {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--line-soft);
}
.tk-body--admin section > h2 {
    margin: 0 0 14px;
    font-size: 1.15rem;
    line-height: 1.3;
}
.tk-body--admin .tk-admin-section + .tk-admin-section {
    padding-top: .15rem;
}

@media (max-width: 720px) {
    .tk-body--admin .tk-filterbar .tk-density {
        margin-inline-start: 0;
        width: 100%;
    }
    .tk-body--admin .tk-admin-section {
        margin-top: 1.75rem;
    }
    .tk-body--admin .tk-admin-request-cards,
    .tk-body--admin .tk-admin-mobile-cards {
        gap: 14px;
    }
    .tk-body--admin .tk-admin-request-card,
    .tk-body--admin .tk-admin-mobile-card {
        gap: 10px;
        padding: 18px;
    }
}
