/* Αιτήματα & Κλήσεις — Stripe-like. Φόρτωση στο App.razor:
   <link rel="stylesheet" href="css/tickets.css" /> */

:root {
    --tk-accent: #635bff;
    --tk-accent-soft: #eeedff;
    --tk-border: #e6e8eb;
    --tk-muted: #6b7280;
    --tk-text: #1a1f36;
    --tk-bg-soft: #f7f8fa;
    --tk-radius: 10px;
}

.tk-page { padding: 20px 4px 40px; color: var(--tk-text); }
.tk-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tk-title { font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.tk-sub { color: var(--tk-muted); font-size: .875rem; margin-top: 2px; }
.tk-card { background: #fff; border: 1px solid var(--tk-border); border-radius: var(--tk-radius); }
.tk-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--tk-border); }
.tk-card-title { font-weight: 600; font-size: .9rem; }
.tk-card-body { padding: 14px 16px; }
.tk-muted { color: var(--tk-muted); }
.tk-mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .82rem; }
.tk-nowrap { white-space: nowrap; }
.tk-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tabs / chips φίλτρων */
/* Tabs: πλήρες πλάτος, τίτλοι στοιχισμένοι δεξιά */
.tk-tabs {
    width: 100%;
}

    .tk-tabs .mud-tabs-panels,
    .tk-tabs .mud-tab-panel {
        width: 100%;
    }

    .tk-tabs .mud-tabs-tabbar {
        background: transparent;
        border-bottom: 1px solid #e5e7eb;
    }

    /*
    .tk-tabs .mud-tabs-tabbar-wrapper,
    .tk-tabs .mud-tabs-tabbar-content {
        justify-content: flex-end;
        margin-left: auto;
    }
    */

    .tk-tabs .mud-tabs-tabbar-inner {
        justify-content: flex-start !important;
    }

    .tk-tabs .mud-tab {
        text-transform: none;
        font-weight: 500;
        min-width: 0;
        padding: 10px 16px;
        color: #6b7280;
        flex: 0 0 auto;
    }

        .tk-tabs .mud-tab.mud-tab-active {
            color: #635bff;
        }

    .tk-tabs .mud-tab-slider {
        background: #635bff !important;
    }

/* Γενικά: 60% / 40% */
.tk-layout.tk-layout-6040 {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 16px;
    align-items: stretch; /* ήταν start */
}

/* Αριστερή κολώνα: γεμίζει όλο το ύψος */
/* Κάρτα: γεμίζει την κολώνα */
.tk-col-fill {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tk-card-fill {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

    .tk-card-fill > .tk-card-body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

        /* Τίτλος: φυσικό ύψος */
        .tk-card-fill > .tk-card-body > .mud-input-control:not(.tk-desc-fill) {
            flex: 0 0 auto;
            height: auto !important;
        }

/* Περιγραφή: ξεκινά αμέσως μετά και παίρνει όλο το υπόλοιπο ύψος */
.tk-desc-fill.mud-input-control {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    min-height: 0;
}

.tk-desc-fill .mud-input-control-input-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.tk-desc-fill .mud-input {
    flex: 1 1 auto;
    align-items: stretch;
}

.tk-desc-fill textarea.mud-input-slot {
    flex: 1 1 auto;
    height: 100% !important;
    min-height: 160px;
    resize: none;
}
@media (max-width: 960px) {
    .tk-layout.tk-layout-6040 {
        grid-template-columns: 1fr;
    }
}

/* Πίνακας */
.tk-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.tk-table th { text-align: left; font-weight: 500; color: var(--tk-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--tk-border); background: #fcfcfd; }
.tk-table td { padding: 11px 12px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tk-table tr.tk-row { cursor: pointer; }
.tk-table tr.tk-row:hover td { background: #fafaff; }
.tk-table .tk-t { font-weight: 500; max-width: 420px; }
.tk-empty { padding: 48px 16px; text-align: center; color: var(--tk-muted); }

/* Pills */
.tk-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 500; white-space: nowrap; }
.tk-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tk-open { background: #e8f1ff; color: #2563eb; }
.tk-prog { background: #fff4e5; color: #c2410c; }
.tk-res { background: #e7f8ef; color: #15803d; }
.tk-closed { background: #f1f2f4; color: #4b5563; }
.tk-missed { background: #fdecec; color: #b91c1c; }

.tk-prio { font-size: .78rem; font-weight: 500; }
.tk-p-urgent { color: #b91c1c; }
.tk-p-high { color: #c2410c; }
.tk-p-normal { color: var(--tk-muted); }
.tk-p-low { color: #9ca3af; }

.tk-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tk-accent-soft); color: var(--tk-accent); font-size: .7rem; font-weight: 700; text-transform: uppercase; margin-right: 6px; }

/* Καρτέλα */
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tk-layout { grid-template-columns: 1fr; } }
.tk-desc { white-space: pre-wrap; line-height: 1.55; font-size: .92rem; }

.tk-thread { display: flex; flex-direction: column; gap: 12px; }
.tk-msg { border: 1px solid var(--tk-border); border-radius: var(--tk-radius); background: #fff; }
.tk-msg.internal { background: #fffbeb; border-color: #fde68a; }
.tk-msg-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-bottom: 1px solid #f0f1f3; font-size: .82rem; }
.tk-msg.internal .tk-msg-head { border-bottom-color: #fde68a; }
.tk-msg-body { padding: 12px 14px; white-space: pre-wrap; line-height: 1.55; font-size: .9rem; }
.tk-tag { font-size: .7rem; padding: 1px 7px; border-radius: 4px; background: #fef3c7; color: #92400e; font-weight: 600; }

.tk-composer { border: 1px solid var(--tk-border); border-radius: var(--tk-radius); background: #fff; }
.tk-composer.internal { border-color: #fde68a; background: #fffdf5; }
.tk-composer-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid #f0f1f3; flex-wrap: wrap; }

.tk-props { display: grid; gap: 12px; }
.tk-prop-label { font-size: .75rem; color: var(--tk-muted); margin-bottom: 2px; }

.tk-files { display: flex; flex-direction: column; gap: 6px; }
.tk-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #f0f1f3; border-radius: 8px; font-size: .84rem; }
.tk-file:hover { background: var(--tk-bg-soft); }
.tk-file a, .tk-link { color: var(--tk-accent); cursor: pointer; text-decoration: none; }
.tk-file a:hover, .tk-link:hover { text-decoration: underline; }

.tk-timeline { list-style: none; margin: 0; padding: 0; }
.tk-timeline li { position: relative; padding: 0 0 12px 18px; font-size: .82rem; }
.tk-timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: #c7c9d1; }
.tk-timeline li::after { content: ""; position: absolute; left: 7px; top: 15px; bottom: 0; width: 1px; background: #e6e8eb; }
.tk-timeline li:last-child::after { display: none; }
/* ── Timeline (εναλλάξ αριστερά / δεξιά) ─────────────────── */
.tl2 {
    position: relative;
    padding: 8px 0;
}

    .tl2::before { /* κεντρική γραμμή */
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 3px;
        transform: translateX(-50%);
        background: #e5e7eb;
        border-radius: 3px;
    }

.tl2-item {
    --tl-c: #9ca3af;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    padding-bottom: 26px;
}

    .tl2-item:last-child {
        padding-bottom: 0;
    }

    .tl2-item > * {
        grid-row: 1;
    }

.tl2-left .tl2-side {
    grid-column: 1;
    text-align: left;
}

.tl2-left .tl2-spacer {
    grid-column: 3;
}

.tl2-right .tl2-side {
    grid-column: 3;
    text-align: right;
}

.tl2-right .tl2-spacer {
    grid-column: 1;
}

.tl2-node {
    grid-column: 2;
}

/* κύκλος με αριθμό */
.tl2-node {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

    .tl2-node span {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        border: 3px solid var(--tl-c);
        color: var(--tl-c);
        font-weight: 800;
        font-size: 1.05rem;
        box-shadow: 0 0 0 5px #fff, 0 2px 6px rgba(16,24,40,.08);
    }

/* ετικέτα + διακεκομμένη γραμμή προς τον κύκλο */
.tl2-head {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.tl2-right .tl2-head {
    flex-direction: row-reverse;
}

.tl2-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: .74rem;
    font-weight: 600;
    color: var(--tl-c);
    background: color-mix(in srgb, var(--tl-c) 14%, #fff);
    border: 1px solid color-mix(in srgb, var(--tl-c) 45%, #fff);
}

.tl2-dash {
    flex: 1 1 auto;
    min-width: 16px;
    height: 0;
    border-top: 2px dashed color-mix(in srgb, var(--tl-c) 55%, #fff);
    margin: 0 4px;
}

.tl2-date {
    margin-top: 8px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--tl-c);
}

    .tl2-date small {
        font-weight: 600;
        font-size: .75rem;
        opacity: .8;
        margin-left: 4px;
    }

.tl2-msg {
    margin-top: 4px;
    font-size: .86rem;
    line-height: 1.45;
    color: #374151;
    word-break: break-word;
}

.tl2-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: #6b7280;
    flex-wrap: wrap;
}

.tl2-right .tl2-meta {
    justify-content: flex-end;
}

/* χρώματα ανά είδος */
.tl-c-create {
    --tl-c: #f59e0b;
}

.tl-c-status {
    --tl-c: #635bff;
}

.tl-c-assign {
    --tl-c: #0ea5e9;
}

.tl-c-file {
    --tl-c: #84cc16;
}

.tl-c-comment {
    --tl-c: #a855f7;
}

.tl-c-priority {
    --tl-c: #ef4444;
}

.tl-c-call {
    --tl-c: #14b8a6;
}

.tl-c-delete {
    --tl-c: #e11d48;
}

.tl-c-default {
    --tl-c: #ec4899;
}

/* κινητό: όλα σε μία πλευρά */
@media (max-width: 760px) {
    .tl2::before {
        left: 22px;
        transform: none;
    }

    .tl2-item {
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 10px;
    }

    .tl2-node {
        grid-column: 1 !important;
    }

    .tl2-side {
        grid-column: 2 !important;
        text-align: left !important;
    }

    .tl2-spacer {
        display: none;
    }

    .tl2-right .tl2-head {
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    .tl2-right .tl2-meta {
        justify-content: flex-start;
    }
}
/* Popup εισερχόμενης κλήσης */
.tk-call-stack { position: fixed; right: 20px; bottom: 20px; z-index: 1600; display: flex; flex-direction: column; gap: 10px; width: 340px; }
.tk-call { background: #fff; border: 1px solid var(--tk-border); border-radius: 12px; box-shadow: 0 12px 32px rgba(26, 31, 54, .18); overflow: hidden; animation: tk-in .18s ease-out; }
.tk-call-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.tk-call-ico { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--tk-accent-soft); color: var(--tk-accent); }
.tk-call.ringing .tk-call-ico { animation: tk-ring 1.2s infinite; }
.tk-call-num { font-weight: 600; font-size: .95rem; }
.tk-call-body { padding: 0 14px 10px; font-size: .82rem; }
.tk-call-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid #f0f1f3; background: #fcfcfd; }
@keyframes tk-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tk-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(99, 91, 255, .45); } 50% { box-shadow: 0 0 0 8px rgba(99, 91, 255, 0); } }

/* Λίστα αιτημάτων: ταξινόμηση, φίλτρα στηλών, επιλογή */
.tk-table th.tk-sort {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

    .tk-table th.tk-sort:hover {
        color: var(--tk-text);
    }

    .tk-table th.tk-sort.on {
        color: var(--tk-accent);
    }

.tk-sort-ico {
    font-size: .95rem !important;
    vertical-align: -3px;
    margin-left: 2px;
}

.tk-sort-n {
    font-size: .65rem;
    font-weight: 700;
    margin-left: 1px;
    vertical-align: 1px;
}

.tk-table tr.tk-filter th {
    padding: 6px 8px;
    background: #fff;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.tk-table tr.tk-filter .mud-input-control {
    margin: 0;
}

.tk-table .tk-chk {
    width: 44px;
    padding-left: 8px;
    padding-right: 0;
}

.tk-table tr.tk-row.sel td {
    background: #f5f4ff;
}

.tk-bulk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--tk-accent-soft);
    color: var(--tk-accent);
    border-bottom: 1px solid var(--tk-border);
    font-size: .85rem;
}

/* ── Timeline τύπου Roadmap ───────────────────────────────── */
.rm {
    --rm-accent: #635bff; /* κύκλοι + τίτλοι */
    --rm-dot: #f59e0b; /* πορτοκαλί κουκκίδες */
    --rm-line: #635bff; /* διακεκομμένη καμπύλη */
    --rm-num: 56px; /* διάμετρος κύκλου */
    --rm-bulge: 44px; /* πόσο «φουσκώνει» η καμπύλη */
    --rm-gap: 30px; /* απόσταση μεταξύ εγγραφών */
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: 8px 0;
}

.rm-item {
    --tl-c: #9ca3af;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(var(--rm-num) + 2 * var(--rm-bulge)) minmax(0, 1fr);
    column-gap: 14px;
    padding-bottom: var(--rm-gap);
    min-height: calc(var(--rm-num) + 24px);
}

    .rm-item > .rm-side, .rm-item > .rm-node, .rm-item > .rm-spacer {
        grid-row: 1;
    }

.rm-node {
    grid-column: 2;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.rm-text-right .rm-side {
    grid-column: 3;
}

.rm-text-right .rm-spacer {
    grid-column: 1;
}

.rm-text-left .rm-side {
    grid-column: 1;
    text-align: right;
}

.rm-text-left .rm-spacer {
    grid-column: 3;
}

/* κύκλος με αριθμό */
.rm-num {
    width: var(--rm-num);
    height: var(--rm-num);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rm-accent);
    color: #fff;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: .02em;
    box-shadow: 0 0 0 5px #fff, 0 6px 14px color-mix(in srgb, var(--rm-accent) 35%, transparent);
}

/* διακεκομμένη καμπύλη προς τον επόμενο κύκλο — εναλλάξ πλευρά */
.rm-curve {
    position: absolute;
    z-index: 1;
    top: calc(var(--rm-num) / 2);
    bottom: calc(var(--rm-num) / -2);
    width: calc(var(--rm-num) / 2 + var(--rm-bulge));
    border: 2px dashed var(--rm-line);
    pointer-events: none;
}

.rm-text-right .rm-curve { /* κείμενο δεξιά → καμπύλη αριστερά */
    right: 50%;
    border-right: 0;
    border-radius: 999px 0 0 999px;
}

.rm-text-left .rm-curve { /* κείμενο αριστερά → καμπύλη δεξιά */
    left: 50%;
    border-left: 0;
    border-radius: 0 999px 999px 0;
}

.rm-item:last-child .rm-curve {
    display: none;
}

.rm-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--rm-dot);
    box-shadow: 0 0 0 4px #fff;
    transform: translateY(-50%);
}

.rm-text-right .rm-dot {
    left: -8px;
}

.rm-text-left .rm-dot {
    right: -8px;
}

/* κείμενο */
.rm-side {
    padding-top: 4px;
    min-width: 0;
}

.rm-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: .98rem;
    color: var(--rm-accent);
}

.rm-text-left .rm-title {
    flex-direction: row-reverse;
}

.rm-kind-icon {
    font-size: 16px !important;
    color: var(--tl-c);
}

.rm-date {
    margin-top: 2px;
    font-size: .74rem;
    color: #9ca3af;
}

.rm-msg {
    margin-top: 6px;
    font-size: .86rem;
    line-height: 1.5;
    color: #374151;
    word-break: break-word;
}

.rm-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .74rem;
    color: #6b7280;
}

.rm-text-left .rm-meta {
    justify-content: flex-end;
}

/* χρώματα εικονιδίου ανά είδος */
.tl-c-create {
    --tl-c: #16a34a;
}

.tl-c-status {
    --tl-c: #635bff;
}

.tl-c-assign {
    --tl-c: #0ea5e9;
}

.tl-c-file {
    --tl-c: #f59e0b;
}

.tl-c-comment {
    --tl-c: #a855f7;
}

.tl-c-priority {
    --tl-c: #ef4444;
}

.tl-c-call {
    --tl-c: #14b8a6;
}

.tl-c-delete {
    --tl-c: #e11d48;
}

.tl-c-default {
    --tl-c: #9ca3af;
}

/* κινητό: κύκλοι αριστερά, ίσια διακεκομμένη γραμμή */
@media (max-width: 760px) {
    .rm-item {
        grid-template-columns: var(--rm-num) minmax(0, 1fr);
    }

    .rm-node {
        grid-column: 1 !important;
    }

    .rm-side {
        grid-column: 2 !important;
        text-align: left !important;
    }

    .rm-spacer, .rm-dot {
        display: none;
    }

    .rm-text-left .rm-title {
        flex-direction: row;
    }

    .rm-text-left .rm-meta {
        justify-content: flex-start;
    }

    .rm-curve {
        left: calc(var(--rm-num) / 2) !important;
        right: auto !important;
        width: 0;
        border: 0 !important;
        border-left: 2px dashed var(--rm-line) !important;
        border-radius: 0 !important;
    }
}


/* Tabs / chips φίλτρων */
.tk-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--tk-border); flex-wrap: wrap; align-items: center; }

    .tk-tabs > button.tk-tab {
        -webkit-appearance: none;
        appearance: none;
        border: 0;
        box-shadow: none;
        outline: none;
        margin: 0;
        background: transparent;
        padding: 6px 12px;
        border-radius: 999px;
        font: inherit;
        font-size: .85rem;
        line-height: 1.4;
        text-transform: none;
        color: var(--tk-muted);
        cursor: pointer;
        white-space: nowrap;
        transition: background .15s, color .15s;
    }

        .tk-tabs > button.tk-tab:hover {
            background: var(--tk-bg-soft);
            color: var(--tk-text);
        }

        .tk-tabs > button.tk-tab.on {
            background: var(--tk-accent-soft);
            color: var(--tk-accent);
            font-weight: 600;
        }

        .tk-tabs > button.tk-tab:focus-visible {
            box-shadow: 0 0 0 2px var(--tk-accent-soft);
        }