:root {
    --line-green: #06C755;
    --line-green-dark: #05b34c;
    --bg-color: #F4F5F7;
    --card-bg: #FFFFFF;
    --text-primary: #111111;
    --text-secondary: #666666;
    --border-color: #E5E5E5;
    --nav-height: 60px;
    --nav-icon-size: 24px;
}

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    /* Prevent body scroll, handle scroll in content */
}

a {
    color: var(--line-green);
    text-decoration: none;
}

/* App Shell Layout */
.miniapp-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    /* For mobile browsers with dynamic UI */
    width: 100%;
    margin: 0 auto;
    background-color: var(--bg-color);
    position: relative;
}

.miniapp-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: var(--nav-height);
    /* Space for bottom nav */
    padding-top: env(safe-area-inset-top);
}

.miniapp-bottom-nav {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: var(--nav-height);
    background-color: #FAFAFA;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-item.active {
    color: var(--line-green);
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: var(--nav-icon-size);
    margin-bottom: 2px;
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Reusable UI Components */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 20px 16px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin: 16px 16px 8px 16px;
}

/* Blazor Default Styles Preserved */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

#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: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* Flat UI Forms and Cards */
.flat-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: none;
}

.form-control-flat,
.form-select-flat {
    background-color: #F5F6F8;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-control-flat:focus,
.form-select-flat:focus {
    background-color: #FFFFFF;
    border-color: var(--line-green);
    box-shadow: 0 0 0 3px rgba(6, 199, 85, 0.1);
    outline: none;
}

.form-label-flat {
    font-size: 0.8rem;
    font-weight: 700;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}