/* Global */
body {
    padding-bottom: 80px;
}

.container {
    max-width: 600px;
    padding: 1rem;
}

/* Auth */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    text-align: center;
}

.auth-container h1 {
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--muted-color);
    margin-bottom: 2rem;
}

.tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}

.tab-bar button {
    flex: 1;
    border-radius: 0;
    margin: 0;
    background: var(--card-background-color);
    border: 1px solid var(--muted-border-color);
    color: var(--muted-color);
}

.tab-bar button:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.tab-bar button:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.tab-bar button.active {
    background: var(--primary);
    color: var(--primary-inverse);
    border-color: var(--primary);
}

/* Buttons */
.full-width {
    width: 100%;
}

.small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.danger {
    --primary: #dc3545;
    --primary-hover: #c82333;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-buttons button {
    flex: 1;
}

/* Form Card */
.form-card {
    margin-bottom: 1rem;
}

/* Groups */
.group-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-card {
    text-decoration: none;
    color: inherit;
}

.group-card article {
    margin: 0;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.group-card article:active {
    box-shadow: 0 0 0 2px var(--primary);
}

.group-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
}

/* Balances */
.balance {
    font-weight: 600;
    margin: 0;
}

.balance.positive {
    color: #22c55e;
}

.balance.negative {
    color: #ef4444;
}

/* Debts */
.debt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.debt-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0.75rem 1rem;
}

.amount {
    font-weight: 600;
    white-space: nowrap;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-header h3 {
    margin: 0;
}

/* Expenses */
.expense-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.expense-card {
    margin: 0;
    cursor: pointer;
}

.expense-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.expense-amount {
    text-align: right;
}

.expense-amount small {
    display: block;
    color: var(--muted-color);
}

.expense-splits {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--muted-border-color);
}

.split-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

/* Settlements */
.settlement-suggestion,
.settlement-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 0.5rem 0;
    padding: 0.75rem 1rem;
}

/* Split Type */
.split-type-toggle {
    display: flex;
    gap: 1.5rem;
}

.split-input {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.split-input label {
    margin: 0;
    white-space: nowrap;
}

.split-input input {
    max-width: 120px;
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.hint {
    font-size: 0.875rem;
    color: var(--muted-color);
}

/* Settings */
.settings-group-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.backup-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.backup-actions button {
    flex: 1;
}

/* Errors */
.error-msg {
    color: #ef4444;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    color: var(--muted-color);
    padding: 2rem 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    z-index: 1000;
    font-size: 0.875rem;
}

/* Offline */
.offline-container {
    text-align: center;
    padding: 4rem 1rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    background: var(--card-background-color);
    border-top: 1px solid var(--muted-border-color);
    padding: 0.5rem 1rem;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--muted-color);
    font-size: 0.75rem;
    gap: 0.25rem;
    padding: 0.25rem 1rem;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}
