/* ─── Base ─────────────────────────────────────────────────────────────────── */
body.team-body {
    background: #f0f2f8;
    color: #1f2937;
    min-width: 0;
}

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

/* ─── Layout shell ──────────────────────────────────────────────────────────── */
.team-shell {
    min-height: 100vh;
}

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
.team-sidebar {
    background: #0f172a;
    bottom: 0;
    color: #fff;
    display: flex;
    flex-direction: column;
    left: 0;
    padding: 20px 16px;
    position: fixed;
    top: 0;
    width: 248px;
    z-index: 1100;
}

.team-brand {
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 16px;
}

.team-brand img {
    max-height: 38px;
    max-width: 140px;
}

/* close button (mobile only, shown via media query) */
.team-sidebar-close {
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: none;
    height: 36px;
    justify-content: center;
    margin-left: auto;
    transition: background 0.15s;
    width: 36px;
}

.team-sidebar-close i {
    font-size: 18px;
    line-height: 1;
}

.team-sidebar-close:hover {
    background: rgba(255,255,255,0.22);
}

/* nav */
.team-nav {
    flex: 1;
}

.team-nav a {
    align-items: center;
    border-radius: 8px;
    color: rgba(255,255,255,0.68);
    display: flex;
    font-size: 14px;
    font-weight: 500;
    gap: 10px;
    margin-bottom: 4px;
    padding: 10px 12px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.team-nav a i {
    font-size: 20px;
    flex-shrink: 0;
}

.team-nav a.active,
.team-nav a:hover {
    background: #2563eb;
    color: #fff;
}

/* user info at sidebar bottom */
.team-sidebar-user {
    align-items: center;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px;
}

.team-sidebar-avatar {
    align-items: center;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
    color: rgba(255,255,255,0.8);
    display: inline-flex;
    flex-shrink: 0;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.team-sidebar-avatar i {
    font-size: 20px;
}

.team-sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.team-sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-sidebar-user-biz {
    color: rgba(255,255,255,0.48);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* mobile top bar */
.team-sidebar-backdrop,
.team-mobile-head {
    display: none;
}

.team-sidebar-toggle,
.team-mobile-logout {
    align-items: center;
    background: #f0f2f8;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #111827;
    cursor: pointer;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s;
    width: 38px;
}

.team-sidebar-toggle i,
.team-mobile-logout i {
    font-size: 20px;
}

.team-sidebar-toggle:hover,
.team-mobile-logout:hover {
    background: #e5e7eb;
}

/* ─── Main area ─────────────────────────────────────────────────────────────── */
.team-main {
    margin-left: 248px;
    min-height: 100vh;
}

.team-content {
    padding: 28px;
}

/* ─── Page head (replaces topbar) ──────────────────────────────────────────── */
.team-page-head {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    margin-bottom: 26px;
    padding-bottom: 16px;
}

.team-page-head h4 {
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
}

/* ─── Card ──────────────────────────────────────────────────────────────────── */
.team-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    padding: 22px;
}

/* ─── Stat cards ────────────────────────────────────────────────────────────── */
.team-stat {
    min-height: 130px;
}

.team-stat h3 {
    color: #111827;
    font-size: 30px;
    line-height: 1;
}

.team-stat-icon {
    align-items: center;
    background: #eff6ff;
    border-radius: 10px;
    color: #2563eb;
    display: inline-flex;
    height: 44px;
    justify-content: center;
    margin-bottom: 14px;
    width: 44px;
}

/* ─── Status grid ───────────────────────────────────────────────────────────── */
.team-status-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.team-status-card {
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    min-height: 90px;
    padding: 14px;
}

.team-status-card strong {
    color: #111827;
    display: block;
    font-size: 26px;
    line-height: 1;
    margin-bottom: 4px;
}

.team-status-card div > span {
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
}

.team-status-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.team-status-icon i {
    font-size: 22px;
}

.team-status-card.muted .team-status-icon { background: #f3f4f6; color: #4b5563; }
.team-status-card.info .team-status-icon  { background: #dbeafe; color: #1d4ed8; }
.team-status-card.success .team-status-icon { background: #dcfce7; color: #15803d; }
.team-status-card.danger .team-status-icon { background: #fee2e2; color: #b91c1c; }

.team-stat-row {
    row-gap: 14px;
}

/* ─── Chart ─────────────────────────────────────────────────────────────────── */
.team-chart-card {
    height: 100%;
}

.team-chart-bars {
    align-items: end;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(7, minmax(30px, 1fr));
    min-height: 210px;
}

.team-chart-day {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: end;
    min-width: 0;
}

.team-chart-count {
    color: #111827;
    font-size: 13px;
    font-weight: 700;
}

.team-chart-track {
    align-items: end;
    background: #eef2f7;
    border-radius: 999px;
    display: flex;
    height: 132px;
    justify-content: center;
    overflow: hidden;
    width: 100%;
}

.team-chart-bar {
    background: linear-gradient(180deg, #2563eb 0%, #11be86 100%);
    border-radius: 999px;
    min-height: 8px;
    width: 100%;
}

.team-chart-label {
    color: #6b7280;
    font-size: 11px;
    white-space: nowrap;
}

/* ─── Order cards (today's orders) ─────────────────────────────────────────── */
.team-order-list {
    display: grid;
    gap: 10px;
}

.team-order-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.team-order-card-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.team-order-card h6 {
    margin-bottom: 4px;
}

.team-order-code {
    color: #111827;
    font-weight: 800;
}

.team-order-sub {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.team-order-meta {
    color: #6b7280;
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 6px 12px;
}

/* ─── Status pills ──────────────────────────────────────────────────────────── */
.team-status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    white-space: nowrap;
}

.team-status-pill.success { background: #dcfce7; color: #15803d; }
.team-status-pill.info    { background: #dbeafe; color: #1d4ed8; }
.team-status-pill.warning { background: #fef3c7; color: #b45309; }
.team-status-pill.danger  { background: #fee2e2; color: #b91c1c; }
.team-status-pill.muted   { background: #f3f4f6; color: #4b5563; }

/* ─── Action buttons ────────────────────────────────────────────────────────── */
.team-copy-btn,
.team-link-btn {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.team-copy-btn {
    background: #111827;
    border: 0;
    color: #fff;
    gap: 6px;
}

.team-copy-btn:hover { opacity: 0.85; }

.team-copy-icon-btn {
    align-items: center;
    background: #111827;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 36px;
    justify-content: center;
    line-height: 1;
    transition: opacity 0.15s;
    width: 36px;
}

.team-copy-icon-btn:hover { opacity: 0.85; }

.team-copy-icon-btn:disabled,
.team-copy-icon-btn.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.team-link-btn {
    background: #eff6ff;
    color: #1d4ed8;
}

.team-link-btn:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

/* ─── Empty state ───────────────────────────────────────────────────────────── */
.team-empty-state {
    align-items: center;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    display: flex;
    justify-content: center;
    min-height: 118px;
    padding: 18px;
    text-align: center;
}

/* ─── Dashboard grid ────────────────────────────────────────────────────────── */
.team-dashboard-grid {
    align-items: stretch;
}

/* ─── Order search ──────────────────────────────────────────────────────────── */
.team-order-search {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    padding: 0 12px;
}

.team-order-search i {
    color: #6b7280;
    font-size: 18px;
}

.team-order-search input {
    background: transparent;
    border: 0;
    color: #111827;
    min-height: 44px;
    outline: 0;
    width: 100%;
}

/* ─── Orders table ──────────────────────────────────────────────────────────── */
.team-order-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.team-orders-table td {
    vertical-align: middle;
}

.team-copy-col {
    text-align: center;
    width: 56px;
}

/* ─── Pagination ────────────────────────────────────────────────────────────── */
.team-pagination {
    align-items: center;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
    padding-top: 16px;
}

.team-page-btn {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #1f2937;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    min-width: 36px;
    padding: 0 10px;
    text-decoration: none;
}

.team-page-btn.active {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.team-page-btn.disabled {
    color: #9ca3af;
    pointer-events: none;
}

.team-page-dots,
.team-page-info {
    color: #6b7280;
    font-size: 12px;
    font-weight: 700;
}

.team-page-info {
    margin-left: 4px;
}

/* ─── Create order form ─────────────────────────────────────────────────────── */
.team-form-section {
    margin-bottom: 20px;
}

.team-form-section h5 {
    align-items: center;
    color: #111827;
    display: flex;
    font-size: 15px;
    font-weight: 700;
    gap: 8px;
    margin-bottom: 18px;
}

.team-form-section h5 i {
    color: #2563eb;
    font-size: 20px;
}

.team-form-section input.form-control,
.team-form-section select.form-control,
.team-form-section textarea.form-control {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #111827;
    font-size: 14px;
    min-height: 44px;
    padding: 10px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
}

.team-form-section input.form-control:focus,
.team-form-section select.form-control:focus {
    background: #fff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
    outline: 0;
}

.team-form-section label {
    color: #374151;
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

/* ─── Description dropdown ──────────────────────────────────────────────────── */
.team-desc-wrap {
    position: relative;
}

.team-desc-dropdown {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    display: none;
    left: 0;
    max-height: 230px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 300;
}

.team-desc-dropdown.open {
    display: block;
}

.team-desc-option {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    color: #374151;
    cursor: pointer;
    display: block;
    font-size: 13px;
    padding: 10px 14px;
    text-align: left;
    transition: background 0.12s;
    width: 100%;
}

.team-desc-option:last-child {
    border-bottom: 0;
}

.team-desc-option:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* ─── Login page ────────────────────────────────────────────────────────────── */
.team-login {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.team-login-card {
    margin: 0 auto;
    max-width: 430px;
    width: 100%;
}

/* ─── Mobile nav bar ────────────────────────────────────────────────────────── */
.team-mobile-nav {
    display: none;
}

/* ─── Responsive: tablet / mobile ──────────────────────────────────────────── */
@media (max-width: 991px) {
    body.team-body {
        padding-bottom: 74px;
    }

    .team-sidebar {
        box-shadow: 24px 0 48px rgba(15, 23, 42, 0.28);
        display: flex;
        max-width: 86vw;
        transform: translateX(-110%);
        transition: transform 0.22s ease;
        width: 290px;
    }

    .team-menu-open .team-sidebar {
        transform: translateX(0);
    }

    .team-sidebar-close {
        display: inline-flex;
    }

    .team-sidebar-backdrop {
        background: rgba(15, 23, 42, 0.5);
        bottom: 0;
        display: block;
        left: 0;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 0;
        top: 0;
        transition: opacity 0.22s ease;
        z-index: 1090;
    }

    .team-menu-open .team-sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .team-mobile-head {
        align-items: center;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        left: 0;
        padding: 10px 14px;
        position: sticky;
        right: 0;
        top: 0;
        z-index: 900;
    }

    .team-mobile-head img {
        max-height: 32px;
        max-width: 128px;
    }

    .team-mobile-nav {
        background: #ffffff;
        border-top: 1px solid #e5e7eb;
        bottom: 0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
        display: grid;
        gap: 4px;
        grid-template-columns: repeat(3, 1fr);
        left: 0;
        padding: 8px 10px 10px;
        position: fixed;
        right: 0;
        z-index: 850;
    }

    .team-mobile-nav a {
        align-items: center;
        border-radius: 8px;
        color: #6b7280;
        display: flex;
        flex-direction: column;
        font-size: 11px;
        font-weight: 700;
        gap: 2px;
        justify-content: center;
        min-height: 48px;
        text-decoration: none;
    }

    .team-mobile-nav a i {
        font-size: 20px;
    }

    .team-mobile-nav a.active {
        background: #eff6ff;
        color: #1d4ed8;
    }

    .team-main {
        margin-left: 0;
    }

    .team-content {
        padding: 16px 14px;
    }

    .team-page-head {
        margin-bottom: 18px;
        padding-bottom: 12px;
    }

    .team-page-head h4 {
        font-size: 18px;
    }

    .team-stat {
        min-height: 110px;
    }

    .team-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-stat h3 {
        font-size: 26px;
    }

    .team-chart-card {
        margin-bottom: 16px;
    }

    .team-chart-bars {
        min-height: 180px;
    }

    .team-chart-track {
        height: 112px;
    }

    .team-order-card-head {
        flex-direction: column;
    }

    .team-order-card-actions {
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .team-orders-table thead {
        display: none;
    }

    .team-orders-table,
    .team-orders-table tbody,
    .team-orders-table tr,
    .team-orders-table td {
        display: block;
        width: 100%;
    }

    .team-orders-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 10px 12px;
    }

    .team-orders-table tr.team-empty-row {
        border: 0;
        padding: 0;
    }

    .team-orders-table td {
        align-items: flex-start;
        border: 0;
        display: flex;
        gap: 12px;
        justify-content: space-between;
        padding: 8px 0;
        text-align: right;
    }

    .team-orders-table td .team-order-actions,
    .team-orders-table td .team-order-code,
    .team-orders-table td .team-order-sub,
    .team-orders-table td .team-status-pill,
    .team-orders-table td .team-copy-icon-btn {
        margin-left: auto;
        max-width: calc(100% - 108px);
        text-align: right;
    }

    .team-orders-table td .team-order-actions {
        justify-content: flex-end;
    }

    .team-orders-table td::before {
        color: #6b7280;
        content: attr(data-label);
        flex: 0 0 96px;
        font-size: 12px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .team-orders-table .team-empty-row td {
        display: block;
        text-align: center;
    }

    .team-orders-table .team-empty-row td::before {
        content: none;
    }

    .team-copy-col {
        text-align: right;
        width: 100%;
    }

    .team-pagination {
        justify-content: center;
    }
}

@media (max-width: 575px) {
    .team-card {
        padding: 14px;
    }

    .team-content .btn {
        width: 100%;
    }

    .team-page-head h4 {
        font-size: 17px;
    }

    .team-stat-row > [class*="col-"] {
        width: 50%;
    }

    .team-chart-bars {
        gap: 6px;
        grid-template-columns: repeat(7, minmax(24px, 1fr));
    }

    .team-status-grid {
        grid-template-columns: 1fr;
    }

    .team-status-card {
        min-height: 76px;
    }

    .team-chart-label {
        font-size: 10px;
    }

    .team-form-section .col-4 {
        padding-left: 5px;
        padding-right: 5px;
    }

    .team-form-section label {
        font-size: 12px;
    }

    .team-copy-btn,
    .team-link-btn {
        width: 100%;
    }

    .team-page-info {
        flex: 0 0 100%;
        margin-left: 0;
        text-align: center;
    }
}
