:root {
    --primary: #1565C0;
    --primary-light: #1976D2;
    --success: #2E7D32;
    --danger: #C62828;
    --warning: #F57F17;
    --bg: #F5F5F5;
    --surface: #FFFFFF;
    --text: #212121;
    --text-secondary: #757575;
    --border: #E0E0E0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 24px;
}

.login-container h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 32px;
    font-size: 28px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 16px;
    background: var(--surface);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { background: #90CAF9; cursor: not-allowed; }

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.card-title {
    font-weight: 600;
    font-size: 16px;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft { background: #E3F2FD; color: #1565C0; }
.badge-submitted { background: #FFF3E0; color: #E65100; }
.badge-approved { background: #E8F5E9; color: #2E7D32; }
.badge-rejected { background: #FFEBEE; color: #C62828; }
.badge-posted { background: #F3E5F5; color: #7B1FA2; }

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 16px;
}

.toolbar h2 {
    font-size: 20px;
}

/* Search */
.search-bar {
    margin-bottom: 16px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 16px;
    background: var(--surface);
}

/* Detail view */
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.detail-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-value {
    font-weight: 500;
    text-align: right;
}

.action-bar {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    position: sticky;
    bottom: 0;
    background: var(--bg);
}

.action-bar .btn {
    flex: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
}

/* Error */
.error {
    background: #FFEBEE;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

/* Connection indicator */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.connection-dot.connected { background: var(--success); }
.connection-dot.disconnected { background: var(--danger); }

/* Amount formatting */
.amount {
    font-family: 'SF Mono', 'Fira Code', monospace;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
