/* ===== SETTINGS & ACCESS ===== */
.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.settings-section .desc-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.settings-select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.2rem;
}

.settings-select:focus {
    border-color: var(--accent);
}

.settings-select option {
    background: var(--surface);
    color: var(--text);
}

.settings-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-weight: 600;
}

.settings-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.settings-row .input-group {
    flex: 1;
}

.settings-row:last-child {
    margin-bottom: 0;
}

.save-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
}

.save-bar-inline {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
}

.save-status {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.save-status.dirty {
    color: var(--accent);
    font-weight: 600;
}

/* --- Dashboard Sessions --- */
.session-list {
    display: grid;
    gap: 0.5rem;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.session-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.session-meta,
.session-muted,
.session-empty {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.session-badge {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--green);
    border-radius: 6px;
    padding: 0.1rem 0.35rem;
    color: var(--green);
    font-size: 0.65rem;
    font-weight: 700;
}

/* --- Guild List --- */
.guild-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guild-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    background: var(--bg);
    border-radius: 8px;
}

.guild-item img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guild-item .guild-name {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-item .guild-members {
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* --- Guild Budget Layout --- */
.guild-item.guild-item-col {
    flex-direction: column;
    align-items: stretch;
}

.guild-item-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guild-budget-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.4rem 0 0 2.5rem;
    border-top: 1px solid var(--border);
    margin-top: 0.4rem;
}

.guild-budget-info {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.guild-budget-label {
    color: var(--text-dim);
}

.guild-budget-cost {
    color: var(--text-dim);
    opacity: 0.8;
}

.guild-budget-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.guild-budget-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.guild-budget-bar .fill.warning {
    background: var(--yellow, #f0b429);
}

.guild-budget-bar .fill.danger {
    background: var(--red, #e53e3e);
}

.guild-budget-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.guild-budget-input {
    width: 80px;
    padding: 0.3rem 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.75rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.guild-budget-input:focus {
    border-color: var(--accent);
}

.guild-budget-input::placeholder {
    color: #3a3a4a;
    font-size: 0.7rem;
}

/* --- Server Glossary --- */
.glossary-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.glossary-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.glossary-table td:last-child {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 6px;
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
}

.no-guilds {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.add-guild-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.add-guild-row input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.add-guild-row input:focus {
    border-color: var(--accent);
}

.add-guild-row input::placeholder {
    color: #3a3a4a;
}

/* --- Prompt Editor --- */
.prompt-editor textarea {
    width: 100%;
    min-height: 160px;
    padding: 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.prompt-editor textarea:focus {
    border-color: var(--accent);
}

.prompt-editor .prompt-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    gap: 0.5rem;
}

.prompt-editor .prompt-hint {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* --- Test Widget --- */
.test-widget {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.test-widget input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
}

.test-widget input:focus {
    border-color: var(--accent);
}

.test-select {
    padding: 0.65rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
}

.test-result {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.5;
    display: none;
}

.test-result.show {
    display: block;
}

.test-result .meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

/* --- User Prefs --- */
.prefs-count {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}
