:root {
    --primary: #1e3a5f;
    --primary-light: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-900: #0f172a;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 20px;
    font-weight: 700;
}

.app-header p {
    font-size: 13px;
    opacity: 0.8;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-500);
    font-size: 11px;
    padding: 5px 15px;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 3px;
}

.nav-item.active {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-item .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: none;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-badge.ativa {
    background: #d1fae5;
    color: #059669;
}

.status-badge.pendente {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.encerrada {
    background: var(--gray-200);
    color: var(--gray-500);
}

/* Locação Card */
.locacao-card {
    border-left: 4px solid var(--primary);
}

.locacao-card.ativa {
    border-left-color: var(--success);
}

.locacao-card .veiculo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.locacao-card .veiculo-icon {
    width: 50px;
    height: 50px;
    background: var(--gray-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.locacao-card .veiculo-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.locacao-card .veiculo-info .placa {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.locacao-card .datas {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.locacao-card .datas div {
    text-align: center;
}

.locacao-card .datas .label {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
}

.locacao-card .datas .valor {
    font-size: 14px;
    font-weight: 600;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray-700);
    padding: 16px 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.quick-action i {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--primary);
}

.quick-action span {
    font-size: 11px;
    text-align: center;
}

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 20px;
}

.stat-card .icon.blue { background: #dbeafe; color: #2563eb; }
.stat-card .icon.green { background: #d1fae5; color: #059669; }
.stat-card .icon.yellow { background: #fef3c7; color: #d97706; }
.stat-card .icon.red { background: #fee2e2; color: #dc2626; }

.stat-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.stat-card p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

/* Section */
.section {
    padding: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title a {
    font-size: 13px;
    color: var(--primary-light);
    text-decoration: none;
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--gray-100);
}

.list-item:first-child {
    border-radius: 12px 12px 0 0;
}

.list-item:last-child {
    border-radius: 0 0 12px 12px;
    border-bottom: none;
}

.list-item:only-child {
    border-radius: 12px;
}

.list-item .icon {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary);
}

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

.list-item .content h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.list-item .content p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

.list-item .arrow {
    color: var(--gray-500);
}

/* Buttons */
.btn-app {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

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

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

.btn-app.outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-app.whatsapp {
    background: #25D366;
    color: white;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.login-header {
    padding: 60px 20px 40px;
    text-align: center;
    color: white;
}

.login-header .logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header p {
    opacity: 0.8;
}

.login-form {
    flex: 1;
    background: white;
    border-radius: 24px 24px 0 0;
    padding: 32px 24px;
}

.login-form h2 {
    font-size: 20px;
    margin-bottom: 24px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-200);
    margin-bottom: 16px;
}

.empty-state p {
    color: var(--gray-500);
}

/* Alert */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success {
    background: #d1fae5;
    color: #059669;
}

.alert.warning {
    background: #fef3c7;
    color: #d97706;
}

.alert.danger {
    background: #fee2e2;
    color: #dc2626;
}

/* Document Card */
.doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 10px;
}

.doc-card .icon {
    width: 45px;
    height: 45px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.doc-card .info {
    flex: 1;
}

.doc-card .info h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.doc-card .info p {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

.doc-card .btn-download {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Pull to Refresh indicator */
.ptr-element {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
}
