:root {
    --bg: #181c22;
    --panel: #1e232c;
    --control: #262d3a;
    --button: #2e3546;
    --text: #e6e6eb;
    --text-dim: #9aa0ac;
    --accent: #4c91ff;
    --warning: #5e2c2c;
    --danger: #e67878;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    height: 100%;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header.topbar {
    background: var(--panel);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

header.topbar h1 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: 600;
}

header.topbar .user-email {
    font-size: 0.75rem;
    color: var(--text-dim);
}

#sair-button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    cursor: pointer;
}

main {
    flex: 1;
    padding: 16px;
    padding-bottom: 90px;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.card {
    background: var(--control);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.card .label {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.card .value {
    font-size: 1.3rem;
    font-weight: 600;
}

h2.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text);
}

button, .btn {
    background: var(--button);
    color: var(--text);
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.95rem;
    cursor: pointer;
}

button.primary {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

button.danger {
    background: var(--warning);
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

.btn-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

input, select, textarea {
    width: 100%;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--button);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

label {
    font-size: 0.8rem;
    color: var(--text-dim);
    display: block;
    margin-bottom: 4px;
}

.list-item {
    background: var(--control);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.list-item .info {
    flex: 1;
}

.list-item .title {
    font-weight: 600;
}

.list-item .subtitle {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.list-item.alerta {
    background: var(--warning);
}

.empty-state {
    color: var(--text-dim);
    text-align: center;
    padding: 30px 10px;
    font-size: 0.9rem;
}

nav.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--panel);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid var(--button);
    z-index: 10;
}

nav.bottom-nav button {
    background: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    color: var(--text-dim);
    font-size: 0.68rem;
    border-radius: 0;
}

nav.bottom-nav button.active {
    color: var(--accent);
}

nav.bottom-nav .icon {
    font-size: 1.2rem;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin: 8px 0;
    min-height: 1.2em;
}

.center-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 340px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
}

.login-box a.toggle-link {
    display: block;
    text-align: center;
    color: var(--accent);
    margin-top: 14px;
    font-size: 0.85rem;
    cursor: pointer;
}

.hidden {
    display: none !important;
}
