/* ═══ CustomerTeams Page — Sidebar + Grid Layout ═══ */

.ct-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 80px);
    overflow: hidden;
}

.ct-header {
    flex-shrink: 0;
}

.ct-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Toolbar ── */
.ct-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: var(--mud-palette-surface);
    flex-wrap: wrap;
}

.ct-toolbar-left,
.ct-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Filter pills */
.ct-filter-pills {
    display: flex;
    gap: 4px;
}

.ct-pill {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.12);
    background: transparent;
    color: rgba(255,255,255,0.6);
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
}

.ct-pill:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
}

.ct-pill.active {
    background: var(--mud-palette-primary);
    color: #fff;
    border-color: var(--mud-palette-primary);
}

.ct-pill.active-green {
    background: var(--mud-palette-success);
    color: #fff;
    border-color: var(--mud-palette-success);
}

.ct-pill.active-gray {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.25);
}

/* ═══ MAIN BODY — Sidebar + Content ═══ */
.ct-body {
    flex: 1;
    display: flex;
    gap: 12px;
    overflow: hidden;
    min-height: 0;
}

/* ── Left Sidebar — Alliance List ── */
.ct-sidebar {
    width: 240px;
    min-width: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-right: 4px;
}

.ct-sidebar-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    padding: 8px 12px 6px;
}

.ct-alliance-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
    border: 1px solid transparent;
    user-select: none;
}

.ct-alliance-item:hover {
    background: rgba(255,255,255,0.05);
}

.ct-alliance-item.selected {
    background: rgba(var(--mud-palette-primary-rgb, 33,150,243), 0.15);
    border-color: rgba(var(--mud-palette-primary-rgb, 33,150,243), 0.3);
}

.ct-alliance-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    font-weight: 600;
}

.ct-alliance-icon.alliance {
    background: rgba(156, 39, 176, 0.18);
    color: #ce93d8;
}

.ct-alliance-icon.solo {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.45);
}

.ct-alliance-icon.all {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
}

.ct-alliance-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ct-alliance-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ct-alliance-count {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
}

.ct-sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 6px 12px;
}

/* ── Right Content — Cards Grid ── */
.ct-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    min-width: 0;
}

.ct-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 16px;
}

@media (max-width: 1400px) {
    .ct-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .ct-grid { grid-template-columns: 1fr; }
    .ct-sidebar { width: 200px; min-width: 200px; }
}
@media (max-width: 600px) {
    .ct-body { flex-direction: column; }
    .ct-sidebar { width: 100%; min-width: unset; max-height: 140px; flex-direction: row; flex-wrap: wrap; overflow-x: auto; overflow-y: hidden; }
    .ct-alliance-item { padding: 6px 10px; }
}

/* ── Team Card ── */
.ct-card {
    background: var(--mud-palette-surface);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 4px solid var(--mud-palette-primary);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    will-change: transform;
}

.ct-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.ct-card.inactive {
    border-left-color: rgba(255,255,255,0.2);
    opacity: 0.7;
}

/* Card header */
.ct-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ct-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.92);
}

.ct-card-code {
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    margin-left: 6px;
    font-family: 'Roboto Mono', monospace;
}

/* Badges */
.ct-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.ct-badge-active {
    background: rgba(76, 175, 80, 0.18);
    color: #66bb6a;
}

.ct-badge-inactive {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
}

.ct-badge-sub {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb74d;
}

.ct-badge-alliance {
    background: rgba(156, 39, 176, 0.15);
    color: #ce93d8;
}

.ct-badge-kh {
    background: rgba(33, 150, 243, 0.15);
    color: #64b5f6;
}

/* Tags row */
.ct-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

/* Description */
.ct-desc {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.45);
    margin-bottom: 6px;
    line-height: 1.3;
}

/* Info rows */
.ct-info {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ct-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

.ct-row-label {
    color: rgba(255,255,255,0.45);
}

.ct-row-val {
    font-weight: 600;
    color: rgba(255,255,255,0.85);
}

.ct-row-val.muted {
    font-weight: 400;
    color: rgba(255,255,255,0.35);
}

.ct-row-val.grp-on {
    color: #ffb74d;
}

/* Actions */
.ct-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.ct-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 6px;
    font-size: 0.76rem;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.7);
    transition: background 0.12s ease;
}

.ct-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

.ct-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.ct-btn-edit {
    color: var(--mud-palette-primary);
}

.ct-btn-sub {
    color: #ffb74d;
}

/* Empty state */
.ct-empty {
    text-align: center;
    padding: 48px 16px;
    color: rgba(255,255,255,0.3);
}

.ct-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.ct-empty-text {
    font-size: 0.9rem;
}

/* Content header (above grid) */
.ct-content-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 2px;
}

.ct-content-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
}

.ct-content-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
}
