/* =============================================
   TK Dashboard — mobile-first
   ============================================= */

#tk-dashboard {
    max-width: 860px;
    margin: 0 auto;
    padding: 16px;
    font-family: inherit;
}

/* ── Stats ─────────────────────────────────── */
.tk-dash-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.tk-dash-stat-wide {
    grid-column: 1 / -1;
}

@media (min-width: 600px) {
    .tk-dash-stats {
        grid-template-columns: repeat(5, 1fr);
    }
    .tk-dash-stat-wide {
        grid-column: auto;
    }
}

.tk-dash-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
}

.tk-dash-stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d1b2a;
    line-height: 1.1;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 400px) {
    .tk-dash-stat-val { font-size: 1.1rem; }
}

.tk-dash-stat-val.tk-dash-stat-green { color: #15803d; }
.tk-dash-stat-val.tk-dash-stat-warn  { color: #b45309; }

.tk-dash-stat-lbl {
    font-size: .72rem;
    color: #6b7280;
    line-height: 1.2;
}

/* ── Filter tabs ───────────────────────────── */
.tk-dash-filters {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    margin-bottom: 16px;
}
.tk-dash-filters::-webkit-scrollbar { display: none; }

.tk-f {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: .82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, color .15s;
}

.tk-f:hover  { border-color: #0d1b2a; color: #0d1b2a; }
.tk-f.active { background: #0d1b2a; border-color: #0d1b2a; color: #fff; }

/* ── Loading / empty ───────────────────────── */
.tk-dash-loading {
    text-align: center;
    padding: 48px 0;
    color: #9ca3af;
    font-size: .9rem;
}

.tk-dash-empty {
    text-align: center;
    padding: 40px 0;
    color: #9ca3af;
    font-size: .9rem;
}

/* ── Order card ────────────────────────────── */
.tk-dash-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow .2s, opacity .2s;
}

.tk-dash-card:hover    { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.tk-dash-card.tk-dash-busy   { opacity: .6; pointer-events: none; }
.tk-dash-card.tk-dash-flash  { background: #f0fdf4; transition: background 1s; }

.tk-dash-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
    gap: 8px;
}

.tk-dash-order-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.tk-dash-num {
    font-weight: 700;
    font-size: .9rem;
    color: #0d1b2a;
    white-space: nowrap;
}

.tk-dash-name {
    font-size: .88rem;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tk-dash-city {
    color: #9ca3af;
    font-size: .8rem;
}

.tk-dash-badge {
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.tk-dash-card-mid {
    padding: 0 14px 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.tk-dash-total {
    font-size: 1rem;
    font-weight: 700;
    color: #0d1b2a;
}

.tk-dash-sub {
    font-size: .78rem;
    color: #6b7280;
}

.tk-dash-date {
    font-size: .75rem;
    color: #9ca3af;
    width: 100%;
}

.tk-dash-note {
    padding: 0 14px 8px;
    font-size: .78rem;
    color: #374151;
    background: #fffbeb;
    border-top: 1px solid #fef3c7;
    padding-top: 7px;
}

/* ── Detail panel ──────────────────────────── */
.tk-dash-detail {
    border-top: 1px solid #f3f4f6;
    padding: 10px 14px;
    background: #fafafa;
}

.tk-dash-items {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}

.tk-dash-items li {
    font-size: .82rem;
    color: #374151;
    padding: 3px 0;
    display: flex;
    justify-content: space-between;
}

.tk-dash-items li span { color: #9ca3af; }

.tk-dash-addr {
    font-size: .78rem;
    color: #6b7280;
    margin-top: 4px;
}

/* ── Action row ────────────────────────────── */
.tk-dash-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
    flex-wrap: wrap;
}

.tk-dash-toggle {
    flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: .78rem;
    color: #374151;
    cursor: pointer;
    transition: border-color .15s;
    min-height: 34px;
}
.tk-dash-toggle:hover { border-color: #0d1b2a; }

.tk-dash-sel {
    flex: 1;
    min-width: 120px;
    border: 1.5px solid #e5e7eb;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: .78rem;
    color: #374151;
    background: #fff;
    cursor: pointer;
    min-height: 34px;
}

.tk-dash-wa {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #25d366;
    color: #fff;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: .78rem;
    text-decoration: none;
    min-height: 34px;
    transition: opacity .15s;
}
.tk-dash-wa:hover { opacity: .88; color: #fff; }

/* ── Load more ─────────────────────────────── */
#tk-dash-more {
    text-align: center;
    padding: 16px 0;
}

#tk-more-btn {
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 28px;
    font-size: .875rem;
    color: #374151;
    cursor: pointer;
    transition: border-color .15s;
}
#tk-more-btn:hover { border-color: #0d1b2a; }

/* ── Footer ────────────────────────────────── */
.tk-dash-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 32px;
    gap: 12px;
}

#tk-dash-ts {
    font-size: .75rem;
    color: #9ca3af;
}

#tk-dash-refresh {
    background: none;
    border: none;
    color: #6b7280;
    font-size: .8rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color .15s;
}
#tk-dash-refresh:hover { color: #0d1b2a; }

/* ── Admin nav link ────────────────────────── */
.tk-dash-nav-link > a.ct-menu-link {
    color: #b45309 !important;
    font-weight: 600 !important;
}
.tk-dash-nav-link > a.ct-menu-link:hover {
    color: #92400e !important;
}

/* ── Login gate ────────────────────────────── */
.tk-dash-login {
    text-align: center;
    padding: 60px 20px;
    color: #374151;
}

.tk-dash-login-btn {
    display: inline-block;
    margin-top: 16px;
    background: #0d1b2a;
    color: #fff;
    padding: 10px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-size: .9rem;
}
