* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[v-cloak] {
    display: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    background: #f3f4f6;
    padding: 20px;
    color: #1f2937;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
}

/* Login */
.login {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.login h2 {
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.login input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.login input:focus {
    outline: none;
    border-color: #3b82f6;
}

.login button {
    width: 100%;
    padding: 10px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.login button:hover:not(:disabled) {
    background: #2563eb;
}

.login button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
}

/* Main */
.main,
.admin-panel {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-panel h1 {
    margin-bottom: 16px;
    color: #1f2937;
}

.logout {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    position: fixed;
    top: 20px;
    right: 20px;
}

.logout:hover {
    background: #dc2626;
}

/* Messages */
.error-message {
    color: #dc2626;
    background: #fee2e2;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #fecaca;
    font-size: 14px;
    margin-bottom: 16px;
}

.notice-message {
    color: #166534;
    background: #f0fdf4;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #bbf7d0;
    font-size: 14px;
    margin-bottom: 16px;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #3b82f6;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.admin-tab-content {
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Tables */
.admin-table,
.table-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.admin-table th,
.table-container th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    border-bottom: 2px solid #e5e7eb;
    color: #6b7280;
    text-transform: uppercase;
}

.admin-table td,
.table-container td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
}

.admin-table tr:hover {
    background: #f9fafb;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.table-container table {
    margin-top: 0;
}

.amount {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.income-row {
    background-color: #f0fdf4;
}

.expense-row {
    background-color: #fef2f2;
}

.empty-cell {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.inline-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.inline-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.actions-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Forms */
.participant-form,
.operation-form {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.participant-form h3,
.operation-form h3 {
    margin-bottom: 16px;
    font-size: 16px;
    color: #1f2937;
}

.form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    min-width: 150px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #6b7280;
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group-action {
    flex: 0 0 auto;
}

.date-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
}

.today-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.today-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.date-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.type-filter {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* Buttons */
.btn-primary {
    background: #3b82f6;
    color: white;
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-save-small {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
}

.btn-save-small:hover:not(:disabled) {
    background: #2563eb;
}

.btn-delete {
    background: #ef4444;
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-delete:hover:not(:disabled) {
    background: #dc2626;
}

.btn-create-operation {
    padding: 10px 24px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    margin-top: 16px;
}

.btn-create-operation:hover:not(:disabled) {
    background: #059669;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Top panel + stats */
.top-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 16px;
}

.select-participant {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    min-width: 220px;
}

.stats-container {
    display: flex;
    gap: 16px;
}

.stat-card {
    background: #f9fafb;
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    min-width: 140px;
}

.stat-card h3 {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.pagination-btn {
    padding: 8px 16px;
    background: white;
    color: #3b82f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
    background: #3b82f6;
    color: white;
}

.pagination-info {
    color: #6b7280;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .main,
    .admin-panel {
        padding: 16px;
    }

    .top-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-container,
    .stat-card,
    .select-participant {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .logout {
        position: static;
        margin-bottom: 16px;
        width: 100%;
    }
}
