/* =====================================================
   ATLÂNTICA ACERVO TÉCNICO — Custom Styles
   Corporate Design: Blue + White + Gray
   ===================================================== */

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

/* --- CSS Variables --- */
:root {
    --primary:        #1a56db;
    --primary-dark:   #1340a8;
    --primary-light:  #3b82f6;
    --primary-bg:     #eff6ff;
    --secondary:      #475569;
    --success:        #059669;
    --success-light:  #d1fae5;
    --danger:         #dc2626;
    --danger-light:   #fee2e2;
    --warning:        #d97706;
    --warning-light:  #fef3c7;
    --info:           #0284c7;
    --info-light:     #e0f2fe;

    --bg-body:        #f1f5f9;
    --bg-card:        #ffffff;
    --bg-sidebar:     #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #1a56db;
    --bg-topbar:      #ffffff;

    --text-primary:   #0f172a;
    --text-secondary: #64748b;
    --text-muted:     #94a3b8;
    --text-sidebar:   #cbd5e1;
    --text-sidebar-active: #ffffff;

    --border-color:   #e2e8f0;
    --border-radius:  0.5rem;
    --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow:         0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --sidebar-width:  260px;
    --sidebar-collapsed: 0px;
    --topbar-height:  64px;
    --transition:     all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--primary-dark);
}

/* --- Sidebar --- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1050;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.sidebar-brand-icon {
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-text {
    color: #fff;
}

.sidebar-brand-text h5 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.01em;
}

.sidebar-brand-text small {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-section {
    padding: 0.5rem 1.5rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--text-sidebar);
    font-size: 0.825rem;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
    cursor: pointer;
}

.sidebar-link:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
    border-left-color: rgba(255,255,255,0.2);
}

.sidebar-link.active {
    background: rgba(26, 86, 219, 0.15);
    color: var(--text-sidebar-active);
    border-left-color: var(--primary-light);
    font-weight: 500;
}

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

.sidebar-link.active i {
    opacity: 1;
}

.sidebar-sub-link {
    padding-left: 3.25rem;
    font-size: 0.8rem;
}

/* --- Topbar --- */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 1040;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: var(--transition);
}

.topbar-toggle:hover {
    background: var(--bg-body);
    color: var(--primary);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 0.825rem;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.75rem;
}

.topbar-user-info {
    line-height: 1.2;
}

.topbar-user-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-user-info small {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: capitalize;
}

/* --- Main Content --- */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: var(--transition);
}

.content-wrapper {
    padding: 1.5rem;
}

/* --- Sidebar Collapsed --- */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .topbar {
    left: 0;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

/* --- Stat Cards --- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-bg); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red { background: var(--danger-light); color: var(--danger); }
.stat-icon.cyan { background: var(--info-light); color: var(--info); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header .breadcrumb {
    margin: 0;
    font-size: 0.8rem;
}

/* --- Tables --- */
.table {
    font-size: 0.825rem;
}

.table thead th {
    background: var(--bg-body);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    border-bottom: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--primary-bg);
}

.table-actions {
    display: flex;
    gap: 0.25rem;
}

.table-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* --- Badges --- */
.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status.active,
.badge-status.atende {
    background: var(--success-light);
    color: var(--success);
}

.badge-status.inactive,
.badge-status.nao-atende {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-status.parcial {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* --- Buttons --- */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 0.825rem;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(26, 86, 219, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(26, 86, 219, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-light {
    background: #fff;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-light:hover {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* --- Forms --- */
.form-control,
.form-select {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    border-color: var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
    color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
}

.search-bar .form-control {
    padding-left: 2.5rem;
    background: var(--bg-body);
    border-color: transparent;
}

.search-bar .form-control:focus {
    background: #fff;
    border-color: var(--primary-light);
}

.search-bar i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Pagination Custom --- */
.pagination .page-link {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
    color: var(--text-secondary);
    border-color: var(--border-color);
    font-weight: 500;
}

.pagination .page-link:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.pagination .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Alerts --- */
.alert {
    font-size: 0.825rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
}

/* --- Login Page --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1a56db 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(26, 86, 219, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.login-card {
    background: rgba(255, 255, 255, 0.97);
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(26, 86, 219, 0.4);
}

.login-logo h4 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h5 {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* --- Chart Container --- */
.chart-container {
    position: relative;
    height: 280px;
}

/* --- Capacity Bar --- */
.capacity-bar {
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.capacity-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.capacity-bar-fill.green { background: var(--success); }
.capacity-bar-fill.orange { background: var(--warning); }
.capacity-bar-fill.red { background: var(--danger); }

/* --- Step Wizard --- */
.step-wizard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0 1rem;
    flex-wrap: wrap;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.step-item.active {
    color: var(--primary);
}

.step-item.completed {
    color: var(--success);
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.step-item.active .step-number {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.step-item.completed .step-number {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-connector {
    width: 30px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.step-item.completed + .step-connector {
    background: var(--success);
}

/* --- Detail Page --- */
.detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 1rem;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1045;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-card {
        margin: 1rem;
        padding: 1.5rem;
    }
}

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

.content-wrapper {
    animation: fadeIn 0.3s ease;
}

.stat-card {
    animation: fadeIn 0.4s ease;
}

/* --- Print Styles --- */
@media print {
    .sidebar,
    .topbar,
    .btn,
    .pagination,
    .search-bar {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
