/* Education360 — support tickets. Mobile first (390px), RTL-safe (logical properties), dark mode through the app's variables. */

/* ---------- shared */
[dir="rtl"] .flip-rtl{transform:scaleX(-1)}
.tk-ref{font:600 12.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--muted);letter-spacing:.02em;white-space:nowrap}
.tk-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:12.5px;color:var(--muted)}
.tk-meta>span{display:inline-flex;align-items:center;gap:4px}
.tk-meta .icon{width:13px;height:13px}
.tk-subject{font-weight:650;color:var(--text);line-height:1.35;overflow-wrap:anywhere;text-decoration:none}
a.tk-subject:hover{color:var(--brand)}
.tk-due .icon{width:13px;height:13px}
.badge.tk-due::before{display:none}
.tk-note-line{font-size:13px;color:var(--muted);display:flex;gap:8px;align-items:flex-start;margin:0}
.tk-note-line .icon{flex:none;margin-top:2px;width:15px;height:15px}
.tk-dot{width:8px;height:8px;margin-inline-end:4px;border-radius:50%;background:var(--brand);display:inline-block;flex:none;box-shadow:0 0 0 3px var(--brand-100)}
.tk-safe{--t:var(--red);--t-bg:var(--red-bg)}
.badge.tk-safe-badge{background:var(--red-bg);color:var(--red-ink)}

/* ---------- queue */
.tk-views{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 2px 12px;margin-bottom:4px}
.tk-views::-webkit-scrollbar{display:none}
.tk-views .chip{min-height:40px;white-space:nowrap}
.tk-views .chip .count{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 6px;border-radius:999px;background:var(--surface-3);font-size:11.5px;font-weight:700;color:var(--text-2)}
.tk-views .chip.active .count{background:rgba(255,255,255,.22);color:#fff}
.tk-views .chip.is-alert:not(.active){border-color:color-mix(in oklab,var(--red) 45%,var(--border));color:var(--red-ink)}
.tk-views .chip.is-alert:not(.active) .count{background:var(--red-bg);color:var(--red-ink)}
.tk-queue td{vertical-align:top}
.tk-queue .tk-cell{display:flex;gap:10px;align-items:flex-start;min-width:0}
.tk-queue .tk-cell>div{min-width:0}
.tk-queue tr.is-safe{box-shadow:inset 4px 0 0 var(--red)}
[dir="rtl"] .tk-queue tr.is-safe{box-shadow:inset -4px 0 0 var(--red)}
.tk-queue tr.is-closed .tk-subject{color:var(--muted)}
.tk-queue .tk-ico{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:none;background:var(--surface-3);color:var(--text-2)}
.tk-queue .tk-ico.tk-safe{background:var(--red-bg);color:var(--red)}
.tk-queue .tk-ico .icon{width:17px;height:17px}
.tk-bulk .input{min-height:36px;width:auto;max-width:100%}
.tk-bulk{flex-wrap:wrap}

/* ---------- conversation */
.tk-thread{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.tk-msg{display:flex;gap:12px;align-items:flex-start;scroll-margin-top:90px}
.tk-msg>.avatar{flex:none;margin-top:2px}
.tk-bubble{flex:1;min-width:0;border:1px solid var(--border);border-radius:14px;background:var(--surface);overflow:hidden}
.tk-bubble-head{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;padding:10px 14px;border-bottom:1px solid var(--border);background:var(--surface-2);font-size:13px}
.tk-bubble-head b{font-weight:650;color:var(--text)}
.tk-bubble-head time{color:var(--muted);font-size:12.5px}
.tk-bubble-head .grow{flex:1}
.tk-body{padding:12px 14px;white-space:normal;overflow-wrap:anywhere;line-height:1.65;color:var(--text-2)}
.tk-body a{overflow-wrap:anywhere}
.tk-msg.is-agent .tk-bubble{border-color:color-mix(in oklab,var(--brand) 30%,var(--border))}
.tk-msg.is-agent .tk-bubble-head{background:var(--brand-50)}
.tk-msg.is-note .tk-bubble{border-color:color-mix(in oklab,#e8b400 55%,var(--border));background:#fffbe6}
.tk-msg.is-note .tk-bubble-head{background:#fff3bf;border-bottom-color:color-mix(in oklab,#e8b400 40%,transparent)}
.tk-msg.is-note .tk-body{color:#5c4400}
[data-theme="dark"] .tk-msg.is-note .tk-bubble{background:rgba(250,200,40,.08);border-color:rgba(250,200,40,.35)}
[data-theme="dark"] .tk-msg.is-note .tk-bubble-head{background:rgba(250,200,40,.14);border-bottom-color:rgba(250,200,40,.25)}
[data-theme="dark"] .tk-msg.is-note .tk-body{color:#ffe8a3}
.tk-note-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;background:#ffe066;color:#5c4400;font-size:11.5px;font-weight:700}
.tk-note-tag .icon{width:12px;height:12px}
.tk-event{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);padding-inline-start:46px}
.tk-event .icon{width:14px;height:14px;flex:none}
.tk-event time{white-space:nowrap}
.tk-event.is-alert{color:var(--red-ink)}
.tk-files{list-style:none;margin:0;padding:0 14px 12px;display:flex;flex-wrap:wrap;gap:8px}
.tk-file{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:6px 10px 6px 6px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text-2);font-size:13px;text-decoration:none!important;min-height:44px}
[dir="rtl"] .tk-file{padding:6px 6px 6px 10px}
.tk-file:hover{border-color:var(--brand)}
.tk-file img{width:40px;height:40px;object-fit:cover;border-radius:7px;background:var(--surface-3)}
.tk-file .tk-file-ico{width:40px;height:40px;border-radius:7px;display:grid;place-items:center;background:var(--red-bg);color:var(--red)}
.tk-file span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:190px}
.tk-file small{color:var(--muted);display:block}

/* ---------- reply box */
.tk-composer{scroll-margin-top:80px}
.tk-composer .card-head{gap:10px}
.tk-kind{display:inline-flex;background:var(--surface-3);border-radius:10px;padding:3px;gap:2px}
.tk-kind label{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:0 12px;border-radius:8px;font-size:13.5px;font-weight:600;color:var(--muted);cursor:pointer}
.tk-kind input{position:absolute;opacity:0;pointer-events:none}
.tk-kind label:has(input:checked){background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}
.tk-kind label:has(input[value="note"]:checked){background:#ffe066;color:#5c4400}
.tk-kind label:has(input:focus-visible){box-shadow:var(--focus)}
.tk-composer.is-note{border-color:color-mix(in oklab,#e8b400 55%,var(--border))}
.tk-composer.is-note textarea.input{background:#fffbe6;border-color:color-mix(in oklab,#e8b400 60%,var(--input-border))}
[data-theme="dark"] .tk-composer.is-note textarea.input{background:rgba(250,200,40,.07)}
.tk-composer textarea.input{min-height:150px}
.tk-composer-foot{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:flex-end}
.tk-composer-foot .input{width:auto;min-height:44px}
.tk-composer-foot .grow{flex:1;min-width:0}
.tk-canned{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tk-canned select{min-height:40px;max-width:100%}
.tk-pick{display:flex;flex-direction:column;gap:6px}
.tk-pick-list{font-size:12.5px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px}
.tk-pick-list span{padding:2px 8px;border-radius:999px;background:var(--surface-3)}
.tk-pick-list span.is-bad{background:var(--red-bg);color:var(--red-ink)}
.tk-closed-note{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:12px;background:var(--surface-2);border:1px dashed var(--border-strong);font-size:13.5px;color:var(--text-2)}

/* ---------- side panel */
.tk-side{display:grid;gap:16px;align-content:start}
.tk-side .card+.card{margin-top:0}
.tk-side .card-body{padding:16px}
.tk-side .dl{grid-template-columns:minmax(90px,120px) 1fr}
.tk-side .dl dt,.tk-side .dl dd{padding:8px 0;font-size:13px}
.tk-ctx h4{font-size:13px;margin:14px 0 6px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;font-weight:700}
.tk-ctx h4:first-child{margin-top:0}
.tk-ctx ul{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.tk-ctx li{display:flex;justify-content:space-between;gap:8px;font-size:13px;align-items:baseline;min-width:0}
.tk-ctx li>a,.tk-ctx li>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.tk-ctx li .badge{flex:none}
.tk-who{display:flex;gap:10px;align-items:center;margin-bottom:10px}
.tk-who b{display:block;font-weight:650}
.tk-who span{font-size:12.5px;color:var(--muted);overflow-wrap:anywhere}
.tk-sla{display:flex;flex-direction:column;gap:6px;font-size:13px}
.tk-sla .badge{align-self:flex-start}
.tk-record{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:12px;background:var(--surface-2);border:1px solid var(--border);text-decoration:none!important;color:inherit;font-size:13.5px}
.tk-record:hover{border-color:var(--brand)}
.tk-record small{display:block;color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:700}

/* ---------- the requester's pages */
.tk-list{list-style:none;margin:0;padding:0}
.tk-item{display:flex;gap:12px;align-items:center;padding:14px 18px;border-bottom:1px solid var(--border);text-decoration:none!important;color:inherit;min-height:64px}
.tk-item:last-child{border-bottom:0}
.tk-item:hover{background:var(--surface-2)}
.tk-item .grow{flex:1;min-width:0}
.tk-item .stat-icon{width:40px;height:40px;border-radius:12px}
.tk-item .stat-icon .icon{width:19px;height:19px}
.tk-ways{display:grid;gap:8px}
.tk-way{display:flex;gap:12px;align-items:center;padding:10px 12px;border-radius:12px;border:1px solid var(--border);text-decoration:none!important;color:inherit;min-height:48px}
.tk-way:hover{border-color:var(--brand)}
.tk-way .stat-icon{width:36px;height:36px;border-radius:10px}
.tk-way small{display:block;color:var(--muted);font-size:12px}
.tk-way b{font-weight:600;overflow-wrap:anywhere}
.tk-rate{display:flex;flex-direction:row-reverse;justify-content:flex-end;gap:6px}
[dir="rtl"] .tk-rate{justify-content:flex-end}
.tk-rate input{position:absolute;opacity:0;pointer-events:none}
.tk-rate label{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;color:var(--faint);transition:transform .12s,color .12s,background .12s}
.tk-rate label .icon{width:24px;height:24px}
.tk-rate label:hover,.tk-rate label:hover~label,.tk-rate input:checked~label{color:#f59f00;background:color-mix(in oklab,#f59f00 12%,var(--surface));border-color:color-mix(in oklab,#f59f00 50%,var(--border))}
.tk-rate label:hover .icon,.tk-rate label:hover~label .icon,.tk-rate input:checked~label .icon{fill:currentColor}
.tk-rate input:focus-visible+label{box-shadow:var(--focus)}
.tk-rate-scale{display:flex;justify-content:space-between;max-width:268px;font-size:12px;color:var(--muted);margin-top:4px}
.tk-stars{display:inline-flex;gap:2px;color:#f59f00}
.tk-stars .icon{width:15px;height:15px}
.tk-stars .icon.on{fill:currentColor}
.tk-stars .icon.off{color:var(--faint)}
.tk-sticky-send{position:sticky;bottom:var(--bottom-nav-h,0px);z-index:5;background:color-mix(in oklab,var(--surface) 92%,transparent);backdrop-filter:blur(8px);border-top:1px solid var(--border);padding:12px 16px;display:flex;gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap;border-radius:0 0 var(--radius-lg) var(--radius-lg)}
.tk-about{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:14px}

/* ---------- dashboard */
.tk-minis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tk-mini{display:flex;flex-direction:column;gap:8px;padding:12px;border-radius:14px;border:1px solid var(--border);background:var(--surface-2);text-decoration:none!important;color:inherit;min-width:0}
.tk-mini:hover{border-color:var(--brand)}
.tk-mini .stat-icon{width:34px;height:34px;border-radius:10px}
.tk-mini .stat-icon .icon{width:17px;height:17px}
.tk-mini b{display:block;font:750 1.45rem/1.1 var(--font-display);color:var(--text)}
.tk-mini span>span{font-size:12.5px;color:var(--muted);font-weight:600}
.tk-mini small{display:block;font-size:11.5px;color:var(--muted);margin-top:2px}
.tk-mini.is-alert{border-color:color-mix(in oklab,var(--red) 45%,var(--border));background:var(--red-bg)}
.tk-mini.is-alert b{color:var(--red-ink)}

/* ---------- settings and reports */
.tk-days{display:flex;flex-wrap:wrap;gap:8px}
.tk-days .radio-pill{min-height:44px}
.tk-inlog td{font-size:13px}
.tk-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;margin-bottom:18px}
.tk-range{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
.tk-range .field{margin:0}
.tk-range .input{min-height:44px}
.tk-bar{height:8px;border-radius:999px;background:var(--surface-3);overflow:hidden;min-width:60px}
.tk-bar>i{display:block;height:100%;background:var(--brand);border-radius:inherit}
.tk-sections{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}

/* ---------- a visitor's private page (auth layout, no app chrome) */
.tk-guest{min-height:100vh;min-height:100dvh;background:var(--bg)}
.tk-guest-top{background:var(--surface);border-bottom:1px solid var(--border)}
.tk-guest-top .tk-wrap{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px}
.tk-brand{display:flex;align-items:center;gap:10px;font:800 17px/1.1 var(--font-display);color:var(--text);text-decoration:none!important}
.tk-brand .brand-logo{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--brand);color:#fff;font-size:14px;overflow:hidden}
.tk-brand .brand-logo img{width:100%;height:100%;object-fit:cover}
.tk-wrap{width:100%;max-width:820px;margin-inline:auto;padding-inline:16px}
.tk-guest main{padding-block:22px 48px}
.tk-guest .tk-sticky-send{bottom:0}
.tk-guest h1{font-size:1.45rem;margin:0 0 6px;overflow-wrap:anywhere}
.tk-guest .card{margin-top:16px}
.tk-private{display:flex;gap:10px;align-items:flex-start;font-size:12.5px;color:var(--muted);margin-top:18px}
.tk-private .icon{flex:none;width:15px;height:15px;margin-top:2px}

/* ---------- the public Contact page (site layout) */
.tk-contact{padding:28px 0 72px}
.tk-contact-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);gap:clamp(18px,3vw,32px);align-items:start}
.tk-contact .e3-form-card h2{font-size:20px}
.tk-contact .form-grid{row-gap:10px}
.tk-contact-side{display:grid;gap:14px}
.tk-contact-card{display:flex;gap:14px;align-items:center;padding:16px 18px;border-radius:18px;background:#fff;border:1px solid var(--s-line,#e4e8f0);text-decoration:none!important;color:inherit;min-height:64px;transition:border-color .15s,transform .15s}
a.tk-contact-card:hover{border-color:var(--brand);transform:translateY(-2px)}
.tk-contact-card .stat-icon{width:46px;height:46px;border-radius:14px}
.tk-contact-card small{display:block;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--s-muted,#64748b)}
.tk-contact-card b{display:block;font-weight:700;overflow-wrap:anywhere}
.tk-contact-note{padding:16px 18px;border-radius:18px;background:var(--s-soft,#f6f8fb);border:1px solid var(--s-line,#e4e8f0);font-size:14px;color:var(--s-muted,#64748b)}
.tk-contact-note b{color:var(--s-text,#0f172a)}

@media (max-width:900px){
  .tk-contact-grid{grid-template-columns:1fr}
  .tk-contact-side{order:-1}
}
@media (max-width:640px){
  .tk-minis{grid-template-columns:1fr 1fr 1fr;gap:8px}
  .tk-mini{padding:10px}
  .tk-mini small{display:none}
  .tk-msg>.avatar{display:none}
  .tk-event{padding-inline-start:4px}
  .tk-composer-foot{justify-content:stretch}
  .tk-composer-foot .btn,.tk-composer-foot .input{flex:1 1 100%}
  .tk-rate label{width:44px;height:44px}
  .tk-queue .tk-ico{display:none}
  .tk-queue tr{position:relative}
  .tk-queue td.check-col{position:absolute;inset-inline-end:14px;top:12px;padding:0}
  .tk-queue td.check-col input{width:22px;height:22px}
  .tk-queue td.cell-first{padding-inline-end:40px}
  .tk-file span{max-width:150px}
  .tk-item{flex-wrap:wrap;row-gap:8px}
  .tk-item .grow{flex:1 1 calc(100% - 52px)}
  .tk-item>.badge{margin-inline-start:52px}
}
@media print{.tk-composer,.tk-side form,.tk-views,.toolbar{display:none!important}}
