/* Team Balance / captain credit codes — shared profile + admin */

.credits-intro {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
}

.credits-intro .credits-intro-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0c4a6e;
}

.credits-intro p:last-child {
    margin: 0;
}

.credits-section {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    min-width: 0;
    box-sizing: border-box;
}

.credits-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: #2d3748;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.credits-create .credits-name {
    display: block;
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Lexend Peta', sans-serif;
    font-size: 0.95rem;
    color: #2d3748;
    background: #f8fafc;
    box-sizing: border-box;
}

.credits-create .credits-name:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
}

.credits-create-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.credits-subtab {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #718096;
    font-family: 'Lexend Peta', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credits-subtab:hover {
    border-color: #4299e1;
    color: #4299e1;
    background: #ebf8ff;
}

.credits-subtab.active {
    border-color: #2b6cb0;
    background: #4299e1;
    color: white;
}

.credits-calculator-box {
    margin-bottom: 1rem;
}

.credits-fixed-box {
    display: none;
    margin-bottom: 1rem;
}

.credits-fixed-box .credits-fixed-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.credits-fixed-amount {
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: 'Lexend Peta', sans-serif;
    font-size: 1rem;
    width: 160px;
    max-width: 100%;
    background: #f8fafc;
    box-sizing: border-box;
}

.credits-fixed-amount:focus {
    outline: none;
    border-color: #4299e1;
    background: white;
}

.credits-calc-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.credits-calc-row:last-of-type {
    border-bottom: none;
}

.credits-calc-label {
    min-width: 80px;
    font-weight: 600;
    color: #4a5568;
}

.credits-calc-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #4a5568;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.credits-calc-btn:hover {
    border-color: #4299e1;
    background: #ebf8ff;
    color: #2b6cb0;
}

.credits-calc-count {
    width: 70px;
    padding: 0.4rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Lexend Peta', sans-serif;
    font-size: 0.95rem;
    text-align: center;
    box-sizing: border-box;
}

.credits-calc-line-total {
    margin-left: auto;
    font-weight: 600;
    color: #2d3748;
}

.credits-calculator-total {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 2px solid #e2e8f0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
}

.credits-continue-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #4299e1;
    color: white;
    font-family: 'Lexend Peta', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credits-continue-btn:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.credits-continue-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.credits-loading,
.credits-empty,
.credits-err {
    color: #718096;
    padding: 0.5rem 0;
}

.credits-err {
    color: #e53e3e;
}

.credits-total-balance {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.credits-code-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.credits-code {
    font-family: monospace;
    font-size: 0.95rem;
    user-select: all;
    padding: 0.25rem 0.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    color: #2d3748;
}

.credits-code-sm {
    font-size: 0.85em;
}

.credits-copy-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #4299e1;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.credits-copy-btn:hover {
    background: #3182ce;
}

.credits-history-inner {
    width: 100%;
    min-width: 0;
}

.credits-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

.credits-usage-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: #fafafa;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    min-width: 0;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.credits-usage-card:hover {
    border-color: rgba(66, 153, 225, 0.35);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.credits-usage-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.credits-usage-card__player {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    line-height: 1.35;
    word-break: break-word;
}

.credits-usage-card__amount {
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2b6cb0;
}

.credits-usage-card__what {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.45;
    word-break: break-word;
}

.credits-usage-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.credits-usage-card__time {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.3;
}

.credits-usage-card .credits-refund-btn {
    align-self: flex-start;
    margin-top: 0.15rem;
}

.credits-refund-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.credits-panel-root,
.v2-credits-panel,
#credits-panel.credits-panel-root {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 2rem;
}

/* Admin team manage — neutralize global View.Team input/button rules */
.page .Tournaments .View.Team .credits-panel-root input,
.page .Tournaments .View.Team .v2-credits-panel input,
.page .Tournaments .View.Team #credits-panel input {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.95rem;
    padding: 0.4rem 0.5rem;
}

.page .Tournaments .View.Team .credits-panel-root .credits-name,
.page .Tournaments .View.Team .credits-panel-root .credits-fixed-amount {
    padding: 0.75rem 1rem;
}

.page .Tournaments .View.Team .credits-panel-root .credits-calc-count {
    width: 70px;
    padding: 0.4rem 0.5rem;
    text-align: center;
}

.page .Tournaments .View.Team .credits-panel-root button {
    width: auto;
    margin: 0;
    box-shadow: none;
}

.page .Tournaments .View.Team .credits-panel-root .credits-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
}

.page .Tournaments .View.Team .credits-panel-root .credits-calc-row,
.page .Tournaments .View.Team .credits-panel-root .credits-code-row,
.page .Tournaments .View.Team .credits-panel-root .credits-create-tabs {
    display: flex;
    flex-wrap: wrap;
}

.page .Tournaments .View.Team .credits-panel-root .credits-history-grid {
    display: grid;
    width: 100%;
}

.page .Tournaments .View.Team .credits-panel-root .credits-list-inner,
.page .Tournaments .View.Team .credits-panel-root .credits-history-inner,
.page .Tournaments .View.Team .credits-panel-root .credits-calculator-box {
    display: block;
    width: 100%;
}

.page .Tournaments .View.Team .main-view .credits-panel-root {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
}
