/* Arraial dos Valentes - Layout Desktop Moderno com Menu Lateral & Cores Claras */
:root {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-secondary: #f1f5f9;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: #2563eb;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-blue-light: #eff6ff;
    --accent-green: #10b981;
    --accent-green-light: #ecfdf5;
    --accent-gold: #d97706;
    --accent-gold-light: #fffbeb;
    --accent-red: #ef4444;
    --accent-red-light: #fef2f2;
    --accent-purple: #8b5cf6;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.08);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Layout Grid Container */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Menu Lateral (Desktop) */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 120;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px 16px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.sidebar-header {
    margin-bottom: 32px;
    padding: 0 8px;
}

.sidebar-logo {
    height: 46px;
    object-fit: contain;
    width: 100%;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: var(--transition);
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.sidebar-user-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.sidebar-logout-btn {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-logout-btn:hover {
    background: #ef4444;
    color: white;
}

/* Main Content Wrapper */
.main-wrapper {
    flex-grow: 1;
    margin-left: 260px;
    padding-bottom: 40px;
    transition: var(--transition);
}

/* Header Navbar Mobile */
.app-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-brand img {
    height: 36px;
    object-fit: contain;
}

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

.user-badge {
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.btn-logout-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout-icon:hover {
    background: var(--accent-red-light);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Main Container */
.app-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Page Title Banner */
.page-banner {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Cards & Grid Layout */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.clean-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.clean-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    font-weight: 700;
    font-size: 1.05rem;
}

.card-title-bar i {
    color: var(--accent-blue);
}

/* Metric KPI Cards */
.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-blue-light);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.kpi-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 600;
}

/* Buttons */
.btn-primary {
    background: var(--accent-blue);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.88rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-success { background: var(--accent-green); color: white; }
.btn-danger { background: var(--accent-red); color: white; }

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

/* Tables Adaptadas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.clean-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.clean-table th, .clean-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.clean-table th {
    background: var(--bg-secondary);
    font-weight: 700;
    color: var(--text-secondary);
}

.clean-table tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-active { background: var(--accent-green-light); color: var(--accent-green); }
.badge-pending { background: var(--accent-gold-light); color: var(--accent-gold); }
.badge-blocked { background: var(--accent-red-light); color: var(--accent-red); }

/* Progress Bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Mobile Navigation Bar */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    justify-content: space-around;
    padding: 10px 0;
    z-index: 100;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.mobile-nav-item i {
    font-size: 1.15rem;
}

.mobile-nav-item.active {
    color: var(--accent-blue);
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.modal-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    max-width: 500px;
    width: 100%;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .app-sidebar {
        display: none;
    }
    .main-wrapper {
        margin-left: 0;
        padding-bottom: 90px;
    }
    .app-header {
        display: flex;
    }
    .mobile-nav {
        display: flex;
    }
}
