/* ============================================================
   AQUA PREMIUM LIGHT — Design System Global
   Sistema de Monitoramento de Carro-Pipa v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Variáveis Globais ─────────────────────────────────────── */
:root {
    --primary:       #0EA5E9;
    --primary-dark:  #0284C7;
    --primary-light: #E0F2FE;
    --primary-50:    #F0F9FF;
    --secondary:     #06B6D4;
    --success:       #10B981;
    --success-light: #D1FAE5;
    --warning:       #F59E0B;
    --warning-light: #FEF3C7;
    --danger:        #EF4444;
    --danger-light:  #FEE2E2;
    --info:          #6366F1;
    --info-light:    #EEF2FF;

    --bg:            #F0F9FF;
    --bg-card:       #FFFFFF;
    --bg-sidebar:    linear-gradient(180deg, #0EA5E9 0%, #0284C7 50%, #0369A1 100%);

    --text:          #0F172A;
    --text-secondary:#64748B;
    --text-muted:    #94A3B8;
    --text-white:    #FFFFFF;

    --border:        #E2E8F0;
    --border-light:  #F1F5F9;
    --divider:       #F1F5F9;

    --shadow-xs:     0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl:     0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);

    --radius-sm:     8px;
    --radius:        12px;
    --radius-lg:     16px;
    --radius-xl:     20px;
    --radius-full:   9999px;

    --sidebar-width: 260px;
    --header-height: 70px;
    --transition:    all 0.2s ease;
    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Tipografia ────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* ── Cards Premium ─────────────────────────────────────────── */
.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: var(--transition);
}
.card-premium:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.card-premium .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.card-premium .card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.card-premium .card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.card-icon.blue    { background: var(--primary-light); color: var(--primary); }
.card-icon.green   { background: var(--success-light); color: var(--success); }
.card-icon.yellow  { background: var(--warning-light); color: var(--warning); }
.card-icon.red     { background: var(--danger-light);  color: var(--danger); }
.card-icon.purple  { background: var(--info-light);    color: var(--info); }

/* ── Stat Cards Grid ───────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Botões Premium ────────────────────────────────────────── */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-premium:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-premium:active { transform: translateY(0); }

.btn-primary-premium {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}
.btn-primary-premium:hover { box-shadow: 0 4px 14px rgba(14,165,233,0.4); color: white; }

.btn-success-premium {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}
.btn-danger-premium {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
}
.btn-warning-premium {
    background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
    color: white;
}
.btn-outline-premium {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline-premium:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-50);
}
.btn-lg { padding: 1rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; border-radius: var(--radius-sm); }

/* ── Badges ────────────────────────────────────────────────── */
.badge-premium {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-pendente  { background: var(--warning-light); color: #92400E; }
.badge-aprovada  { background: var(--success-light); color: #065F46; }
.badge-agendado  { background: var(--primary-light); color: #075985; }
.badge-andamento { background: var(--info-light);    color: #3730A3; }
.badge-concluido { background: var(--success-light); color: #065F46; }
.badge-cancelado { background: var(--danger-light);  color: #991B1B; }
.badge-recusada  { background: var(--danger-light);  color: #991B1B; }
.badge-ativo     { background: var(--success-light); color: #065F46; }
.badge-inativo   { background: #F1F5F9;              color: #475569; }

/* ── Tabelas Premium ───────────────────────────────────────── */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.table-premium thead th {
    background: var(--primary-50);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.table-premium tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--divider);
    font-size: 0.875rem;
    vertical-align: middle;
}
.table-premium tbody tr:hover { background: var(--primary-50); }
.table-premium tbody tr:last-child td { border-bottom: none; }

/* ── Formulários ───────────────────────────────────────────── */
.form-control-premium {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--text);
    background: white;
    transition: var(--transition);
}
.form-control-premium:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
.form-control-premium::placeholder { color: var(--text-muted); }

.form-label-premium {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ── Alertas ───────────────────────────────────────────────── */
.alert-premium {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.alert-info    { background: var(--primary-light); color: #075985; border-left: 4px solid var(--primary); }
.alert-success { background: var(--success-light); color: #065F46; border-left: 4px solid var(--success); }
.alert-warning { background: var(--warning-light); color: #92400E; border-left: 4px solid var(--warning); }
.alert-danger  { background: var(--danger-light);  color: #991B1B; border-left: 4px solid var(--danger); }

/* ── Animações ─────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.animate-fadeInUp   { animation: fadeInUp 0.4s ease-out; }
.animate-fadeIn     { animation: fadeIn 0.3s ease-out; }
.animate-slideIn    { animation: slideInRight 0.3s ease-out; }
.animate-pulse      { animation: pulse 2s infinite; }

/* Staggered animations */
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }

/* ── Utilitários ───────────────────────────────────────────── */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar Customizada ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Loading Skeleton ──────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--bg) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}
.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
}
.empty-state h5 {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}
.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Mobile Bottom Nav ─────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.04);
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    transition: var(--transition);
    text-decoration: none;
}
.bottom-nav a i { font-size: 1.25rem; }
.bottom-nav a.active,
.bottom-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ── SweetAlert2 Light Override ─────────────────────────────── */
.swal2-popup {
    border-radius: var(--radius-xl) !important;
    font-family: var(--font) !important;
}
.swal2-title { font-weight: 700 !important; color: var(--text) !important; }
.swal2-html-container { color: var(--text-secondary) !important; }
.swal2-confirm {
    border-radius: var(--radius) !important;
    font-weight: 600 !important;
    padding: 0.75rem 2rem !important;
}

/* ── Responsividade ────────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    .card-premium { padding: 1.25rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .card-premium .card-value { font-size: 1.5rem; }
    body { padding-bottom: 72px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .btn-premium { padding: 0.625rem 1rem; font-size: 0.8rem; }
}
