:root {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --nav-bg: #ffffff;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0f172a;
        --text-primary: #f8fafc;
        --text-secondary: #94a3b8;
        --primary: #3b82f6;
        --primary-hover: #60a5fa;
        --card-bg: #1e293b;
        --border: #334155;
        --nav-bg: #1e293b;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    padding-bottom: 70px; /* Space for bottom nav */
}

/* Typography */
h1, h2, h3 { font-weight: 600; }

/* Forms */
input, select, button {
    font-family: inherit;
    font-size: 16px;
}

input[type="text"], 
input[type="password"], 
input[type="email"], 
input[type="date"], 
input[type="number"], 
select {
    display: block !important;
    width: 100% !important;
    padding: 18px 22px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    border: 1px solid var(--border) !important;
    border-radius: 12px !important;
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    margin-bottom: 24px !important;
    box-sizing: border-box !important;
    -webkit-appearance: none; /* Mobile fix */
    -moz-appearance: none;
    appearance: none;
    height: auto !important; /* Mobile fix */
    transition: all 0.2s;
}

.form-group {
    margin-bottom: 32px;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

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

/* Buttons */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }
.btn-success { background: var(--success); color: white; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Layout */
.container {
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Bottom Nav */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 1000;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    gap: 4px;
}
.nav-item.active {
    color: var(--primary);
}

/* Utility */
.hidden { display: none !important; }
.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.badge-judicial { background: var(--warning); color: #fff; }
.badge-apreendido { background: var(--success); color: #fff; }
.badge-monitoramento { background: var(--primary); color: #fff; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Auth View */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
    background: #ffffff;
}
.auth-card h1 {
    margin-bottom: 24px;
}
.login-logo {
    display: block;
    margin: 0 auto 16px auto;
    max-width: 180px;
    height: auto;
}
